[Spice-devel] [PATCH qxl-wddm-dod v3] Introduce Appveyor CI integration

2017-06-13 Thread Dmitry Fleytman
Changes since previous version:

  1. Commit message extended.

Dmitry Fleytman (1):
  ci: Integrate with Appveyor

 .appveyor.yml | 18 ++
 1 file changed, 18 insertions(+)
 create mode 100644 .appveyor.yml

-- 
2.7.0.windows.1

___
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/spice-devel


[Spice-devel] [PATCH qxl-wddm-dod v3] ci: Integrate with Appveyor

2017-06-13 Thread Dmitry Fleytman
This patch introduces Appveyor CI configuration file.

Having this patch pushed and qxl-wddm-dod repository
registered at Appveyor, every push or merge request will
be automatically built on their servers.

Signed-off-by: Dmitry Fleytman <dmi...@daynix.com>
---
 .appveyor.yml | 18 ++
 1 file changed, 18 insertions(+)
 create mode 100644 .appveyor.yml

diff --git a/.appveyor.yml b/.appveyor.yml
new file mode 100644
index 000..f3f3e5c
--- /dev/null
+++ b/.appveyor.yml
@@ -0,0 +1,18 @@
+image: Visual Studio 2015
+
+version: build-{build}-{branch}
+
+before_build:
+  - ren "C:\Program Files (x86)\Windows Kits\10\include\00wdf" "wdf"
+
+build_script: buildAll.bat
+
+skip_commits:
+  message: /\[ci skip\]/
+
+notifications:
+  - provider: Email
+to: spice-devel@lists.freedesktop.org
+on_build_success: false
+on_build_failure: true
+on_build_status_changed: true
-- 
2.7.0.windows.1

___
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/spice-devel


Re: [Spice-devel] [PATCH qxl-wddm-dod v2] ci: Integrate with Appveyor

2017-06-13 Thread Dmitry Fleytman
I’m sending the next version with updated commit message.
See more answers below…

> On 8 Jun 2017, at 15:00 PM, Dmitry Fleytman <dmi...@daynix.com> wrote:
> 
> Hi Frediano, thanks for review.
> See below.
> 
> 
>> On 8 Jun 2017, at 13:42 PM, Frediano Ziglio <fzig...@redhat.com 
>> <mailto:fzig...@redhat.com>> wrote:
>> 
>> 
>> 
>> Hello All,
>> 
>> This patch introduces Appveyor CI configuration file.
>> 
>> Having this patch pushed and qxl-wddm-dod repository registered at Appveyor,
>> every push or merge request will be automatically built on their servers.
>> 
>> If you need to comment a single patch to add explanation maybe this 
>> additional
>> explanation should be added to the commit message.
> 
> Yes, good idea. I will add.

Added.
>> Build status notifications will be sent to this list 
>> (spice-devel@lists.freedesktop.org 
>> <mailto:spice-devel@lists.freedesktop.org>)
>> It seems that the message arrive as html with no corresponding test, see
>> https://lists.freedesktop.org/archives/spice-devel/2017-June/037963.html. 
>> <https://lists.freedesktop.org/archives/spice-devel/2017-June/037963.html>
>> Is possible to have pure text messages instead?
> 
> Probably yes, I will check if Appveyor supports this.

Unfortunately Appveyor cannot send plain text e-mails.
>> Best Regards,
>> Dmitry
>> 
>> On 8 Jun 2017, at 10:10 AM, Dmitry Fleytman <dmi...@daynix.com 
>> <mailto:dmi...@daynix.com>> wrote:
>> 
>> Signed-off-by: Dmitry Fleytman <dmi...@daynix.com <mailto:dmi...@daynix.com>>
>> ---
>> .appveyor.yml | 18 ++
>> 1 file changed, 18 insertions(+)
>> create mode 100644 .appveyor.yml
>> 
>> diff --git a/.appveyor.yml b/.appveyor.yml
>> new file mode 100644
>> index 000..f3f3e5c
>> --- /dev/null
>> +++ b/.appveyor.yml
>> @@ -0,0 +1,18 @@
>> +image: Visual Studio 2015
>> +
>> This cause to stick to a version of images and if image are going to be 
>> removed in the
>> future this won't work. I use AppVeyor for another project and I know images 
>> are
>> updated and obsolete ones are removed after a while. From my experience is 
>> better to
>> fix the issues with the last machine version.
> 
> Not sure I understand. What do you mean by “last machine version”?


Frediano, please elaborate.

>> 
>> +version: build-{build}-{branch}
>> +
>> +before_build:
>> +  - ren "C:\Program Files (x86)\Windows Kits\10\include\00wdf" "wdf"
>> +
>> +build_script: buildAll.bat
>> +
>> +skip_commits:
>> +  message: /\[ci skip\]/
>> +
>> what does this?
> 
> A nice feature borrowed from Travis-CI - If commit message includes “[ci 
> skip]” - CI is not run for this commit.
> 
>> 
>> +notifications:
>> +  - provider: Email
>> +to:  <mailto:spice-devel@lists.freedesktop.org> 
>> <>spice-devel@lists.freedesktop.org 
>> <mailto:spice-devel@lists.freedesktop.org>
>> Not strictly related to this patch, is usually a good idea to add sender 
>> e-mail
>> to the ML. Did you do it?
> 
> Not yet. I did not register upstream repository with Appveyor also.
> Will do it after the patch is inside.
>> 
>> +on_build_success: false
>> +on_build_failure: true
>> +on_build_status_changed: true
>> Frediano

___
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/spice-devel


Re: [Spice-devel] [PATCH qxl-wddm-dod v2] ci: Integrate with Appveyor

2017-06-08 Thread Dmitry Fleytman
Hi Frediano, thanks for review.
See below.


> On 8 Jun 2017, at 13:42 PM, Frediano Ziglio <fzig...@redhat.com> wrote:
> 
> 
> 
> Hello All,
> 
> This patch introduces Appveyor CI configuration file.
> 
> Having this patch pushed and qxl-wddm-dod repository registered at Appveyor,
> every push or merge request will be automatically built on their servers.
> 
> If you need to comment a single patch to add explanation maybe this additional
> explanation should be added to the commit message.

Yes, good idea. I will add.
> Build status notifications will be sent to this list 
> (spice-devel@lists.freedesktop.org <mailto:spice-devel@lists.freedesktop.org>)
> It seems that the message arrive as html with no corresponding test, see
> https://lists.freedesktop.org/archives/spice-devel/2017-June/037963.html. 
> <https://lists.freedesktop.org/archives/spice-devel/2017-June/037963.html>
> Is possible to have pure text messages instead?

Probably yes, I will check if Appveyor supports this.
> Best Regards,
> Dmitry
> 
> On 8 Jun 2017, at 10:10 AM, Dmitry Fleytman <dmi...@daynix.com 
> <mailto:dmi...@daynix.com>> wrote:
> 
> Signed-off-by: Dmitry Fleytman <dmi...@daynix.com <mailto:dmi...@daynix.com>>
> ---
> .appveyor.yml | 18 ++
> 1 file changed, 18 insertions(+)
> create mode 100644 .appveyor.yml
> 
> diff --git a/.appveyor.yml b/.appveyor.yml
> new file mode 100644
> index 000..f3f3e5c
> --- /dev/null
> +++ b/.appveyor.yml
> @@ -0,0 +1,18 @@
> +image: Visual Studio 2015
> +
> This cause to stick to a version of images and if image are going to be 
> removed in the
> future this won't work. I use AppVeyor for another project and I know images 
> are
> updated and obsolete ones are removed after a while. From my experience is 
> better to
> fix the issues with the last machine version.

Not sure I understand. What do you mean by “last machine version”?
> 
> +version: build-{build}-{branch}
> +
> +before_build:
> +  - ren "C:\Program Files (x86)\Windows Kits\10\include\00wdf" "wdf"
> +
> +build_script: buildAll.bat
> +
> +skip_commits:
> +  message: /\[ci skip\]/
> +
> what does this?

A nice feature borrowed from Travis-CI - If commit message includes “[ci skip]” 
- CI is not run for this commit.

> 
> +notifications:
> +  - provider: Email
> +to:  
> <mailto:spice-devel@lists.freedesktop.org>spice-devel@lists.freedesktop.org <>
> Not strictly related to this patch, is usually a good idea to add sender 
> e-mail
> to the ML. Did you do it?

Not yet. I did not register upstream repository with Appveyor also.
Will do it after the patch is inside.
> 
> +on_build_success: false
> +on_build_failure: true
> +on_build_status_changed: true
> Frediano
> 

___
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/spice-devel


Re: [Spice-devel] [PATCH qxl-wddm-dod v2] ci: Integrate with Appveyor

2017-06-08 Thread Dmitry Fleytman
Hello All,

This patch introduces Appveyor CI configuration file.

Having this patch pushed and qxl-wddm-dod repository registered at Appveyor,
every push or merge request will be automatically built on their servers.

Build status notifications will be sent to this list 
(spice-devel@lists.freedesktop.org <mailto:spice-devel@lists.freedesktop.org>)

Best Regards,
Dmitry

> On 8 Jun 2017, at 10:10 AM, Dmitry Fleytman <dmi...@daynix.com> wrote:
> 
> Signed-off-by: Dmitry Fleytman <dmi...@daynix.com>
> ---
> .appveyor.yml | 18 ++
> 1 file changed, 18 insertions(+)
> create mode 100644 .appveyor.yml
> 
> diff --git a/.appveyor.yml b/.appveyor.yml
> new file mode 100644
> index 000..f3f3e5c
> --- /dev/null
> +++ b/.appveyor.yml
> @@ -0,0 +1,18 @@
> +image: Visual Studio 2015
> +
> +version: build-{build}-{branch}
> +
> +before_build:
> +  - ren "C:\Program Files (x86)\Windows Kits\10\include\00wdf" "wdf"
> +
> +build_script: buildAll.bat
> +
> +skip_commits:
> +  message: /\[ci skip\]/
> +
> +notifications:
> +  - provider: Email
> +to: spice-devel@lists.freedesktop.org
> +on_build_success: false
> +on_build_failure: true
> +on_build_status_changed: true
> -- 
> 2.7.0.windows.1
> 

___
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/spice-devel


[Spice-devel] [PATCH qxl-wddm-dod v2] ci: Integrate with Appveyor

2017-06-08 Thread Dmitry Fleytman
Signed-off-by: Dmitry Fleytman <dmi...@daynix.com>
---
 .appveyor.yml | 18 ++
 1 file changed, 18 insertions(+)
 create mode 100644 .appveyor.yml

diff --git a/.appveyor.yml b/.appveyor.yml
new file mode 100644
index 000..f3f3e5c
--- /dev/null
+++ b/.appveyor.yml
@@ -0,0 +1,18 @@
+image: Visual Studio 2015
+
+version: build-{build}-{branch}
+
+before_build:
+  - ren "C:\Program Files (x86)\Windows Kits\10\include\00wdf" "wdf"
+
+build_script: buildAll.bat
+
+skip_commits:
+  message: /\[ci skip\]/
+
+notifications:
+  - provider: Email
+to: spice-devel@lists.freedesktop.org
+on_build_success: false
+on_build_failure: true
+on_build_status_changed: true
-- 
2.7.0.windows.1

___
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/spice-devel


Re: [Spice-devel] UsbDk 1.0.19 released

2017-04-23 Thread Dmitry Fleytman
Hello Oscar,

Are you redirecting a specific USB device?
Which device is it? How do you redirect it?

Thanks,
Dmitry

> On 20 Apr 2017, at 23:03 PM, Oscar Segarra <oscar.sega...@gmail.com> wrote:
> 
> Hi, 
> 
> I have a Windows 10 client and a Windows 10 kvm guest and the usb redirection 
> does not work yet.
> 
> Nothing appears in guest event viewer.
> 
> Any help will be welcome!
> 
> 
> 
> 2017-04-20 9:47 GMT+02:00 Dmitry Fleytman <dmi...@daynix.com 
> <mailto:dmi...@daynix.com>>:
> Hi All,
> 
> The new version of UsbDk (1.0.19) was released.
> 
> This version introduces full support for Windows 10
> including attestation signature of kernel mode
> components as well as a few bug fixes and improvements.
> 
> In order to support Windows 10 UsbDk projects were
> migrated to Visual Studio 2015 and WDK/SDK 10, see
> updated documentation for more information about
> the new build environment.
> 
> The latest UsbDk source code available at:
> http://cgit.freedesktop.org/spice/win32/usbdk 
> <http://cgit.freedesktop.org/spice/win32/usbdk>
> 
> Latest source tarball is at: 
> http://www.spice-space.org/download/windows/usbdk/spice-usbdk-win-1.0-19-sources.zip
>  
> <http://www.spice-space.org/download/windows/usbdk/spice-usbdk-win-1.0-19-sources.zip>
> 
> Precompiled and signed by Red Hat binaries are available at:
> 1. 32 bit: 
> http://www.spice-space.org/download/windows/usbdk/UsbDk_1.0.19_x86.msi 
> <http://www.spice-space.org/download/windows/usbdk/UsbDk_1.0.19_x86.msi>
> 2. 64 bit: 
> http://www.spice-space.org/download/windows/usbdk/UsbDk_1.0.19_x64.msi 
> <http://www.spice-space.org/download/windows/usbdk/UsbDk_1.0.19_x64.msi>
> 
> UsbDk documentation:
> 1. Short presentation: 
> http://www.spice-space.org/docs/usbdk/UsbDk_at_a_Glance.pdf 
> <http://www.spice-space.org/docs/usbdk/UsbDk_at_a_Glance.pdf>
> 2. SDM: 
> http://www.spice-space.org/docs/usbdk/UsbDk_Software_Development_Manual.pdf 
> <http://www.spice-space.org/docs/usbdk/UsbDk_Software_Development_Manual.pdf>
> 3. UsbDk architecture specification (part of source tree):
>   http://cgit.freedesktop.org/spice/win32/usbdk/tree/ARCHITECTURE 
> <http://cgit.freedesktop.org/spice/win32/usbdk/tree/ARCHITECTURE>
> 
> Best regards,
> Dmitry
> 
> ___
> Spice-devel mailing list
> Spice-devel@lists.freedesktop.org <mailto:Spice-devel@lists.freedesktop.org>
> https://lists.freedesktop.org/mailman/listinfo/spice-devel 
> <https://lists.freedesktop.org/mailman/listinfo/spice-devel>
> 

___
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/spice-devel


[Spice-devel] UsbDk 1.0.19 released

2017-04-20 Thread Dmitry Fleytman
Hi All,

The new version of UsbDk (1.0.19) was released.

This version introduces full support for Windows 10
including attestation signature of kernel mode
components as well as a few bug fixes and improvements.

In order to support Windows 10 UsbDk projects were
migrated to Visual Studio 2015 and WDK/SDK 10, see
updated documentation for more information about
the new build environment.

The latest UsbDk source code available at:
http://cgit.freedesktop.org/spice/win32/usbdk

Latest source tarball is at: 
http://www.spice-space.org/download/windows/usbdk/spice-usbdk-win-1.0-19-sources.zip

Precompiled and signed by Red Hat binaries are available at:
1. 32 bit: 
http://www.spice-space.org/download/windows/usbdk/UsbDk_1.0.19_x86.msi
2. 64 bit: 
http://www.spice-space.org/download/windows/usbdk/UsbDk_1.0.19_x64.msi

UsbDk documentation:
1. Short presentation: 
http://www.spice-space.org/docs/usbdk/UsbDk_at_a_Glance.pdf
2. SDM: 
http://www.spice-space.org/docs/usbdk/UsbDk_Software_Development_Manual.pdf
3. UsbDk architecture specification (part of source tree):
  http://cgit.freedesktop.org/spice/win32/usbdk/tree/ARCHITECTURE

Best regards,
Dmitry

___
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/spice-devel


Re: [Spice-devel] Problem with driver signing.

2017-03-28 Thread Dmitry Fleytman
Hello Joshua,

This is a known issue.
Please install update 
https://technet.microsoft.com/en-us/library/security/3033929 
 on your system.

Thanks,
Dmitry

> On 28 Mar 2017, at 10:59 AM, Yuri Benditovich  
> wrote:
> 
> Thank you for your feedback. Right now we faced the same problem on at least 
> one of Win7-x64 systems. We're investigating the problem.
> 
> On Tue, Mar 28, 2017 at 3:30 AM, Joshua J. Kugler  > wrote:
> So, from my reading of the docs, I was under the impression that released
> drivers would be signed.
> 
> I downloaded
> 
> https://www.spice-space.org/download/windows/usbdk/UsbDk_1.0.17_x64.msi 
> 
> 
> And installed it in the Windows 7 VM.  After installing, I got a popup from
> Windows that said:
> 
> A recently installed program tried to install an unsigned driver. This version
> of Windows requires all drivers to have a valid digital signature."  (and some
> more text). It then says the location is "C:\windows\system32\...\UsbDk.sys"
> 
> I see new UHCI and EHCI devices, but it is telling me it can't load the
> drivers becaues they aren't signed.
> 
> Also (because of this issue, I assume) I lose the "tablet" device that allows
> the seamless mouse, until I uninstall UsbDk.
> 
> Am I doing something wrong?
> 
> (I posted in #spice on GimpNET, but no replies as of the time of posting.)
> 
> j
> 
> --
> Joshua J. Kugler - Fairbanks, Alaska
> Azariah Enterprises - Programming and Website Design
> jos...@azariah.com  - Jabber: pedah...@gmail.com 
> 
> PGP Key: http://pgp.mit.edu/   ID 0x73B13B6A
> ___
> Spice-devel mailing list
> Spice-devel@lists.freedesktop.org 
> https://lists.freedesktop.org/mailman/listinfo/spice-devel 
> 
> 
> ___
> Spice-devel mailing list
> Spice-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/spice-devel

___
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/spice-devel


[Spice-devel] UsbDk 1.0.17 released

2017-02-26 Thread Dmitry Fleytman
Hi All,

The new version of UsbDk (1.0.17) was released.

Changes in this version:

1. Improved support for self-resetting USB devices
2. Fixed a number of hider API issues
3. Removed console printouts from API DLL

The latest UsbDk source code available at:
http://cgit.freedesktop.org/spice/win32/usbdk

Latest source tarball is at: 
http://www.spice-space.org/download/windows/usbdk/spice-usbdk-win-1.0-17-sources.zip

Precompiled and signed by Red Hat binaries are available at:
1. 32 bit: 
http://www.spice-space.org/download/windows/usbdk/UsbDk_1.0.17_x86.msi
2. 64 bit: 
http://www.spice-space.org/download/windows/usbdk/UsbDk_1.0.17_x64.msi

UsbDk documentation:
1. Short presentation: 
http://www.spice-space.org/docs/usbdk/UsbDk_at_a_Glance.pdf
2. SDM: 
http://www.spice-space.org/docs/usbdk/UsbDk_Software_Development_Manual.pdf
3. UsbDk architecture specification (part of source tree):
  http://cgit.freedesktop.org/spice/win32/usbdk/tree/ARCHITECTURE

Best regards,
Dmitry

___
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/spice-devel


[Spice-devel] QXL-WDDM-DOD 0.13 released

2016-11-08 Thread Dmitry Fleytman
Hi All,

QXL-WDDM-DOD 0.13 has been released.

Changes in this version:

1. Driver license switched to Apache v2
2. Versioning scheme improved and version number embedded into driver binaries

The latest QXL-WDDM-DOD source code available at:
https://gitlab.com/spice/qxl-wddm-dod

Source tarball for this version:
https://www.spice-space.org/download/windows/qxl-wddm-dod/qxl-wddm-dod-0.13/qxlwddm-0.13-0-sources.zip

Precompiled and signed by Red Hat binaries:
https://www.spice-space.org/download/windows/qxl-wddm-dod/qxl-wddm-dod-0.13/qxlwddm-0.13.zip

Best regards,
Dmitry

___
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/spice-devel


Re: [Spice-devel] [PATCH qxl-wddm-dod v2 1/1] Configurable version information in binary and INF

2016-11-03 Thread Dmitry Fleytman
Acked-by: Dmitry Fleytman <dmi...@daynix.com>

> On 2 Nov 2016, at 02:26 AM, yuri.benditov...@daynix.com wrote:
> 
> From: Yuri Benditovich <yuri.benditov...@daynix.com>
> 
> Version information in INF file is configured by
> environment variables.
> The same version information placed in driver binary.
> To set required version from external build engine,
> define following environment variables:
> VERSION_V1, VERSION_V2, VERSION_V3, VERSION_V4
> 
> Signed-off-by: Yuri Benditovich <yuri.benditov...@daynix.com>
> ---
> qxldod/Version.props  | 33 +
> qxldod/qxldod.rc  | 23 +--
> qxldod/qxldod.vcxproj |  1 +
> 3 files changed, 55 insertions(+), 2 deletions(-)
> create mode 100644 qxldod/Version.props
> 
> diff --git a/qxldod/Version.props b/qxldod/Version.props
> new file mode 100644
> index 000..bdf02a9
> --- /dev/null
> +++ b/qxldod/Version.props
> @@ -0,0 +1,33 @@
> +
> +
> +http://schemas.microsoft.com/developer/msbuild/2003; 
> TreatAsLocalProperty="Platform">
> +  
> +
> +100
> +
> +6
> +
> +0
> +
> +13
> +
> $(VERSION_V1).$(VERSION_V2).$(VERSION_V3).$(VERSION_V4)
> +  
> +
> +  
> +  
> +
> +  
> VERSION_V3=$(VERSION_V3);VERSION_V4=$(VERSION_V4);VERSION_V1=$(VERSION_V1);VERSION_V2=$(VERSION_V2);%(PreprocessorDefinitions)
> +
> +
> +  
> VERSION_V3=$(VERSION_V3);VERSION_V4=$(VERSION_V4);VERSION_V1=$(VERSION_V1);VERSION_V2=$(VERSION_V2);%(PreprocessorDefinitions)
> +
> +
> +  $(STAMPINF_VERSION)
> +
> +  
> +
> diff --git a/qxldod/qxldod.rc b/qxldod/qxldod.rc
> index 7d7c326..de45b37 100755
> --- a/qxldod/qxldod.rc
> +++ b/qxldod/qxldod.rc
> @@ -2,11 +2,30 @@
> 
> #include 
> 
> +#undef VER_PRODUCTBUILD
> +#undef VER_PRODUCTBUILD_QFE
> +#undef VER_PRODUCTNAME_STR
> +#undef VER_PRODUCTMAJORVERSION
> +#undef VER_PRODUCTMINORVERSION
> +#undef VER_COMPANYNAME_STR
> +#undef VER_LEGALTRADEMARKS_STR
> +#undef VER_LEGALCOPYRIGHT_STR
> +
> +#define VER_COMPANYNAME_STR "Red Hat Inc."
> +#define VER_LEGALTRADEMARKS_STR ""
> +#define VER_LEGALCOPYRIGHT_STR  "Copyright (C) 2008-2016 Red Hat Inc."
> +
> +#define VER_PRODUCTMAJORVERSION VERSION_V1
> +#define VER_PRODUCTMINORVERSION VERSION_V2
> +#define VER_PRODUCTBUILDVERSION_V3
> +#define VER_PRODUCTBUILD_QFEVERSION_V4
> +
> #define VER_FILETYPEVFT_DRV
> #define VER_FILESUBTYPE VFT2_DRV_DISPLAY
> -#define VER_FILEDESCRIPTION_STR "QQL WDDM DOD"
> -#define VER_INTERNALNAME_STR"qxlod.sys"
> +#define VER_FILEDESCRIPTION_STR "QXL WDDM DOD"
> +#define VER_INTERNALNAME_STR"qxldod.sys"
> #define VER_ORIGINALFILENAME_STR"qxldod.sys"
> +#define VER_PRODUCTNAME_STR VER_FILEDESCRIPTION_STR
> 
> #define VER_LANGNEUTRAL
> #include "common.ver"
> diff --git a/qxldod/qxldod.vcxproj b/qxldod/qxldod.vcxproj
> index 2c10158..1766a61 100755
> --- a/qxldod/qxldod.vcxproj
> +++ b/qxldod/qxldod.vcxproj
> @@ -44,6 +44,7 @@
> WDM
>   
>   
> +  
>Condition="'$(Configuration)|$(Platform)'=='Win10Debug|Win32'" 
> Label="Configuration">
> 
> 
> -- 
> 2.7.0.windows.1
> 

___
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/spice-devel


Re: [Spice-devel] QXL-WDDM-DOD v0.4-1 released

2016-10-27 Thread Dmitry Fleytman
Hi Christophe,

> On 26 Oct 2016, at 19:17 PM, Christophe Fergeau  wrote:
> 
> Hey Sameeh,
> 
> On Wed, Oct 26, 2016 at 06:37:12PM +0300, Sameeh Jubran wrote:
>> And as Frediano mentioned this could be an issue with the mouse as there
>> was set of patches that weren't accepted which solves a performance
>> issue caused by the mouse mode when running vd-agent.
> 
> I did not check which patches exactly you have in mind, but I'd expect
> there were review comments/questions on these patches to be addressed
> before moving forward with them? If they are causing such bad
> performance issues, we should revisit them ;)

Sameeh meant patches that disable forwarding of
mouse events to device when VDAgent is running.

Patches were written in assumption that running
VDAgent always means system is in client mouse mode.
And, as turned out, this assumption was wrong so
patches need rework.

This task is in our list and we’re investigating what can be done.

According to earlier discussions on the list the best way is to indicate
mouse mode to driver via device interface.


Dmitry.

> 
> Christophe

___
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/spice-devel


Re: [Spice-devel] [PATCH qxl-wddm-dod] Indicate all Qxl devices as VGA

2016-10-26 Thread Dmitry Fleytman

> On 26 Oct 2016, at 12:30 PM, Christophe Fergeau  wrote:
> 
> Hey,
> 
> On Wed, Oct 19, 2016 at 07:01:45PM +0300, Sameeh Jubran wrote:
>> Currently the qxl device with id 0 is being set as an internal display
>> while all the rest are set as VGA connector. This commit solves this
>> issue that was discussed in detail here:
>> https://bugzilla.redhat.com/show_bug.cgi?id=1314600
> 
> For what it's worth, a description of the issue this was causing (at
> least a short summary) would be nice to have in the commit log in
> addition to the bugzilla link (someone might be looking at that code in
> a plane, the link might go away for some reason, …)

Hi Christophe,

Sure! Next time we will pay attention to this.
Thanks for pointing out.

Dmitry

> 
> Christophe

___
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/spice-devel


[Spice-devel] QXL-WDDM-DOD v0.4-1 released

2016-10-25 Thread Dmitry Fleytman
Hi All,

We are glad to notify you that the first official version of QXL-WDDM-DOD
driver with Windows 10 support has been released.

This version was built from tag v0.4-1 @ https://gitlab.com/spice/qxl-wddm-dod/ 


Precompiled and signed by Red Hat binaries are available at:
https://www.spice-space.org/download/windows/qxl-wddm-dod/qxl-wddm-dod-0.4-1/qxlwddm-0.4-1.zip
 


Source tarball is available at:
https://www.spice-space.org/download/windows/qxl-wddm-dod/qxl-wddm-dod-0.4-1/qxlwddm-0.4-1-sources.zip
 


Best regards,
Dmitry___
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/spice-devel


Re: [Spice-devel] [PATCH qxl-wddm-dod v5 1/7] Use MmMapIoSpaceEx instead of MmMapIoSpace

2016-09-27 Thread Dmitry Fleytman

> On 27 Sep 2016, at 13:00 PM, Christophe Fergeau <cferg...@redhat.com> wrote:
> 
> Hey,
> 
> On Tue, Sep 27, 2016 at 12:57:33PM +0300, Dmitry Fleytman wrote:
>> 
>>> On 27 Sep 2016, at 12:51 PM, Christophe Fergeau <cferg...@redhat.com> wrote:
>>> 
>>> On Mon, Sep 26, 2016 at 04:00:05PM +0300, Sameeh Jubran wrote:
>>>> Disable execution bit on mapping improving security.
>>>> 
>>>> MmMapIoSpaceEx is available only in Windows 10 thus
>>>> the macros are used.
>>> 
>>> Hey, looks good to me. Just one question, by default if this is built on
>>> a Windows 10 system, I guess MmMapIoSpaceEx is going to be used. However
>>> we can override NTDDI_VERSION to WIN8 if we want to build a driver which
>>> is going to work on both win8 and win10? Or is this working differently?
>> 
>> Hi Christophe,
>> 
>> Driver is built using WDK toolset for a specific OS.
>> There are WDK toolsets for windows 10, Windows 8.1, Windows 8 etc. 
>> NTDDI_VERSION defined by the toolset in accordance to target OS.
>> 
>> Currently we build with Windows 10 toolset only, but in future we may
>> decide to build with Windows 8 or 8.1 toolset as well.
> 
> Ah ok, so no "universal" driver, we'll need to have distinct 8, 8.1 and
> 10 drivers if we wan tto support all 3 versions?

There is backward compatibility, so one may use windows 8 driver for all 
systems,
but it is preferable to use separate “natively compiled” binaries.

> 
> Christophe

___
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/spice-devel


Re: [Spice-devel] [PATCH qxl-wddm-dod v5 2/7] Code Analysis fix

2016-09-27 Thread Dmitry Fleytman

> On 27 Sep 2016, at 12:35 PM, Christophe Fergeau  wrote:
> 
> Hey,
> 
> A huge part of this patch is adding +__declspec(code_seg("PAGE"))  (and
> removing #pragma code_seg()), which are probably related to this macro,
> but which are added with no rationale.
> The shortlog should probably be something different than "code analysis
> fix", but more somethnig like "Use PAGED_CODE() at the beginning of each
> pageable method".
> Is it possible/desirable to prevent these methods from ending in
> pageable memory?

Hi Christophe,

#pragma code_seg() and __declspec(codes()) are interchangeable,
in this specific case __declspec is more convenient.

PAGED_CODE() is a run-time assertion to make sure that these functions are not 
used in high IRQL.

I think you’re right and commit message should be improved.

Ans answering your last question, it is desirable to have these functions in 
paged area to save non-pageable memory.

~Dmitry

> 
> Christophe
> 
> On Mon, Sep 26, 2016 at 04:00:06PM +0300, Sameeh Jubran wrote:
>> The PAGED_CODE macro ensures that the calling thread is running at an
>> IRQL that is low enough to permit paging. A call to this macro should
>> be made at the beginning of every driver routine that either contains
>> pageable code or accesses pageable code.
>> 
>> Based on a patch by Sandy Stutsman 
>> 
>> Signed-off-by: Sameeh Jubran 
>> ---
>> qxldod/QxlDod.cpp | 224 
>> --
>> qxldod/QxlDod.h   | 149 ++--
>> 2 files changed, 344 insertions(+), 29 deletions(-)
>> 
>> diff --git a/qxldod/QxlDod.cpp b/qxldod/QxlDod.cpp
>> index 798b2f0..136daf7 100755
>> --- a/qxldod/QxlDod.cpp
>> +++ b/qxldod/QxlDod.cpp
>> @@ -2,8 +2,6 @@
>> #include "qxldod.h"
>> #include "qxl_windows.h"
>> 
>> -#pragma code_seg(push)
>> -#pragma code_seg()
>> 
>> #define WIN_QXL_INT_MASK ((QXL_INTERRUPT_DISPLAY) | \
>>   (QXL_INTERRUPT_CURSOR) | \
>> @@ -47,7 +45,6 @@ BYTE PixelMask[BITS_PER_BYTE]  = {0x80, 0x40, 0x20, 0x10, 
>> 0x08, 0x04, 0x02, 0x01
>>((ULONG)LOWER_5_BITS((Pixel)) << 
>> SHIFT_LOWER_5_IN_565_BACK))
>> 
>> 
>> -#pragma code_seg(pop)
>> 
>> struct QXLEscape {
>> uint32_t ioctl;
>> @@ -57,10 +54,12 @@ struct QXLEscape {
>> };
>> };
>> 
>> +__declspec(code_seg("PAGE"))
>> QxlDod::QxlDod(_In_ DEVICE_OBJECT* pPhysicalDeviceObject) : 
>> m_pPhysicalDevice(pPhysicalDeviceObject),
>> 
>> m_MonitorPowerState(PowerDeviceD0),
>> 
>> m_AdapterPowerState(PowerDeviceD0)
>> {
>> +PAGED_CODE();
>> DbgPrint(TRACE_LEVEL_INFORMATION, ("---> %s\n", __FUNCTION__));
>> *((UINT*)_Flags) = 0;
>> RtlZeroMemory(_DxgkInterface, sizeof(m_DxgkInterface));
>> @@ -71,7 +70,7 @@ QxlDod::QxlDod(_In_ DEVICE_OBJECT* pPhysicalDeviceObject) 
>> : m_pPhysicalDevice(pP
>> DbgPrint(TRACE_LEVEL_INFORMATION, ("<--- %s\n", __FUNCTION__));
>> }
>> 
>> -
>> +__declspec(code_seg("PAGE"))
>> QxlDod::~QxlDod(void)
>> {
>> PAGED_CODE();
>> @@ -80,6 +79,7 @@ QxlDod::~QxlDod(void)
>> m_pHWDevice = NULL;
>> }
>> 
>> +__declspec(code_seg("PAGE"))
>> NTSTATUS QxlDod::CheckHardware()
>> {
>> PAGED_CODE();
>> @@ -117,6 +117,7 @@ NTSTATUS QxlDod::CheckHardware()
>> return Status;
>> }
>> 
>> +__declspec(code_seg("PAGE"))
>> NTSTATUS QxlDod::StartDevice(_In_  DXGK_START_INFO*   pDxgkStartInfo,
>>  _In_  DXGKRNL_INTERFACE* pDxgkInterface,
>>  _Out_ ULONG* pNumberOfViews,
>> @@ -207,6 +208,7 @@ NTSTATUS QxlDod::StartDevice(_In_  DXGK_START_INFO*   
>> pDxgkStartInfo,
>> return STATUS_SUCCESS;
>> }
>> 
>> +__declspec(code_seg("PAGE"))
>> NTSTATUS QxlDod::StopDevice(VOID)
>> {
>> PAGED_CODE();
>> @@ -214,6 +216,7 @@ NTSTATUS QxlDod::StopDevice(VOID)
>> return STATUS_SUCCESS;
>> }
>> 
>> +__declspec(code_seg("PAGE"))
>> VOID QxlDod::CleanUp(VOID)
>> {
>> PAGED_CODE();
>> @@ -228,7 +231,7 @@ VOID QxlDod::CleanUp(VOID)
>> }
>> }
>> 
>> -
>> +__declspec(code_seg("PAGE"))
>> NTSTATUS QxlDod::DispatchIoRequest(_In_  ULONG VidPnSourceId,
>>_In_  VIDEO_REQUEST_PACKET* 
>> pVideoRequestPacket)
>> {
>> @@ -240,11 +243,13 @@ NTSTATUS QxlDod::DispatchIoRequest(_In_  ULONG 
>> VidPnSourceId,
>> return STATUS_SUCCESS;
>> }
>> 
>> +__declspec(code_seg("PAGE"))
>> PCHAR
>> DbgDevicePowerString(
>> __in DEVICE_POWER_STATE Type
>> )
>> {
>> +PAGED_CODE();
>> switch (Type)
>> {
>> case PowerDeviceUnspecified:
>> @@ -264,11 +269,13 @@ DbgDevicePowerString(
>> }
>> }
>> 
>> +__declspec(code_seg("PAGE"))
>> PCHAR
>> DbgPowerActionString(
>> __in POWER_ACTION Type
>> )
>> {
>> +PAGED_CODE();
>> switch (Type)
>> {
>> case PowerActionNone:
>> @@ -292,6 +299,7 

Re: [Spice-devel] [PATCH qxl-wddm-dod v5 1/7] Use MmMapIoSpaceEx instead of MmMapIoSpace

2016-09-27 Thread Dmitry Fleytman

> On 27 Sep 2016, at 12:51 PM, Christophe Fergeau  wrote:
> 
> On Mon, Sep 26, 2016 at 04:00:05PM +0300, Sameeh Jubran wrote:
>> Disable execution bit on mapping improving security.
>> 
>> MmMapIoSpaceEx is available only in Windows 10 thus
>> the macros are used.
> 
> Hey, looks good to me. Just one question, by default if this is built on
> a Windows 10 system, I guess MmMapIoSpaceEx is going to be used. However
> we can override NTDDI_VERSION to WIN8 if we want to build a driver which
> is going to work on both win8 and win10? Or is this working differently?

Hi Christophe,

Driver is built using WDK toolset for a specific OS.
There are WDK toolsets for windows 10, Windows 8.1, Windows 8 etc. 
NTDDI_VERSION defined by the toolset in accordance to target OS.

Currently we build with Windows 10 toolset only, but in future we may decide to 
build with Windows 8 or 8.1 toolset as well.

~Dmitry

> 
> Christophe
> 
>> 
>> Based on a patch by Sandy Stutsman 
>> 
>> Signed-off-by: Sameeh Jubran 
>> ---
>> qxldod/QxlDod.cpp | 13 -
>> 1 file changed, 12 insertions(+), 1 deletion(-)
>> 
>> diff --git a/qxldod/QxlDod.cpp b/qxldod/QxlDod.cpp
>> index accf895..798b2f0 100755
>> --- a/qxldod/QxlDod.cpp
>> +++ b/qxldod/QxlDod.cpp
>> @@ -2009,17 +2009,28 @@ MapFrameBuffer(
>> return STATUS_INVALID_PARAMETER;
>> }
>> 
>> +#if NTDDI_VERSION >= NTDDI_WIN10
>> +*VirtualAddress = MmMapIoSpaceEx(PhysicalAddress,
>> +Length,
>> +PAGE_WRITECOMBINE | PAGE_READWRITE);
>> +#else
>> *VirtualAddress = MmMapIoSpace(PhysicalAddress,
>>Length,
>>MmWriteCombined);
>> +#endif
>> if (*VirtualAddress == NULL)
>> {
>> // The underlying call to MmMapIoSpace failed. This may be because, 
>> MmWriteCombined
>> // isn't supported, so try again with MmNonCached
>> -
>> +#if NTDDI_VERSION >= NTDDI_WIN10
>> +*VirtualAddress = MmMapIoSpaceEx(PhysicalAddress,
>> +Length,
>> +(PAGE_NOCACHE | PAGE_READWRITE));
>> +#else
>> *VirtualAddress = MmMapIoSpace(PhysicalAddress,
>>Length,
>>MmNonCached);
>> +#endif
>> if (*VirtualAddress == NULL)
>> {
>> DbgPrint(TRACE_LEVEL_ERROR, ("MmMapIoSpace returned a NULL 
>> buffer when trying to allocate %lu bytes", Length));
>> -- 
>> 2.7.4
>> 
>> ___
>> Spice-devel mailing list
>> Spice-devel@lists.freedesktop.org 
>> https://lists.freedesktop.org/mailman/listinfo/spice-devel 
>> 
___
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/spice-devel


Re: [Spice-devel] [PATCH qxl-wddm-dod v4 03/10] Use MmMapIoSpaceEx instead of MmMapIoSpace

2016-09-20 Thread Dmitry Fleytman

> On 20 Sep 2016, at 15:46 PM, Frediano Ziglio  wrote:
> 
> 
>> On Tue, Sep 20, 2016 at 01:14:10PM +0300, Sameeh Jubran wrote:
>>> On Mon, Sep 12, 2016 at 11:32 AM, Frediano Ziglio 
>>> wrote:
 It looks like MmMapIoSpaceEx was introduced with Windows 10 while WDDM
 was
 introduce in Windows 7. Are we going to support only from Windows 10?
 Windows 7 supports WDDM but supports also XPDM so it's supported but
 users of Windows 8 won't have a QXL driver. Are we never going to support
 Windows 8?
 
>>> 
 
 I think the reason for this change is that the new function can specify
 additional security, specifically removing the executable bit from page
 mappings. Am I right? Perhaps this should be mentioned in the rationale.
>>> 
>>> I think we can drop this patch if we plan to support Windows 8
>> 
>> It would be easier to make that decision if there was a rationale for
>> the change in the commit log, or if you could answer Frediano's question
>> as to _why_ this commit is changing from one to the other function.
>> 
>> Christophe
>> 
> 
> Looks like WDDM is supported by Windows 8 but not WDDM DOD and we are not
> planning to support full WDDM so would make sense to move to MmMapIoSpaceEx
> is this is increasing security as no execution bit is set on these pages.
> It's not hard to switch it back.

Hi Frediano, 

According to [1] WDDM DOD is supported by Windows 8 and It makes
sense to do at least minimal effort to make this driver work on pre-Win10 
systems.

We don’t know what was Sandy’s motivation to migrate to this new function, but
it is preferable indeed w.r.t security concerns and we would like to continue 
using
it on Windows 10.

We will amend this patch with conditional compilation to make sure
that the best function available is used on on each OS version.

[1] 
https://msdn.microsoft.com/en-us/library/windows/hardware/dn653369(v=vs.85).aspx
 

Dmitry

> 
> I would change the commit message as
> 
> -
> Use MmMapIoSpaceEx instead of MmMapIoSpace
> 
> Disable execution bit on mapping improving security.
> 
> Based on a patch by Sandy Stutsman 
> 
> Signed-off-by: Sameeh Jubran 
> -
> 
> and I would remove the ULONG cast.
> If you agree I can push with these changes.
> 
> Frediano

___
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/spice-devel


Re: [Spice-devel] [PATCH v3 00/28] Win10 support patches

2016-09-08 Thread Dmitry Fleytman

> On 8 Sep 2016, at 12:30 PM, Christophe Fergeau <cferg...@redhat.com> wrote:
> 
> On Thu, Sep 08, 2016 at 09:01:58AM +0300, Dmitry Fleytman wrote:
>> 
>>> On 7 Sep 2016, at 18:49 PM, Christophe Fergeau <cferg...@redhat.com> wrote:
>>> 
>>> On Wed, Sep 07, 2016 at 06:40:57PM +0300, Dmitry Fleytman wrote:
>>>> 
>>>>> On 7 Sep 2016, at 18:20 PM, Christophe Fergeau <cferg...@redhat.com> 
>>>>> wrote:
>>>>> 
>>>>> On Wed, Sep 07, 2016 at 05:55:31PM +0300, Sameeh Jubran wrote:
>>>>>> On Wed, Sep 7, 2016 at 5:47 PM, Christophe Fergeau <cferg...@redhat.com>
>>>>>> wrote:
>>>>>> 
>>>>>>> On Wed, Sep 07, 2016 at 04:10:18PM +0300, Sameeh Jubran wrote:
>>>>>>>> Dmitry Fleytman (2):
>>>>>>>> Introduce end-of-line normalization
>>>>> 
>>>>> So it seems everything was changed from Dos to Unix? What is the
>>>>> rationale for going this way rather than the other way around?
>>>>> I think I would convert all source files to Dos except for the include/
>>>>> ones which are c'ed from elsewhere. This would make the diff much
>>>>> smaller, and give us a much less polluted git history.
>>>> 
>>>> Hi Christophe,
>>>> 
>>>> We prefer to have the same EOL style for all files in the repository 
>>>> because
>>>> this way it is much easier to define automatic EOL conversion rules for 
>>>> future commits.
>>> 
>>> I don't know how you intend to define these automatic EOL conversion
>>> rules, but if this is through git hook + script, having a few exceptions
>>> is probably not that much complicated than single EOL for the whole
>>> repository (but I agree it's less nice).
>> 
>> They are defined already. .gitattributes file introduced by commit
>> that converts line endings is doing the job.
>> 
>> EOL handling rules may be defined by .gitattributes on a more fine-grained 
>> basis,
>> but this will introduce more code to be supported without clear advantages.
> 
> Yup, .gitattributes is fairly flexible.
> 
>> 
>>> 
>>> 
>>>> LF has a number of advantages over CR/LF so we decided to use it.
>>> 
>>> Which are ?
>> 
>> LF are native for UNIX systems and tools. CR character often appears as 
>> visible
>> control character in text editors on Linux, for example vi.
> 
> I really see that codebase as a Windows thing as I don't think it even
> compiles with mingw, so I don't feel using the native *Unix* line
> endings is a very compelling argument here. Especially as my vim was
> able to cope with line endings just fine (it does not show control
> chars, it uses the proper ending when I add a new line).

It probably depends on specific vi distribution or configuration as mine 
behaves differently.

> 
>> 
>> Some originally-UNIX tools tend to convert line endings to LF event when 
>> compiled for Windows.
>> For example "git send-email” that we run on Windows does this. Because of 
>> that conversion patches
>> send to the mailing list did not apply as was reported by Frediano. 
> 
> Which would be solved by a .gitattributes file regardless of which
> line-ending we decide to use.
> 
>>> 
>>>> We believe that one big commit that converts EOL characters is an
>>>> acceptable price for future simplicity.
>>> 
>>> Since this is going to get in the way of git log, git blame, ...
>>> forever, I'd try to minimize the amount of change there is..
>> 
>> Yes, this will require an additional step for "git blame” users,
>> but only for those who need to drill down to the very beginnings.
>> EOL fixes will appear on "git log" as well, not sure if this is an issue.
>> 
>> Mixing EOL styles in this repository was a mistake made from the very
>> beginning and it needs to be fixed, better sooner than later.
> 
> Mixing EOL within single files is not nice indeed. Personally I think
> I'd just fix these files with mixed line endings, this makes the changes
> far less invasive.

No problem, we will do it this way.

> 
> Christophe

___
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/spice-devel


Re: [Spice-devel] [PATCH v3 00/28] Win10 support patches

2016-09-08 Thread Dmitry Fleytman

> On 7 Sep 2016, at 18:49 PM, Christophe Fergeau <cferg...@redhat.com> wrote:
> 
> On Wed, Sep 07, 2016 at 06:40:57PM +0300, Dmitry Fleytman wrote:
>> 
>>> On 7 Sep 2016, at 18:20 PM, Christophe Fergeau <cferg...@redhat.com> wrote:
>>> 
>>> On Wed, Sep 07, 2016 at 05:55:31PM +0300, Sameeh Jubran wrote:
>>>> On Wed, Sep 7, 2016 at 5:47 PM, Christophe Fergeau <cferg...@redhat.com>
>>>> wrote:
>>>> 
>>>>> On Wed, Sep 07, 2016 at 04:10:18PM +0300, Sameeh Jubran wrote:
>>>>>> Dmitry Fleytman (2):
>>>>>> Introduce end-of-line normalization
>>> 
>>> So it seems everything was changed from Dos to Unix? What is the
>>> rationale for going this way rather than the other way around?
>>> I think I would convert all source files to Dos except for the include/
>>> ones which are c'ed from elsewhere. This would make the diff much
>>> smaller, and give us a much less polluted git history.
>> 
>> Hi Christophe,
>> 
>> We prefer to have the same EOL style for all files in the repository because
>> this way it is much easier to define automatic EOL conversion rules for 
>> future commits.
> 
> I don't know how you intend to define these automatic EOL conversion
> rules, but if this is through git hook + script, having a few exceptions
> is probably not that much complicated than single EOL for the whole
> repository (but I agree it's less nice).

They are defined already. .gitattributes file introduced by commit
that converts line endings is doing the job.

EOL handling rules may be defined by .gitattributes on a more fine-grained 
basis,
but this will introduce more code to be supported without clear advantages.

> 
> 
>> LF has a number of advantages over CR/LF so we decided to use it.
> 
> Which are ?

LF are native for UNIX systems and tools. CR character often appears as visible
control character in text editors on Linux, for example vi.

Some originally-UNIX tools tend to convert line endings to LF event when 
compiled for Windows.
For example "git send-email” that we run on Windows does this. Because of that 
conversion patches
send to the mailing list did not apply as was reported by Frediano. 


> 
> 
>> We believe that one big commit that converts EOL characters is an
>> acceptable price for future simplicity.
> 
> Since this is going to get in the way of git log, git blame, ...
> forever, I'd try to minimize the amount of change there is..

Yes, this will require an additional step for "git blame” users,
but only for those who need to drill down to the very beginnings.
EOL fixes will appear on "git log" as well, not sure if this is an issue.

Mixing EOL styles in this repository was a mistake made from the very
beginning and it needs to be fixed, better sooner than later.

> 
> Christophe

___
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/spice-devel


Re: [Spice-devel] [PATCH v3 00/28] Win10 support patches

2016-09-07 Thread Dmitry Fleytman

> On 7 Sep 2016, at 18:20 PM, Christophe Fergeau <cferg...@redhat.com> wrote:
> 
> On Wed, Sep 07, 2016 at 05:55:31PM +0300, Sameeh Jubran wrote:
>> On Wed, Sep 7, 2016 at 5:47 PM, Christophe Fergeau <cferg...@redhat.com>
>> wrote:
>> 
>>> On Wed, Sep 07, 2016 at 04:10:18PM +0300, Sameeh Jubran wrote:
>>>> Dmitry Fleytman (2):
>>>>  Introduce end-of-line normalization
> 
> So it seems everything was changed from Dos to Unix? What is the
> rationale for going this way rather than the other way around?
> I think I would convert all source files to Dos except for the include/
> ones which are c'ed from elsewhere. This would make the diff much
> smaller, and give us a much less polluted git history.

Hi Christophe,

We prefer to have the same EOL style for all files in the repository because
this way it is much easier to define automatic EOL conversion rules for future 
commits.
LF has a number of advantages over CR/LF so we decided to use it.

We believe that one big commit that converts EOL characters is an acceptable 
price for future simplicity.

Dmitry

> 
> Christophe

___
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/spice-devel


Re: [Spice-devel] [PATCH qxl-wddm-dod v2 12/25] Rename mspace.c to mspace.cpp

2016-09-06 Thread Dmitry Fleytman

> On 6 Sep 2016, at 15:45 PM, Frediano Ziglio <fzig...@redhat.com> wrote:
> 
> 
> 
> From: "Frediano Ziglio" <fzig...@redhat.com>
> To: "Dmitry Fleytman" <dmi...@daynix.com>
> Cc: "Spice List" <spice-devel@lists.freedesktop.org>
> Sent: Tuesday, September 6, 2016 1:30:44 PM
> Subject: Re: [Spice-devel] [PATCH qxl-wddm-dod v2 12/25] Rename mspace.c to   
>  mspace.cpp
> 
> On 6 Sep 2016, at 15:07 PM, Frediano Ziglio <fzig...@redhat.com 
> <mailto:fzig...@redhat.com>> wrote:
> 
> On Mon, Sep 5, 2016 at 9:26 PM, Frediano Ziglio <fzig...@redhat.com 
> <mailto:fzig...@redhat.com>> wrote:
> Why the rationale was removed?
> 
> By mistake, i'll add it back in the next version. 
> By the way this was a workaround for a VS bug, get Visual Studio 2015 Update 
> 1 (actually we are at update 3)
> True, however microsoft recommends using visual c++ compiler profile as it is 
> different from the c compiler profile.
> 
> Yes, especially if you don't know what you are doing and you don't have a 
> acceptable test suite.
> I hope that they all don't apply to us.
> 
> 
> Hi Frediano,
> 
> Actually using Microsoft C++ compiler for C files is recommended because it 
> performs
> more excessive static checks and produces warnings regarding more potential 
> problematic cases.
> And this is definitely a good thing.
> 
> ~Dmitry
> Yes... C++ does more strictly checks. This does not means that all C 
> programmers are moving to a C++ compiler!
> The mspace.c file is shared between different projects where some require it 
> to be C.
> Rename to .cpp can cause maintainability issue as it's easier to introduce 
> C++ construct that would lead to a fork.
> As the initial rationale (a workaround for a VS bug) didn't apply anymore I 
> would avoid the rename.

Sure. No problem.


> 
> Frediano

___
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/spice-devel


Re: [Spice-devel] [libusb] UsbDk 1.0.15 released

2016-09-06 Thread Dmitry Fleytman

> On 5 Sep 2016, at 19:29 PM, Robert Heller <hel...@deepsoft.com> wrote:
> 
> At Mon, 05 Sep 2016 18:13:04 +0300 
> =?utf-8?B?0JvQsNGA0LjQvtC90L7QsiDQlNCw0L3QuNC40Ls=?= <scumco...@yandex.ru 
> <mailto:scumco...@yandex.ru>> wrote:
> 
>> 
>>> Hmm. 7.5Meg is not a "Short presentation" (not for download over a dialup
>>> connection). Is there something smaller out there? Maybe a plain text 
>>> README?
>> 
>> The PDF is just text with no pictures or (sophisticated) diagrams. Here is
>> the copypaste (the number represents the PDF page):
> 
> Why is it 7.5Meg?  I have a complete short novel (which *does* includes some 
> pictures) whose PDF is only about 350K.

I’m sure this can be optimised. We just never thought this might be a problem...

> 
>> 
>> 
>> 1) UsbDk at a Glance
>> 
>> 2) Meet UsbDk
>> - UsbDk stands for "USB Development Kit"
>> - Universal engine for exclusive access to USB devices on Windows OSes
>> - Full user mode API for all device operations
>> - Designed to support all types of USB devices
>> - Generic API to allow wide range of use-cases
>> - Designed with HCK certifications in mind
>> - Hiding engine for total detachment of USB devices
>> - from OS software stack
>> 
>> 3) Feature set
>> - Totally dynamic device capture
>>  - No INF files and no self-signing needed
>>  - Any device can be captured
>> - Totally dynamic device detachment
>>  - Any device or class of devices may be hidden
>>  - Prevents Windows from showing "New Hardware" pop-ups for devices without 
>> in-box drivers
>>  - Great for security solutions
>> - Co-existence with original device driver
>>  - When the device is not captured original driver is loaded by the system 
>> automatically
>>  - If user mode client terminates unexpectedly for any reason system reverts 
>> to original device driver immediately
>> - Supports for all types of devices and interfaces
>>  - Bulk, isochronous, composite, HID, etc.
>> - Being USB filter driver doesn't require WHQL-ing
>>  - as per Microsoft requirements
>> 
> 
> This sounds like Linux's udev…

Yes, it is pretty much similar.

> 
>> 4) Advantages over WinUSB
>> - Full feature parity
>> - Full support for isochronous devices
>> - Full support for composite devices
>> - No INF files and no signing needed
>> - Open source and community supported
>> 
> 
> Will it work with Libusb user-mode "driver" libraries?


Yes, upstream libusb may be compiled for Windows with UsbDk backend support 
instead WinUSB.
See —enable-usbdk switch of libusb configure script.

> 
>> 5) Supported Windows Versions
>> - 7
>> - 8 
>> - 8.1
>> - 2008 R2
>> - 2012
>> - 2012 R2
>> - XP
>> - 2003
>> - Vista
>> - 2008
>> 
>> 6) UsbDk is open source
>> - Hosted by: http://www.spice-space.org
>> - Mailing list: spice-devel 
>> (http://lists.freedesktop.org/mailman/listinfo/spice-devel)
>> - Maintained by: Dmitry Fleytman <dfley...@redhat.com>, Dmitry Fleytman 
>> <dmi...@daynix.com>
>> - License: Apache 2.0
>> - Git repository: http://cgit.freedesktop.org/spice/win32/usbdk/
>> 
>> 7) Build environment
>> - Visual Studio 2013 Update 4
>> - Windows Driver Kit (WDK) 8.1 for Windows 7/2008R2 and later platforms
>> - Windows 7 DDK (WDK 7.1) for Windows XP, 2003, Vista, 2008
>> - WiX toolset 3.8 for MSI packages creation
>> 
>> 8) UsbDk components
>> User mode:
>> - UsbDkController.exe
>> - UsbDkHelper.dll
>> Kernel mode:
>> - UsbDk.sys
>> 
>> 9) UsbDkHelper.dll API
>> Install:
>> - Driver installation
>> - Driver un-installation
>> Acquire:
>> - Enumerate USB devices
>> - Capture USB device
>> - Hide USB device
>> Operate:
>> - Pipe transfer
>> - Control transfer
>> - Configure device
>> - Reset device
>> 
>> 10) UsbDk.sys structure
>> UsbDkHelper.dll
>> |
>> Control interface
>> Generic USB device driver
>> USB hub filter
>> USB device filter
>> |
>> PNP Manager
>> 
>> 11) Technical Info
>> - See ARCHITECTURE document at source tree root 
>> http://cgit.freedesktop.org/spice/win32/usbdk/tree/ARCHITECTURE
>> - Software Development Manual available on www.spice-space.org
>> 
>> 12) Thank you!
>> 
>> 
>> 
> 
> -- 
> Robert Heller -- 978-544-6933
> Deepwoods Software-- Custom Software Services
> http://www.deepsoft.com/ <http://www.deepsoft.com/>  -- Linux Administration 
> Services
> hel...@deepsoft.com <mailto:hel...@deepsoft.com>   -- Webhosting Services

___
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/spice-devel


[Spice-devel] UsbDk 1.0.15 released

2016-09-05 Thread Dmitry Fleytman
Hi All,

The new version of UsbDk (1.0.15) was released.

This version contains fixes and improvements for
USB unplug events processing.

The latest UsbDk source code available at:
http://cgit.freedesktop.org/spice/win32/usbdk

Latest source tarball is at: 
http://www.spice-space.org/download/windows/usbdk/spice-usbdk-win-1.0-15-sources.zip

Precompiled and signed by Red Hat binaries are available at:
1. 32 bit: 
http://www.spice-space.org/download/windows/usbdk/UsbDk_1.0.15_x86.msi
2. 64 bit: 
http://www.spice-space.org/download/windows/usbdk/UsbDk_1.0.15_x64.msi

UsbDk documentation:
1. Short presentation: 
http://www.spice-space.org/docs/usbdk/UsbDk_at_a_Glance.pdf
2. SDM: 
http://www.spice-space.org/docs/usbdk/UsbDk_Software_Development_Manual.pdf
3. UsbDk architecture specification (part of source tree):
  http://cgit.freedesktop.org/spice/win32/usbdk/tree/ARCHITECTURE

Best regards,
Dmitry

___
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/spice-devel


Re: [Spice-devel] [PATCH qxl-wddm-dod 00/26] Win10 support patches

2016-09-01 Thread Dmitry Fleytman

> On 1 Sep 2016, at 18:08 PM, Frediano Ziglio <fzig...@redhat.com> wrote:
> 
>>> 
>>> On 1 Sep 2016, at 17:27 PM, Christophe Fergeau <cferg...@redhat.com> wrote:
>>> 
>>> On Thu, Sep 01, 2016 at 05:11:06PM +0300, Dmitry Fleytman wrote:
>>>> 
>>>> Does this answer your questions?
>>> 
>>> I think what Frediano is after is a public Daynix-maintained git
>>> repository with the patches you are sending applied, as it's not always
>>> easy to git am these big series (CR/LR differences, not always 100%
>>> clear on what commit they should apply on, ...). Is there such a
>>> publicly accessible repository, which would make patch reviews easier?
>> 
>> Currently such a repository does not exist. We will create one and post to
>> the list.
>> 
> 
> Sorry Dmitry but you said that we agree on
> 
> https://gitlab.com/spice/qxl-wddm-dod <https://gitlab.com/spice/qxl-wddm-dod> 
> - the new main one - we expect that our patches will be applied to this 
> repository
> 
> but than the patches you are sending does not apply and we still need another 
> repo.
> Is it not a contradiction?

Our patches should apply cleanly, our internal branches are based on this 
repository.
Is it due to CR/LF differences or something else?

> 
> Frediano
> 
>>> 
>>> Christophe
>>> 
>>>> 
>>>> Best Regards,
>>>> Dmitry
>>>> 
>>>>> On 1 Sep 2016, at 16:12 PM, Frediano Ziglio <fzig...@redhat.com> wrote:
>>>>> 
>>>>> Hi,
>>>>> sorry for the latency.
>>>>> 
>>>>> However there are some base problems on these patches. One big one it's
>>>>> the repository. As this is not public once we ack the patches where are
>>>>> you putting them? Just changing the comment on the private branch?
>>>>> Actually there are multiple repositories public:
>>>>> 1- https://github.com/vrozenfe/qxl-dod,
>>>>> <https://github.com/vrozenfe/qxl-dod,> original one
>>>>> 2- https://gitlab.com/spice/qxl-wddm-dod/commits/master
>>>>> <https://gitlab.com/spice/qxl-wddm-dod/commits/master>, a copy on
>>>>> gitlab, not sure if this is supposed to be the main one, actually
>>>>> commits are identical to 1
>>>>> 3- https://github.com/flexVDI/qxl-dod
>>>>> <https://github.com/flexVDI/qxl-dod>, FlexVDI additional patches,
>>>>> contains 1/2 + additions.
>>>>> 
>>>>> Personally I pushed the common patches in
>>>>> https://cgit.freedesktop.org/spice/win32/qxl-wddm-dod/
>>>>> <https://cgit.freedesktop.org/spice/win32/qxl-wddm-dod/>. Can you access
>>>>> it?
>>>>> 
>>>>> Another problem is the ownership of the patches. Some changes are inside
>>>>> FlexVDI patches, merged possibly to other ones and with a different
>>>>> owner. One example is the new delete operator from Javier. These issue
>>>>> should be fixed. Still doing on a private branch is quite difficult and
>>>>> not in line with OpenSource.
>>>>> 
>>>>> I contacted Vadim asking for the state of its GitHub repository and said
>>>>> the beside the last patch the state is fine, I think we should start
>>>>> from that commit
>>>>> (https://github.com/vrozenfe/qxl-dod/commit/4e1b33dd4d4f9bb5ee58d13c2a88f8ed610afc41
>>>>> <https://github.com/vrozenfe/qxl-dod/commit/4e1b33dd4d4f9bb5ee58d13c2a88f8ed610afc41>)
>>>>> which is also included in your private repository.
>>>>> 
>>>>> To sum up: We _need_ the common public main repository.
>>>>> 
>>>>> Frediano
>>>>> 
>>>>> 
>>>>> From: "Sameeh Jubran" <sam...@daynix.com>
>>>>> To: "Spice List" <spice-devel@lists.freedesktop.org>
>>>>> Cc: "Dmitry Fleytman" <dmi...@daynix.com>, "Frediano Ziglio"
>>>>> <fzig...@redhat.com>
>>>>> Sent: Tuesday, August 30, 2016 1:18:19 PM
>>>>> Subject: Re: [PATCH qxl-wddm-dod 00/26] Win10 support patches
>>>>> 
>>>>> Can anyone review the rest of the patches? (8 - 26)
>>>>> 
>>>>> On Wed, Aug 24, 2016 at 4:22 PM, Sameeh Jubran <sam...@daynix.com
>>>>> <mailto:sam...@daynix.com>> wrote:
>&

Re: [Spice-devel] [PATCH qxl-wddm-dod 00/26] Win10 support patches

2016-09-01 Thread Dmitry Fleytman

> On 1 Sep 2016, at 17:27 PM, Christophe Fergeau <cferg...@redhat.com> wrote:
> 
> On Thu, Sep 01, 2016 at 05:11:06PM +0300, Dmitry Fleytman wrote:
>> 
>> Does this answer your questions?
> 
> I think what Frediano is after is a public Daynix-maintained git
> repository with the patches you are sending applied, as it's not always
> easy to git am these big series (CR/LR differences, not always 100%
> clear on what commit they should apply on, ...). Is there such a
> publicly accessible repository, which would make patch reviews easier?

Currently such a repository does not exist. We will create one and post to the 
list.

> 
> Christophe
> 
>> 
>> Best Regards,
>> Dmitry
>> 
>>> On 1 Sep 2016, at 16:12 PM, Frediano Ziglio <fzig...@redhat.com> wrote:
>>> 
>>> Hi,
>>>  sorry for the latency.
>>> 
>>> However there are some base problems on these patches. One big one it's the 
>>> repository. As this is not public once we ack the patches where are you 
>>> putting them? Just changing the comment on the private branch?
>>> Actually there are multiple repositories public:
>>> 1- https://github.com/vrozenfe/qxl-dod, 
>>> <https://github.com/vrozenfe/qxl-dod,> original one
>>> 2- https://gitlab.com/spice/qxl-wddm-dod/commits/master 
>>> <https://gitlab.com/spice/qxl-wddm-dod/commits/master>, a copy on gitlab, 
>>> not sure if this is supposed to be the main one, actually commits are 
>>> identical to 1
>>> 3- https://github.com/flexVDI/qxl-dod <https://github.com/flexVDI/qxl-dod>, 
>>> FlexVDI additional patches, contains 1/2 + additions.
>>> 
>>> Personally I pushed the common patches in 
>>> https://cgit.freedesktop.org/spice/win32/qxl-wddm-dod/ 
>>> <https://cgit.freedesktop.org/spice/win32/qxl-wddm-dod/>. Can you access it?
>>> 
>>> Another problem is the ownership of the patches. Some changes are inside 
>>> FlexVDI patches, merged possibly to other ones and with a different owner. 
>>> One example is the new delete operator from Javier. These issue should be 
>>> fixed. Still doing on a private branch is quite difficult and not in line 
>>> with OpenSource.
>>> 
>>> I contacted Vadim asking for the state of its GitHub repository and said 
>>> the beside the last patch the state is fine, I think we should start from 
>>> that commit 
>>> (https://github.com/vrozenfe/qxl-dod/commit/4e1b33dd4d4f9bb5ee58d13c2a88f8ed610afc41
>>>  
>>> <https://github.com/vrozenfe/qxl-dod/commit/4e1b33dd4d4f9bb5ee58d13c2a88f8ed610afc41>)
>>>  which is also included in your private repository.
>>> 
>>> To sum up: We _need_ the common public main repository.
>>> 
>>> Frediano
>>> 
>>> 
>>> From: "Sameeh Jubran" <sam...@daynix.com>
>>> To: "Spice List" <spice-devel@lists.freedesktop.org>
>>> Cc: "Dmitry Fleytman" <dmi...@daynix.com>, "Frediano Ziglio" 
>>> <fzig...@redhat.com>
>>> Sent: Tuesday, August 30, 2016 1:18:19 PM
>>> Subject: Re: [PATCH qxl-wddm-dod 00/26] Win10 support patches
>>> 
>>> Can anyone review the rest of the patches? (8 - 26)
>>> 
>>> On Wed, Aug 24, 2016 at 4:22 PM, Sameeh Jubran <sam...@daynix.com 
>>> <mailto:sam...@daynix.com>> wrote:
>>> Can you please review the rest of the patches so I can send v2?
>>> 
>>> On Tue, Aug 9, 2016 at 6:28 PM, Sameeh Jubran <sam...@daynix.com 
>>> <mailto:sam...@daynix.com>> wrote:
>>> This series contains the latest patches to support Windows 10.
>>> 
>>> Visual Studio 2015 with Win10 WDK is required to compile this code,
>>> Current patches may be compiled and will work for Windows 10.
>>> 
>>> Smoke testing had been done in windows 8.1 seems to be working good.
>>> 
>>> Dmitry Fleytman (4):
>>>  Replacing <#ifdef USE_FRAMEBUFFER> with runtime logic
>>>  Fixing framebuffer usage logic
>>>  Support future Qxl revisions
>>>  Set SupportNonVGA in QueryAdapterInfo callback
>>> 
>>> Sameeh Jubran (9):
>>>  Upgrade to Windows 10 WDK
>>>  Add delete operator
>>>  Code Analysis clean up
>>>  Replacing tabs with spaces
>>>  Fix source buffer mapping in PresentDisplayOnly
>>>  Fixing Move rectangles implementation
>>>  Reserved must be set to 0
>>>  Fixing monitor flicker on resolution ch

Re: [Spice-devel] [PATCH qxl-wddm-dod 00/26] Win10 support patches

2016-09-01 Thread Dmitry Fleytman
Hi Frediano,

A thought we already agreed on this before:

https://github.com/vrozenfe/qxl-dod <https://github.com/vrozenfe/qxl-dod> - 
outdated, no new commits will go there
https://gitlab.com/spice/qxl-wddm-dod <https://gitlab.com/spice/qxl-wddm-dod> - 
the new main one - we expect that our patches will be applied to this repository
https://cgit.freedesktop.org/spice/win32/qxl-wddm-dod/ 
<https://cgit.freedesktop.org/spice/win32/qxl-wddm-dod/> - yes, we can access 
it, this repository should be dropped or become mirror of gitlab.

As to https://github.com/flexVDI/qxl-dod <https://github.com/flexVDI/qxl-dod> - 
Javier told that he will rebase his work on top of our patches as soon as they 
pushed to the main repository, i.e. to the gitlab.

Does this answer your questions?

Best Regards,
Dmitry

> On 1 Sep 2016, at 16:12 PM, Frediano Ziglio <fzig...@redhat.com> wrote:
> 
> Hi,
>   sorry for the latency.
> 
> However there are some base problems on these patches. One big one it's the 
> repository. As this is not public once we ack the patches where are you 
> putting them? Just changing the comment on the private branch?
> Actually there are multiple repositories public:
> 1- https://github.com/vrozenfe/qxl-dod, 
> <https://github.com/vrozenfe/qxl-dod,> original one
> 2- https://gitlab.com/spice/qxl-wddm-dod/commits/master 
> <https://gitlab.com/spice/qxl-wddm-dod/commits/master>, a copy on gitlab, not 
> sure if this is supposed to be the main one, actually commits are identical 
> to 1
> 3- https://github.com/flexVDI/qxl-dod <https://github.com/flexVDI/qxl-dod>, 
> FlexVDI additional patches, contains 1/2 + additions.
> 
> Personally I pushed the common patches in 
> https://cgit.freedesktop.org/spice/win32/qxl-wddm-dod/ 
> <https://cgit.freedesktop.org/spice/win32/qxl-wddm-dod/>. Can you access it?
> 
> Another problem is the ownership of the patches. Some changes are inside 
> FlexVDI patches, merged possibly to other ones and with a different owner. 
> One example is the new delete operator from Javier. These issue should be 
> fixed. Still doing on a private branch is quite difficult and not in line 
> with OpenSource.
> 
> I contacted Vadim asking for the state of its GitHub repository and said the 
> beside the last patch the state is fine, I think we should start from that 
> commit 
> (https://github.com/vrozenfe/qxl-dod/commit/4e1b33dd4d4f9bb5ee58d13c2a88f8ed610afc41
>  
> <https://github.com/vrozenfe/qxl-dod/commit/4e1b33dd4d4f9bb5ee58d13c2a88f8ed610afc41>)
>  which is also included in your private repository.
> 
> To sum up: We _need_ the common public main repository.
> 
> Frediano
> 
> 
> From: "Sameeh Jubran" <sam...@daynix.com>
> To: "Spice List" <spice-devel@lists.freedesktop.org>
> Cc: "Dmitry Fleytman" <dmi...@daynix.com>, "Frediano Ziglio" 
> <fzig...@redhat.com>
> Sent: Tuesday, August 30, 2016 1:18:19 PM
> Subject: Re: [PATCH qxl-wddm-dod 00/26] Win10 support patches
> 
> Can anyone review the rest of the patches? (8 - 26)
> 
> On Wed, Aug 24, 2016 at 4:22 PM, Sameeh Jubran <sam...@daynix.com 
> <mailto:sam...@daynix.com>> wrote:
> Can you please review the rest of the patches so I can send v2?
> 
> On Tue, Aug 9, 2016 at 6:28 PM, Sameeh Jubran <sam...@daynix.com 
> <mailto:sam...@daynix.com>> wrote:
> This series contains the latest patches to support Windows 10.
> 
> Visual Studio 2015 with Win10 WDK is required to compile this code,
> Current patches may be compiled and will work for Windows 10.
> 
> Smoke testing had been done in windows 8.1 seems to be working good.
> 
> Dmitry Fleytman (4):
>   Replacing <#ifdef USE_FRAMEBUFFER> with runtime logic
>   Fixing framebuffer usage logic
>   Support future Qxl revisions
>   Set SupportNonVGA in QueryAdapterInfo callback
> 
> Sameeh Jubran (9):
>   Upgrade to Windows 10 WDK
>   Add delete operator
>   Code Analysis clean up
>   Replacing tabs with spaces
>   Fix source buffer mapping in PresentDisplayOnly
>   Fixing Move rectangles implementation
>   Reserved must be set to 0
>   Fixing monitor flicker on resolution change
>   Removing unnecessary call to BlackOutScreen
> 
> Sandy Stutsman (13):
>   Add printer class to dump debug print statements to kernel debugger
> output
>   Set DriverStarted flag at the begining of the StartDriver function
>   Fix Code Integrity error generated by the Drive Verifier
>   Add functions called from non-pageable functions to non-paged segments
>   Do not use virtual functions for code that must not be paged
>   On power wake call the init functions before setting the vidpn to
>

Re: [Spice-devel] [PATCH] Adding new ioctl for updating Vdagent state

2016-08-09 Thread Dmitry Fleytman
Hi Frediano,

Thanks for your review!
This path is based on assumption that mouse mode is always client for as long 
as vdagent running.
As we know now this assumption is wrong, so we are calling this patch back for 
rework. 

Regards,
Dmitry

> On 9 Aug 2016, at 19:42 PM, Frediano Ziglio  wrote:
> 
> The code is fine but the rationale lacks a bit.
> On Linux there is no such feature but not the bug so if your rationale is 
> this is needed to fix a bug I don't understand why.
> Also the rationale assume the server or client pointer is all dependent on 
> vdagent existence which seems not true.
> I was looking at Sandy (should download last WDDM) code and seems that 
> EnablePointer is used in 3 cases
> - to reply cursor support (which is wrong, driver support cursor either way);
> - to avoid sending cursor shape changes (which seems not that fine);
> - to avoid sending cursor movements (which reduces guest -> server dialog for 
> sure and perhaps server -> client if server propagate always).
> 
> Frediano
> 
> Hi,
> 
> What do you think that needs to be done?
> The patches should be applied?
> The interface of the device should be extended to support broadcasting the 
> mouse mode to the driver? ( I think would require to modify the spice 
> protocol )
> The interface of spice-gtk should be extended to support broadcasting the 
> mouse mode to vdagent?
> 
> On Mon, Aug 8, 2016 at 8:08 PM, Frediano Ziglio  > wrote:
> 
> On Mon, Aug 8, 2016 at 6:47 PM, Frediano Ziglio  > wrote:
> > An optimal solution to this would be that the driver knows somehow when
> > we are in a server mode and when we are in a client mode. However this
> > information isn't available in the driver nor in the vdagent.
> 
> Could you explain why an optimal solution require this knowledge?
> Also "However this information isn't available in the driver nor in the 
> vdagent."
> does not make sense to me. The vdagent is sending this information to the
> driver so this information is available in vdagent.
> The current information the driver is getting is about Vdagent state 
> (running/off), When
> Vdagent is running then the client mouse should be enabled and when Vdagent 
> is off
> server mouse should be enabled. This is true for the typical use case of 
> Vdagent.
> But this isn't exactly true all of the time, for example when running Spicy 
> along with Vdagent on
>  and we send a command to change the mouse mode to server mode we get that 
> Vdagent state is on
> and the mouse in server mode.
> Now I got it.
> 
> So currently the driver bases it's behavior on vdagent existence but this is 
> not correct
> as there are cases where agent is present but you want to used server mouse.
> 
> Looking at the rationale:
> 
> "A new ioctl for updating the driver with vdagent running state.
> This patch adds new ioctl operation to Vdagent in order to update
> the driver on Vdagent state. This allows the driver to know
> when Vdagent is running and when it is off.
> 
> Spice supports two mouse modes: server and client. The server mouse
> mode pointer should be enabled when vdagent is off and the client
> mouse mode should be enabled  when it is on. The mouse mode
> is updated by the driver and thus this patch is needed."
> 
> I still have a doubt. Is not the service (vdagentd in Linux) that speak
> to the driver? Potentially there are multiple agents, one for login.
> 
> Also if you can tell client to use server mode in this case you
> end up having the agent running but server mode which
> seems wrong from your rationale.
> 
> Also "adds new ioctl operation to Vdagent" the ioctl is implemented
> in the driver so I would say "adds new ioctl operation to the driver in
> order to allow Vdagent to communicate its state to the driver".
> 
> Frediano
> 
> 
> Frediano
> 
> > On Mon, Aug 8, 2016 at 6:33 PM, Christophe Fergeau < cferg...@redhat.com 
> >  >
> > wrote:
> 
> > > On Mon, Aug 08, 2016 at 06:19:41PM +0300, Sameeh Jubran wrote:
> >
> > > > >
> >
> > > > This patch enables the driver to send move commands to the QXL device
> > > > when
> >
> > > > vdagent is off.
> >
> > > > This maybe the reason you are not getting any move commands.
> >
> 
> > > But don't we have exactly the same issue with a fedora guest or a win7-
> >
> > > guest? I've observed the same with a Fedora guest at least.
> >
> > > Also I don't think there is a strict equivalence between vdagent is
> >
> > > running and mouse is in server mode, so if we were to change this at the
> >
> > > agent level, are we going to fix all cases?
> >
> 
> > > Christophe
> >
> 
> > --
> > Respectfully,
> > Sameeh Jubran
> > Linkedin
> > Junior Software Engineer @ Daynix .
> 
> > ___
> > Spice-devel mailing list
> > Spice-devel@lists.freedesktop.org 
> > 

Re: [Spice-devel] [PATCH] Adding new ioctl for updating Vdagent state

2016-08-09 Thread Dmitry Fleytman

> On 9 Aug 2016, at 16:05 PM, Christophe Fergeau  wrote:
> 
> On Tue, Aug 09, 2016 at 09:22:15AM +0300, Sameeh Jubran wrote:
>> Hi,
>> 
>> What do you think that needs to be done?
>> The patches should be applied?
>> The interface of the device should be extended to support broadcasting the
>> mouse mode to the driver? ( I think would require to modify the spice
>> protocol )
>> The interface of spice-gtk should be extended to support broadcasting the
>> mouse mode to vdagent?
> 
> NB: if (emphasis on "if") you really need to differentiate between
> client and mouse mode within the QXL driver, I'd add this to QXLRom
> and have spice-server indicate what is the current mouse mode through
> that as it knows which mode it's in.

Thanks for the clue. We will investigate this possibility.

> 
> Christophe
> ___
> Spice-devel mailing list
> Spice-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/spice-devel

___
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/spice-devel


Re: [Spice-devel] [PATCH] Adding new ioctl for updating Vdagent state

2016-08-09 Thread Dmitry Fleytman

> On 9 Aug 2016, at 16:03 PM, Christophe Fergeau <cferg...@redhat.com> wrote:
> 
> Hey,
> 
> On Tue, Aug 09, 2016 at 03:22:52PM +0300, Dmitry Fleytman wrote:
>> 
>>> On 9 Aug 2016, at 14:23 PM, Christophe Fergeau <cferg...@redhat.com> wrote:
>>> 
>>> On Tue, Aug 09, 2016 at 09:22:15AM +0300, Sameeh Jubran wrote:
>>>> Hi,
>>>> 
>>>> What do you think that needs to be done?
>>>> The patches should be applied?
>>>> The interface of the device should be extended to support broadcasting the
>>>> mouse mode to the driver? ( I think would require to modify the spice
>>>> protocol )
>>>> The interface of spice-gtk should be extended to support broadcasting the
>>>> mouse mode to vdagent?
>>> 
>>> The filtering of cursor commands depending on server/mouse mode is
>>> already done in spice-server in
>>> https://cgit.freedesktop.org/spice/spice/tree/server/cursor-channel.c#n438
>>> so I don't think we need to know too much about client/server mode in
>>> the guest driver. Maybe some VGA/QXL distinction will be needed to avoid
>>> some VGA-specific issues, but when using QXL, removing EnablePointer()
>>> altogether should do the right thing both in client and server mode (did
>>> not test).
>> 
>> Hi Christophe,
>> 
>> For some reason mouse movements are less smooth when we do not filter out 
>> mouse events on driver level.
>> I suspect this was the reason Sandy changed EnablePointer() behaviour of the 
>> driver.
>> 
>> Do you have any idea why could this happen?
> 
> Nope no idea, maybe too many events get sent? Adding the new ioctl
> while asking me this question at the same time sounds like we are just
> papering over an issue we don't understand.

Our investigation shows that this happens due to too many events indeed.
I thought, perhaps you have seen similar issues on other platforms 
(pre-win10/linux)
and have additional information.

> Do you notice this "smoothness" issue with legacy qxl-win or on linux?
> Is this in server on client mouse mode?
> 
> Christophe

___
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/spice-devel


Re: [Spice-devel] [PATCH] Adding new ioctl for updating Vdagent state

2016-08-09 Thread Dmitry Fleytman

> On 9 Aug 2016, at 14:23 PM, Christophe Fergeau  wrote:
> 
> On Tue, Aug 09, 2016 at 09:22:15AM +0300, Sameeh Jubran wrote:
>> Hi,
>> 
>> What do you think that needs to be done?
>> The patches should be applied?
>> The interface of the device should be extended to support broadcasting the
>> mouse mode to the driver? ( I think would require to modify the spice
>> protocol )
>> The interface of spice-gtk should be extended to support broadcasting the
>> mouse mode to vdagent?
> 
> The filtering of cursor commands depending on server/mouse mode is
> already done in spice-server in
> https://cgit.freedesktop.org/spice/spice/tree/server/cursor-channel.c#n438
> so I don't think we need to know too much about client/server mode in
> the guest driver. Maybe some VGA/QXL distinction will be needed to avoid
> some VGA-specific issues, but when using QXL, removing EnablePointer()
> altogether should do the right thing both in client and server mode (did
> not test).

Hi Christophe,

For some reason mouse movements are less smooth when we do not filter out mouse 
events on driver level.
I suspect this was the reason Sandy changed EnablePointer() behaviour of the 
driver.

Do you have any idea why could this happen?

~Dmitry

> 
> Christophe
> ___
> Spice-devel mailing list
> Spice-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/spice-devel

___
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/spice-devel


Re: [Spice-devel] [PATCH win-vdagent] Adding ioctl operation to update Vdagent state

2016-08-08 Thread Dmitry Fleytman

> On 8 Aug 2016, at 10:48 AM, Frediano Ziglio <fzig...@redhat.com> wrote:
> 
> 
> 
>> Hi Vector,
> 
>> After testing this patch with spicy it turns out that the mouse is always in
>> client mode as long as
>> vdagent is running, However this behaviour is the same as the one prior to
>> this patch which means
>> that this patch doesn't change the current behaviour of the mouse mode.
> 
> That is this patch is useless ??

Hi Frediano,

I think Sameeh means that he did not succeed to switch
mouse mode to “server” using spicy and because of that he
was unable to verify that this patch does not introduce regressions.

Do you have any idea why spicy does not switch mouse mode?

Thanks,
Dmitry

> 
> Frediano
> 
>> On Thu, Aug 4, 2016 at 5:27 PM, Victor Toso < li...@victortoso.com > wrote:
> 
>>> Hi,
>> 
> 
>>> On Thu, Aug 04, 2016 at 05:07:35PM +0300, Dmitry Fleytman wrote:
>> 
>>>>>>> On Thu, Aug 04, 2016 at 06:34:14AM -0700, Dmitry Fleytman wrote:
>> 
>>>>>>>> Hi Victor,
>> 
>>>>>>>> 
>> 
>>>>>>>> How do we configure server mouse with VDAgent running?
>> 
>>>>>>> 
>> 
>>>>>>> You mean the host/VM configuration? What I mean by my question is
>>>>>>> that
>> 
>>>>>>> we can send a SpiceMsgcMainMouseModeRequest from client to change
>>>>>>> mouse
>> 
>>>>>>> mode and I would like to know if that would still be possible with
>>>>>>> this
>> 
>>>>>>> patch.
>> 
>>>>>>> 
>> 
>>>>>>> Check:
>> 
>>>>>>> https://cgit.freedesktop.org/spice/spice-gtk/commit/?id=5f89a4df037f6a1f2
>> 
>>>>>> 
>> 
>>>>>> I mean, is there any tool/command line switch that we can use to check
>>>>>> this case?
>> 
>>>>> 
>> 
>>>>> Yes! spicy has a `toggle mouse mode` in the options (shift + F7)
>> 
>>>> 
>> 
>>>> Cool, I did not know this.
>> 
>>>> Is there pre-compiled spicy binary that we can use somewhere?
>> 
> 
>>> It is part of spice-gtk code base, on fedora you can find it on
>> 
>>> spice-gtk-tools package. Not sure if this is distributed on mingw
>> 
>>> packages for windows.
>> 
> ___
> Spice-devel mailing list
> Spice-devel@lists.freedesktop.org <mailto:Spice-devel@lists.freedesktop.org>
> https://lists.freedesktop.org/mailman/listinfo/spice-devel 
> <https://lists.freedesktop.org/mailman/listinfo/spice-devel>
___
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/spice-devel


Re: [Spice-devel] [PATCH win-vdagent] Adding ioctl operation to update Vdagent state

2016-08-04 Thread Dmitry Fleytman

> On 4 Aug 2016, at 17:02 PM, Victor Toso <li...@victortoso.com> wrote:
> 
> Hi,
> 
> On Thu, Aug 04, 2016 at 05:00:33PM +0300, Dmitry Fleytman wrote:
>> 
>>> On 4 Aug 2016, at 16:44 PM, Victor Toso <li...@victortoso.com> wrote:
>>> 
>>> Hi,
>>> 
>>> On Thu, Aug 04, 2016 at 06:34:14AM -0700, Dmitry Fleytman wrote:
>>>> Hi Victor,
>>>> 
>>>> How do we configure server mouse with VDAgent running?
>>> 
>>> You mean the host/VM configuration? What I mean by my question is that
>>> we can send a SpiceMsgcMainMouseModeRequest from client to change mouse
>>> mode and I would like to know if that would still be possible with this
>>> patch.
>>> 
>>> Check:
>>> https://cgit.freedesktop.org/spice/spice-gtk/commit/?id=5f89a4df037f6a1f2
>> 
>> I mean, is there any tool/command line switch that we can use to check this 
>> case?
> 
> Yes! spicy has a `toggle mouse mode` in the options (shift + F7)

Cool, I did not know this.
Is there pre-compiled spicy binary that we can use somewhere?

> 
>> 
>>> 
>>>> 
>>>> Thanks,
>>>> Dmitry
>>>> 
>>>> 
>>>> On Thu, Aug 4, 2016 at 6:30 AM, Victor Toso <li...@victortoso.com> wrote:
>>>> 
>>>>> Hi,
>>>>> 
>>>>> On Wed, Aug 03, 2016 at 06:45:29PM +0300, Sameeh Jubran wrote:
>>>>>> This patch adds new ioctl operation to Vdagent in order to update
>>>>>> the driver on Vdagent state. This allows the driver to know
>>>>>> when Vdagent is running and when it is off.
>>>>>> 
>>>>>> Spice supports two mouse modes: server and client. The server mouse
>>>>>> mode pointer should be enabled when vdagent is off and the client
>>>>>> mouse mode should be enabled  when it is on. The mouse mode
>>>>>> is updated by the driver and thus this patch is needed.
>>>>> 
>>>>> Just to be sure. I can still have mouse in server mode when VDAgent is
>>>>> running?
>>>>> 
>>>>> toso
>>>>> 
>>>>>> 
>>>>>> Signed-off-by: Sameeh Jubran <sam...@daynix.com>
>>>>>> ---
>>>>>> vdagent/desktop_layout.cpp| 21 +
>>>>>> vdagent/desktop_layout.h  |  1 +
>>>>>> vdagent/display_configuration.cpp | 16 
>>>>>> vdagent/display_configuration.h   |  3 ++-
>>>>>> 4 files changed, 40 insertions(+), 1 deletion(-)
>>>>>> 
>>>>>> diff --git a/vdagent/desktop_layout.cpp b/vdagent/desktop_layout.cpp
>>>>>> index 9c3e873..4d183e1 100644
>>>>>> --- a/vdagent/desktop_layout.cpp
>>>>>> +++ b/vdagent/desktop_layout.cpp
>>>>>> @@ -45,6 +45,7 @@ DesktopLayout::DesktopLayout()
>>>>>> 
>>>>>> DesktopLayout::~DesktopLayout()
>>>>>> {
>>>>>> +set_vdagent_running_for_displays(false);
>>>>>>clean_displays();
>>>>>>delete _display_config;
>>>>>> }
>>>>>> @@ -121,6 +122,8 @@ void DesktopLayout::set_displays()
>>>>>>DWORD display_id = 0;
>>>>>>int dev_sets = 0;
>>>>>> 
>>>>>> +set_vdagent_running_for_displays(true);
>>>>>> +
>>>>>>lock();
>>>>>>if (!consistent_displays()) {
>>>>>>unlock();
>>>>>> @@ -275,6 +278,22 @@ bool DesktopLayout::get_qxl_device_id(WCHAR*
>>>>> device_key, DWORD* device_id)
>>>>>>return key_found;
>>>>>> }
>>>>>> 
>>>>>> +void DesktopLayout::set_vdagent_running_for_displays(bool running)
>>>>>> +{
>>>>>> +DISPLAY_DEVICE dev_info;
>>>>>> +DWORD dev_id = 0;
>>>>>> +lock();
>>>>>> +ZeroMemory(_info, sizeof(dev_info));
>>>>>> +dev_info.cb = sizeof(dev_info);
>>>>>> +while (EnumDisplayDevices(NULL, dev_id, _info, 0)) {
>>>>>> +dev_id++;
>>>>>> +if (!(dev_info.StateFlags & DISPLAY_DEVICE_MIRRORING_DRIVER)
>>>>> && wcsstr(dev_info.DeviceString, L"QXL")) {
>>

Re: [Spice-devel] [PATCH win-vdagent] Adding ioctl operation to update Vdagent state

2016-08-04 Thread Dmitry Fleytman

> On 4 Aug 2016, at 16:44 PM, Victor Toso <li...@victortoso.com> wrote:
> 
> Hi,
> 
> On Thu, Aug 04, 2016 at 06:34:14AM -0700, Dmitry Fleytman wrote:
>> Hi Victor,
>> 
>> How do we configure server mouse with VDAgent running?
> 
> You mean the host/VM configuration? What I mean by my question is that
> we can send a SpiceMsgcMainMouseModeRequest from client to change mouse
> mode and I would like to know if that would still be possible with this
> patch.
> 
> Check:
> https://cgit.freedesktop.org/spice/spice-gtk/commit/?id=5f89a4df037f6a1f2

I mean, is there any tool/command line switch that we can use to check this 
case?

> 
>> 
>> Thanks,
>> Dmitry
>> 
>> 
>> On Thu, Aug 4, 2016 at 6:30 AM, Victor Toso <li...@victortoso.com> wrote:
>> 
>>> Hi,
>>> 
>>> On Wed, Aug 03, 2016 at 06:45:29PM +0300, Sameeh Jubran wrote:
>>>> This patch adds new ioctl operation to Vdagent in order to update
>>>> the driver on Vdagent state. This allows the driver to know
>>>> when Vdagent is running and when it is off.
>>>> 
>>>> Spice supports two mouse modes: server and client. The server mouse
>>>> mode pointer should be enabled when vdagent is off and the client
>>>> mouse mode should be enabled  when it is on. The mouse mode
>>>> is updated by the driver and thus this patch is needed.
>>> 
>>> Just to be sure. I can still have mouse in server mode when VDAgent is
>>> running?
>>> 
>>>  toso
>>> 
>>>> 
>>>> Signed-off-by: Sameeh Jubran <sam...@daynix.com>
>>>> ---
>>>> vdagent/desktop_layout.cpp| 21 +
>>>> vdagent/desktop_layout.h  |  1 +
>>>> vdagent/display_configuration.cpp | 16 
>>>> vdagent/display_configuration.h   |  3 ++-
>>>> 4 files changed, 40 insertions(+), 1 deletion(-)
>>>> 
>>>> diff --git a/vdagent/desktop_layout.cpp b/vdagent/desktop_layout.cpp
>>>> index 9c3e873..4d183e1 100644
>>>> --- a/vdagent/desktop_layout.cpp
>>>> +++ b/vdagent/desktop_layout.cpp
>>>> @@ -45,6 +45,7 @@ DesktopLayout::DesktopLayout()
>>>> 
>>>> DesktopLayout::~DesktopLayout()
>>>> {
>>>> +set_vdagent_running_for_displays(false);
>>>> clean_displays();
>>>> delete _display_config;
>>>> }
>>>> @@ -121,6 +122,8 @@ void DesktopLayout::set_displays()
>>>> DWORD display_id = 0;
>>>> int dev_sets = 0;
>>>> 
>>>> +set_vdagent_running_for_displays(true);
>>>> +
>>>> lock();
>>>> if (!consistent_displays()) {
>>>> unlock();
>>>> @@ -275,6 +278,22 @@ bool DesktopLayout::get_qxl_device_id(WCHAR*
>>> device_key, DWORD* device_id)
>>>> return key_found;
>>>> }
>>>> 
>>>> +void DesktopLayout::set_vdagent_running_for_displays(bool running)
>>>> +{
>>>> +DISPLAY_DEVICE dev_info;
>>>> +DWORD dev_id = 0;
>>>> +lock();
>>>> +ZeroMemory(_info, sizeof(dev_info));
>>>> +dev_info.cb = sizeof(dev_info);
>>>> +while (EnumDisplayDevices(NULL, dev_id, _info, 0)) {
>>>> +dev_id++;
>>>> +if (!(dev_info.StateFlags & DISPLAY_DEVICE_MIRRORING_DRIVER)
>>> && wcsstr(dev_info.DeviceString, L"QXL")) {
>>>> +_display_config->set_vdagent_running(dev_info.DeviceName,
>>> running);
>>>> +}
>>>> +}
>>>> +unlock();
>>>> +}
>>>> +
>>>> bool DesktopLayout::init_dev_mode(LPCTSTR dev_name, DEVMODE* dev_mode,
>>> DisplayMode* mode)
>>>> {
>>>> ZeroMemory(dev_mode, sizeof(DEVMODE));
>>>> @@ -298,6 +317,8 @@ bool DesktopLayout::init_dev_mode(LPCTSTR dev_name,
>>> DEVMODE* dev_mode, DisplayMo
>>>> // update current DisplayMode (so mouse scaling works properly)
>>>> mode->_width = dev_mode->dmPelsWidth;
>>>> mode->_height = dev_mode->dmPelsHeight;
>>>> +
>>>> +set_vdagent_running_for_displays(true);
>>>> return true;
>>>> 
>>>> }
>>>> diff --git a/vdagent/desktop_layout.h b/vdagent/desktop_layout.h
>>>> index fd6af76..da5a40b 100644
>>>> --- a/vdagent/desktop_l

Re: [Spice-devel] [PATCH win-vdagent] Adding ioctl operation to update Vdagent state

2016-08-04 Thread Dmitry Fleytman
Hi Victor,

How do we configure server mouse with VDAgent running?

Thanks,
Dmitry


On Thu, Aug 4, 2016 at 6:30 AM, Victor Toso  wrote:

> Hi,
>
> On Wed, Aug 03, 2016 at 06:45:29PM +0300, Sameeh Jubran wrote:
> > This patch adds new ioctl operation to Vdagent in order to update
> > the driver on Vdagent state. This allows the driver to know
> > when Vdagent is running and when it is off.
> >
> > Spice supports two mouse modes: server and client. The server mouse
> > mode pointer should be enabled when vdagent is off and the client
> > mouse mode should be enabled  when it is on. The mouse mode
> > is updated by the driver and thus this patch is needed.
>
> Just to be sure. I can still have mouse in server mode when VDAgent is
> running?
>
>   toso
>
> >
> > Signed-off-by: Sameeh Jubran 
> > ---
> >  vdagent/desktop_layout.cpp| 21 +
> >  vdagent/desktop_layout.h  |  1 +
> >  vdagent/display_configuration.cpp | 16 
> >  vdagent/display_configuration.h   |  3 ++-
> >  4 files changed, 40 insertions(+), 1 deletion(-)
> >
> > diff --git a/vdagent/desktop_layout.cpp b/vdagent/desktop_layout.cpp
> > index 9c3e873..4d183e1 100644
> > --- a/vdagent/desktop_layout.cpp
> > +++ b/vdagent/desktop_layout.cpp
> > @@ -45,6 +45,7 @@ DesktopLayout::DesktopLayout()
> >
> >  DesktopLayout::~DesktopLayout()
> >  {
> > +set_vdagent_running_for_displays(false);
> >  clean_displays();
> >  delete _display_config;
> >  }
> > @@ -121,6 +122,8 @@ void DesktopLayout::set_displays()
> >  DWORD display_id = 0;
> >  int dev_sets = 0;
> >
> > +set_vdagent_running_for_displays(true);
> > +
> >  lock();
> >  if (!consistent_displays()) {
> >  unlock();
> > @@ -275,6 +278,22 @@ bool DesktopLayout::get_qxl_device_id(WCHAR*
> device_key, DWORD* device_id)
> >  return key_found;
> >  }
> >
> > +void DesktopLayout::set_vdagent_running_for_displays(bool running)
> > +{
> > +DISPLAY_DEVICE dev_info;
> > +DWORD dev_id = 0;
> > +lock();
> > +ZeroMemory(_info, sizeof(dev_info));
> > +dev_info.cb = sizeof(dev_info);
> > +while (EnumDisplayDevices(NULL, dev_id, _info, 0)) {
> > +dev_id++;
> > +if (!(dev_info.StateFlags & DISPLAY_DEVICE_MIRRORING_DRIVER)
> && wcsstr(dev_info.DeviceString, L"QXL")) {
> > +_display_config->set_vdagent_running(dev_info.DeviceName,
> running);
> > +}
> > +}
> > +unlock();
> > +}
> > +
> >  bool DesktopLayout::init_dev_mode(LPCTSTR dev_name, DEVMODE* dev_mode,
> DisplayMode* mode)
> >  {
> >  ZeroMemory(dev_mode, sizeof(DEVMODE));
> > @@ -298,6 +317,8 @@ bool DesktopLayout::init_dev_mode(LPCTSTR dev_name,
> DEVMODE* dev_mode, DisplayMo
> >  // update current DisplayMode (so mouse scaling works properly)
> >  mode->_width = dev_mode->dmPelsWidth;
> >  mode->_height = dev_mode->dmPelsHeight;
> > +
> > +set_vdagent_running_for_displays(true);
> >  return true;
> >
> >  }
> > diff --git a/vdagent/desktop_layout.h b/vdagent/desktop_layout.h
> > index fd6af76..da5a40b 100644
> > --- a/vdagent/desktop_layout.h
> > +++ b/vdagent/desktop_layout.h
> > @@ -83,6 +83,7 @@ private:
> >  static bool consistent_displays();
> >  static bool is_attached(LPCTSTR dev_name);
> >  static bool get_qxl_device_id(WCHAR* device_key, DWORD* device_id);
> > +void set_vdagent_running_for_displays(bool enable_pointer);
> >  private:
> >  mutex_t _mutex;
> >  Displays _displays;
> > diff --git a/vdagent/display_configuration.cpp b/vdagent/display_
> configuration.cpp
> > index 4565b15..7e617b6 100755
> > --- a/vdagent/display_configuration.cpp
> > +++ b/vdagent/display_configuration.cpp
> > @@ -248,6 +248,16 @@ struct WDDMMonitorConfigEscape {
> >  QXLHead _head;
> >  };
> >
> > +struct WDDMVDAgentRunningEscape {
> > +WDDMVDAgentRunningEscape(bool running)
> > +{
> > +_ioctl = QXL_ESCAPE_VDAGENT_RUNNING;
> > +_vdagent_state.running = running;
> > +}
> > +int_ioctl;
> > +QXLEscapeVDAgentRunning_vdagent_state;
> > +};
> > +
> >  DisplayConfig* DisplayConfig::create_config()
> >  {
> >  DisplayConfig* new_interface;
> > @@ -690,6 +700,12 @@ bool WDDMInterface::escape(LPCTSTR device_name,
> void* data, UINT size_data)
> >  return NT_SUCCESS(status);
> >  }
> >
> > +bool WDDMInterface::set_vdagent_running(LPCTSTR device_name, bool
> running)
> > +{
> > +WDDMVDAgentRunningEscape wddm_escape(running);
> > +return escape(device_name, _escape, sizeof(wddm_escape));
> > +}
> > +
> >  CCD::CCD()
> >  :_NumPathElements(0)
> >  ,_NumModeElements(0)
> > diff --git a/vdagent/display_configuration.h b/vdagent/display_
> configuration.h
> > index b3d0198..e8ba2f0 100755
> > --- a/vdagent/display_configuration.h
> > +++ b/vdagent/display_configuration.h
> > @@ -107,7 +107,7 @@ public:
> >  virtual bool 

Re: [Spice-devel] [PATCH win-vdagent] Provide support for Windows CCD API

2016-08-03 Thread Dmitry Fleytman

> On 3 Aug 2016, at 16:20 PM, Christophe Fergeau <cferg...@redhat.com> wrote:
> 
> On Wed, Aug 03, 2016 at 03:04:23PM +0200, Christophe Fergeau wrote:
>> On Wed, Aug 03, 2016 at 03:53:27PM +0300, Dmitry Fleytman wrote:
>>> 
>>>> On 3 Aug 2016, at 13:38 PM, Sameeh Jubran <sam...@daynix.com> wrote:
>>>> 
>>>> 
>>>> 
>>>> On Wed, Aug 3, 2016 at 1:19 PM, Christophe Fergeau <cferg...@redhat.com 
>>>> <mailto:cferg...@redhat.com>> wrote:
>>>> On Wed, Aug 03, 2016 at 05:25:59AM -0400, Frediano Ziglio wrote:
>>>>> 
>>>>>> Can you please further explain regarding the licensing? which license 
>>>>>> should
>>>>>> be used?
>>>>> 
>>>>> These defines came from Microsoft headers or from the web like
>>>>> https://msdn.microsoft.com/en-us/library/windows/hardware/ff548113(v=vs.85).aspx
>>>>>  
>>>>> <https://msdn.microsoft.com/en-us/library/windows/hardware/ff548113(v=vs.85).aspx>
>>>>> simply you can't copy from header (which have its license) and/or from web
>>>>> (see 
>>>>> https://www.microsoft.com/en-us/legal/intellectualproperty/copyright/default.aspx
>>>>>  
>>>>> <https://www.microsoft.com/en-us/legal/intellectualproperty/copyright/default.aspx>
>>>>>  )
>>>>> 
>>>>> Not sure about the license. Looks like Mingw headers have public domain 
>>>>> licensing.
>>>>> For instance https://searchcode.com/codesearch/raw/11987244/ 
>>>>> <https://searchcode.com/codesearch/raw/11987244/> have a Microsoft 
>>>>> disclaimer.
>>>>> 
>>>>> Maybe I'm too overcautious
>>>> 
>>>> I don't think you are being too caution, either these definitions have
>>>> an explicit licence compatible with the vdagent-win one, or we should
>>>> not copy them this way. Why do we need to copy these definitions in
>>>> vdagent-win in the first place?
>>>> 
>>>> These definitions and structures are used in the CCD api and provided by 
>>>> windows,
>>>> However they are absent in mingw. What are our options now?
>>>> 
>>>> Please note that we eliminated many of the unnecessary and unused 
>>>> definitions from the ones we
>>>> previously included in our previous patch ( 
>>>> https://lists.freedesktop.org/archives/spice-devel/2016-July/030796.html 
>>>> <https://lists.freedesktop.org/archives/spice-devel/2016-July/030796.html> 
>>>> ). Moreover
>>>> they are now present in the cpp files.
>>> 
>>> We dropped most of definitions from Sandy’s series and left only those
>>> we really need, so there are no copy-pasted files anymore, but we cannot 
>>> avoid
>>> using them at all because they are absent in MinGW.
>>> 
>>> Christophe, Frediano, do you have any idea what to do in this case?
>> 
>> If they are only needed for mingw builds, I'd start with splitting this
>> in their own "Fix mingw build" patch, with an explanation why we
>> duplicated header content, where the content is coming from (ie why we
>> are allowed to license it the way we do), and so on.
>> 
>> If we don't have find appropriately licensed headers covering what we
>> need, then we may have to decide that CCD support is vc++ only.
> 
> https://github.com/wine-mirror/wine/blob/master/include/wingdi.h 
> <https://github.com/wine-mirror/wine/blob/master/include/wingdi.h> is
> LGPLv2.1 and seems to have some of the definitions we need (I did not
> check all of them). I don't know if it can be used directly with mingw
> and if it's a drop-in replacement for the corresponding MS header.

Great! It contains declarations we need. We will take from there.

> 
> Christophe

___
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/spice-devel


Re: [Spice-devel] [PATCH win-vdagent] Provide support for Windows CCD API

2016-08-03 Thread Dmitry Fleytman
> From: Javier Celaya  >
> Date: Wed, Aug 3, 2016 at 12:17 PM
> Subject: Re: [Spice-devel] [PATCH win-vdagent] Provide support for Windows 
> CCD API
> To: spice-devel@lists.freedesktop.org 
> 
> 
> 
> Hi,
> 
> El mié, 03-08-2016 a las 04:57 -0400, Frediano Ziglio escribió:
> > >
> > > On Wed, Aug 03, 2016 at 11:35:56AM +0300, Sameeh Jubran wrote:
> > > > Hi,
> > > >
> > > > We've already looked into those patches (Javier's patches) and
> > > > tested them.
> > >
> > > Ah ok, I must have missed your answer to Javier's series.
> > >
> > > > We found that on the contrary to our patches,
> > > > multi-monitor support and arbitrary resolution do not work with
> > > > the patches
> > > > posted by Javier. Even though arbitrary resolution
> > > > resolution is implemented in Javier's patches, it is not fully
> > > > arbitrary.
> 
> And full arbitrary resolution would be too complicated to add on top of
> Javier's series, hence the decision to go with an entirely different
> series? Sorry for the basic questions, I'm really not familiar with
> Windows API :)
> 
> Christophe
> 
> 
> 
> Not at all. I did not implement multi-monitor support because that
> required to break the interface with the last kernel driver version at
> that moment (it only supported one operation, setting an arbitrary
> resolution). So it is only a matter of writing the new escapes.
> 
> On the other hand, I limited arbitrary resolutions to even sizes
> because, again, that was what the kernel driver was doing at that
> moment. That restriction is gone now, so my code can be adjusted to
> really arbitrary resolutions.

Hi Javier,

First of all, I’m sorry for the mess created with this submission, that was not 
intentional
and we’re doing everything possible for fix it.

Patches we are submitting now already support these 2 features,
and we are going to submit corresponding driver patches as soon as this series 
get accepted.

We also did a few improvements on top of this patches (see RFC pathes I sent a 
few days ago),
that will be submitted as well.

If I understand correctly, at that point you’ll be able to rebase your work
on top of these patches and get the same functionality you have now + 
additional features.

Do you have any problem with this approach?

Thanks,
Dmitry

> 
> 
> 
> Frediano
> ___
> Spice-devel mailing list
> Spice-devel@lists.freedesktop.org 
> https://lists.freedesktop.org/mailman/listinfo/spice-devel 
> 
> 
> 
> ___
> Spice-devel mailing list
> Spice-devel@lists.freedesktop.org 
> https://lists.freedesktop.org/mailman/listinfo/spice-devel 
> 
> 
> 
> 
> -- 
> Respectfully,
> Sameeh Jubran
> Linkedin 
> Junior Software Engineer @ Daynix .

___
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/spice-devel


Re: [Spice-devel] [PATCH win-vdagent] Provide support for Windows CCD API

2016-08-03 Thread Dmitry Fleytman

> On 3 Aug 2016, at 11:45 AM, Christophe Fergeau  wrote:
> 
> On Wed, Aug 03, 2016 at 11:35:56AM +0300, Sameeh Jubran wrote:
>> Hi,
>> 
>> We've already looked into those patches (Javier's patches) and tested them.
> 
> Ah ok, I must have missed your answer to Javier's series.
> 
>> We found that on the contrary to our patches,
>> multi-monitor support and arbitrary resolution do not work with the patches
>> posted by Javier. Even though arbitrary resolution
>> resolution is implemented in Javier's patches, it is not fully arbitrary.
> 
> And full arbitrary resolution would be too complicated to add on top of
> Javier's series, hence the decision to go with an entirely different
> series? Sorry for the basic questions, I'm really not familiar with
> Windows API :)

Hi Christophe,

These series are not entirely different. They are based on the same series 
created by Vadim
and use the same CCD API from Win32. Amendment of Javier’s series will bring us 
to the same patches
we have now.

~Dmitry


> 
> Christophe

___
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/spice-devel


Re: [Spice-devel] [PATCH win-vdagent] Provide support for Windows CCD API

2016-08-03 Thread Dmitry Fleytman

> On 3 Aug 2016, at 11:57 AM, Frediano Ziglio  wrote:
> 
>> 
>> On Wed, Aug 03, 2016 at 11:35:56AM +0300, Sameeh Jubran wrote:
>>> Hi,
>>> 
>>> We've already looked into those patches (Javier's patches) and tested them.
>> 
>> Ah ok, I must have missed your answer to Javier's series.
>> 
>>> We found that on the contrary to our patches,
>>> multi-monitor support and arbitrary resolution do not work with the patches
>>> posted by Javier. Even though arbitrary resolution
>>> resolution is implemented in Javier's patches, it is not fully arbitrary.
>> 
>> And full arbitrary resolution would be too complicated to add on top of
>> Javier's series, hence the decision to go with an entirely different
>> series? Sorry for the basic questions, I'm really not familiar with
>> Windows API :)
>> 
>> Christophe
>> 
> 
> One good thing about Javier's patches, they were small.
> The current patch is too big and should be split.

Please note that both series (this and Javier’s) are based on the same approach,
so they will be of similar size after Javier’s patches amended with missing 
features.

> 
> Frediano

___
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/spice-devel


Re: [Spice-devel] [PATCH win-vdagent] Provide support for Windows CCD API

2016-08-03 Thread Dmitry Fleytman

> On 3 Aug 2016, at 13:38 PM, Sameeh Jubran  wrote:
> 
> 
> 
> On Wed, Aug 3, 2016 at 1:19 PM, Christophe Fergeau  > wrote:
> On Wed, Aug 03, 2016 at 05:25:59AM -0400, Frediano Ziglio wrote:
> >
> > > Can you please further explain regarding the licensing? which license 
> > > should
> > > be used?
> >
> > These defines came from Microsoft headers or from the web like
> > https://msdn.microsoft.com/en-us/library/windows/hardware/ff548113(v=vs.85).aspx
> >  
> > 
> > simply you can't copy from header (which have its license) and/or from web
> > (see 
> > https://www.microsoft.com/en-us/legal/intellectualproperty/copyright/default.aspx
> >  
> > 
> >  )
> >
> > Not sure about the license. Looks like Mingw headers have public domain 
> > licensing.
> > For instance https://searchcode.com/codesearch/raw/11987244/ 
> >  have a Microsoft 
> > disclaimer.
> >
> > Maybe I'm too overcautious
> 
> I don't think you are being too caution, either these definitions have
> an explicit licence compatible with the vdagent-win one, or we should
> not copy them this way. Why do we need to copy these definitions in
> vdagent-win in the first place?
>  
> These definitions and structures are used in the CCD api and provided by 
> windows,
> However they are absent in mingw. What are our options now?
> 
> Please note that we eliminated many of the unnecessary and unused definitions 
> from the ones we
> previously included in our previous patch ( 
> https://lists.freedesktop.org/archives/spice-devel/2016-July/030796.html 
>  ). 
> Moreover
> they are now present in the cpp files.

We dropped most of definitions from Sandy’s series and left only those
we really need, so there are no copy-pasted files anymore, but we cannot avoid
using them at all because they are absent in MinGW.

Christophe, Fredaino, do you have any idea what to do in this case?

> Christophe
> 
> 
> 
> -- 
> Respectfully,
> Sameeh Jubran
> Linkedin 
> Junior Software Engineer @ Daynix .

___
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/spice-devel


[Spice-devel] [RFC PATCH vdagent 09/16] Unify debug options

2016-07-18 Thread Dmitry Fleytman
Signed-off-by: Dmitry Fleytman <dmi...@daynix.com>
---
 vdagent/vdagent.vcxproj | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/vdagent/vdagent.vcxproj b/vdagent/vdagent.vcxproj
index 8ada675..fbd2209 100644
--- a/vdagent/vdagent.vcxproj
+++ b/vdagent/vdagent.vcxproj
@@ -194,7 +194,7 @@
   
   
   Level3
-  EditAndContinue
+  ProgramDatabase
 
 
   
Version.lib;$(SPICE_DEBUG_LIB_LIST);wtsapi32.lib;%(AdditionalDependencies)
-- 
1.8.3.1

___
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/spice-devel


[Spice-devel] [RFC PATCH vdagent 14/16] Adding ioctl operation to update Vdagent state

2016-07-18 Thread Dmitry Fleytman
From: Sameeh Jubran <sam...@daynix.com>

This patch adds new ioctl operation to Vdagent in order to update
the driver on Vdagent state. This allows the driver to know
when Vdagent is running and when it is off.

Signed-off-by: Sameeh Jubran <sam...@daynix.com>
Signed-off-by: Dmitry Fleytman <dmi...@daynix.com>
---
 vdagent/desktop_layout.cpp| 21 +
 vdagent/desktop_layout.h  |  1 +
 vdagent/display_configuration.cpp | 15 +++
 vdagent/display_configuration.h   |  2 ++
 4 files changed, 39 insertions(+)

diff --git a/vdagent/desktop_layout.cpp b/vdagent/desktop_layout.cpp
index 7aff7e7..a8d9e2d 100644
--- a/vdagent/desktop_layout.cpp
+++ b/vdagent/desktop_layout.cpp
@@ -44,6 +44,7 @@ DesktopLayout::DesktopLayout()
 
 DesktopLayout::~DesktopLayout()
 {
+set_vdagent_running_for_displays(false);
 clean_displays();
 if (_display_config){
 delete _display_config;
@@ -122,6 +123,8 @@ void DesktopLayout::set_displays()
 DWORD display_id = 0;
 int dev_sets = 0;
 
+set_vdagent_running_for_displays(true);
+
 lock();
 if (!consistent_displays()) {
 unlock();
@@ -276,6 +279,22 @@ bool DesktopLayout::get_qxl_device_id(WCHAR* device_key, 
DWORD* device_id)
 return key_found;
 }
 
+void DesktopLayout::set_vdagent_running_for_displays(bool running)
+{
+DISPLAY_DEVICE dev_info;
+DWORD dev_id = 0;
+lock();
+ZeroMemory(_info, sizeof(dev_info));
+dev_info.cb = sizeof(dev_info);
+while (EnumDisplayDevices(NULL, dev_id, _info, 0)) {
+dev_id++;
+if (!(dev_info.StateFlags & DISPLAY_DEVICE_MIRRORING_DRIVER) && 
wcsstr(dev_info.DeviceString, L"QXL")) {
+_display_config->set_vdagent_running(dev_info.DeviceName, running);
+}
+}
+unlock();
+}
+
 bool DesktopLayout::init_dev_mode(LPCTSTR dev_name, DEVMODE* dev_mode, 
DisplayMode* mode)
 {
 ZeroMemory(dev_mode, sizeof(DEVMODE));
@@ -299,6 +318,8 @@ bool DesktopLayout::init_dev_mode(LPCTSTR dev_name, 
DEVMODE* dev_mode, DisplayMo
 // update current DisplayMode (so mouse scaling works properly)
 mode->_width = dev_mode->dmPelsWidth;
 mode->_height = dev_mode->dmPelsHeight;
+
+set_vdagent_running_for_displays(true);
 return true;
 
 }
diff --git a/vdagent/desktop_layout.h b/vdagent/desktop_layout.h
index fd6af76..da5a40b 100644
--- a/vdagent/desktop_layout.h
+++ b/vdagent/desktop_layout.h
@@ -83,6 +83,7 @@ private:
 static bool consistent_displays();
 static bool is_attached(LPCTSTR dev_name);
 static bool get_qxl_device_id(WCHAR* device_key, DWORD* device_id);
+void set_vdagent_running_for_displays(bool enable_pointer);
 private:
 mutex_t _mutex;
 Displays _displays;
diff --git a/vdagent/display_configuration.cpp 
b/vdagent/display_configuration.cpp
index f20605a..95fd4c3 100644
--- a/vdagent/display_configuration.cpp
+++ b/vdagent/display_configuration.cpp
@@ -67,6 +67,15 @@ typedef struct WDDM_MONITOR_CONFIG_ESCAPE {
 int _ioctl;
 QXLHead _head;
 } WDDM_MONITOR_CONFIG_ESCAPE;
+typedef struct WDDM_VDAGENT_RUNNING_ESCAPE{
+WDDM_VDAGENT_RUNNING_ESCAPE(bool running)
+{
+_ioctl = QXL_ESCAPE_VDAGENT_RUNNING;
+_vdagent_state.running = running;
+}
+int_ioctl;
+QXLEscapeVDAgentRunning_vdagent_state;
+} WDDM_VDAGENT_RUNNING_ESCAPE;
 #endif
 DisplayConfig* DisplayConfig::create_config() 
 {
@@ -529,6 +538,12 @@ bool WDDMInterface::escape(LPCTSTR device_name, void* 
data, UINT size_data)
 return NT_SUCCESS(status);
 }
 
+bool WDDMInterface::set_vdagent_running(LPCTSTR device_name, bool running)
+{
+WDDM_VDAGENT_RUNNING_ESCAPE wddm_escape(running);
+return escape(device_name, _escape, sizeof(wddm_escape));
+}
+
 CCD::CCD()
 :_NumPathElements(0)
 ,_NumModeElements(0)
diff --git a/vdagent/display_configuration.h b/vdagent/display_configuration.h
index eeba1c2..06f592a 100644
--- a/vdagent/display_configuration.h
+++ b/vdagent/display_configuration.h
@@ -132,6 +132,7 @@ public:
 DRIVER_TYPE type() { return _driver_type; };
 void set_monitors_config(bool flag) { _send_monitors_config = flag; }
 virtual void update_config_path() {};
+virtual bool set_vdagent_running(LPCTSTR device_name, bool running) { 
return false; };
 
 protected:
 DRIVER_TYPE _driver_type;
@@ -176,6 +177,7 @@ private:
 
 void close_adapter(D3DKMT_HANDLE handle);
 bool escape(LPCTSTR device_name, void* data, UINT sizeData);
+bool set_vdagent_running(LPCTSTR device_name, bool running);
 
 private:
 //GDI Function pointers
-- 
1.8.3.1

___
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/spice-devel


[Spice-devel] [RFC PATCH vdagent 12/16] Unify build output directories

2016-07-18 Thread Dmitry Fleytman
Signed-off-by: Dmitry Fleytman <dmi...@daynix.com>
---
 vdagent.sln | 42 +-
 vdagent/vdagent.vcxproj | 55 ++--
 vdservice/vdservice.vcxproj | 56 ++---
 3 files changed, 77 insertions(+), 76 deletions(-)

diff --git a/vdagent.sln b/vdagent.sln
index 38a728d..2346d1a 100644
--- a/vdagent.sln
+++ b/vdagent.sln
@@ -1,7 +1,7 @@
 
 Microsoft Visual Studio Solution File, Format Version 12.00
 # Visual Studio 14
-VisualStudioVersion = 14.0.24720.0
+VisualStudioVersion = 14.0.25123.0
 MinimumVisualStudioVersion = 10.0.40219.1
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vdagent", 
"vdagent\vdagent.vcxproj", "{CAD5A7E6-E9F5-4071-AFDA-25F76FDA5442}"
 EndProject
@@ -13,10 +13,10 @@ Global
Debug|x64 = Debug|x64
Release|Win32 = Release|Win32
Release|x64 = Release|x64
-   Win10 Debug|Win32 = Win10 Debug|Win32
-   Win10 Debug|x64 = Win10 Debug|x64
-   Win10 Release|Win32 = Win10 Release|Win32
-   Win10 Release|x64 = Win10 Release|x64
+   Win10_Debug|Win32 = Win10_Debug|Win32
+   Win10_Debug|x64 = Win10_Debug|x64
+   Win10_Release|Win32 = Win10_Release|Win32
+   Win10_Release|x64 = Win10_Release|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{CAD5A7E6-E9F5-4071-AFDA-25F76FDA5442}.Debug|Win32.ActiveCfg = 
Debug|Win32
@@ -27,14 +27,14 @@ Global
{CAD5A7E6-E9F5-4071-AFDA-25F76FDA5442}.Release|Win32.Build.0 = 
Release|Win32
{CAD5A7E6-E9F5-4071-AFDA-25F76FDA5442}.Release|x64.ActiveCfg = 
Release|x64
{CAD5A7E6-E9F5-4071-AFDA-25F76FDA5442}.Release|x64.Build.0 = 
Release|x64
-   {CAD5A7E6-E9F5-4071-AFDA-25F76FDA5442}.Win10 
Debug|Win32.ActiveCfg = Win10 Debug|Win32
-   {CAD5A7E6-E9F5-4071-AFDA-25F76FDA5442}.Win10 
Debug|Win32.Build.0 = Win10 Debug|Win32
-   {CAD5A7E6-E9F5-4071-AFDA-25F76FDA5442}.Win10 
Debug|x64.ActiveCfg = Win10 Debug|x64
-   {CAD5A7E6-E9F5-4071-AFDA-25F76FDA5442}.Win10 Debug|x64.Build.0 
= Win10 Debug|x64
-   {CAD5A7E6-E9F5-4071-AFDA-25F76FDA5442}.Win10 
Release|Win32.ActiveCfg = Win10 Release|Win32
-   {CAD5A7E6-E9F5-4071-AFDA-25F76FDA5442}.Win10 
Release|Win32.Build.0 = Win10 Release|Win32
-   {CAD5A7E6-E9F5-4071-AFDA-25F76FDA5442}.Win10 
Release|x64.ActiveCfg = Win10 Release|x64
-   {CAD5A7E6-E9F5-4071-AFDA-25F76FDA5442}.Win10 
Release|x64.Build.0 = Win10 Release|x64
+   
{CAD5A7E6-E9F5-4071-AFDA-25F76FDA5442}.Win10_Debug|Win32.ActiveCfg = 
Win10_Debug|Win32
+   
{CAD5A7E6-E9F5-4071-AFDA-25F76FDA5442}.Win10_Debug|Win32.Build.0 = 
Win10_Debug|Win32
+   
{CAD5A7E6-E9F5-4071-AFDA-25F76FDA5442}.Win10_Debug|x64.ActiveCfg = 
Win10_Debug|x64
+   {CAD5A7E6-E9F5-4071-AFDA-25F76FDA5442}.Win10_Debug|x64.Build.0 
= Win10_Debug|x64
+   
{CAD5A7E6-E9F5-4071-AFDA-25F76FDA5442}.Win10_Release|Win32.ActiveCfg = 
Win10_Release|Win32
+   
{CAD5A7E6-E9F5-4071-AFDA-25F76FDA5442}.Win10_Release|Win32.Build.0 = 
Win10_Release|Win32
+   
{CAD5A7E6-E9F5-4071-AFDA-25F76FDA5442}.Win10_Release|x64.ActiveCfg = 
Win10_Release|x64
+   
{CAD5A7E6-E9F5-4071-AFDA-25F76FDA5442}.Win10_Release|x64.Build.0 = 
Win10_Release|x64
{ADFE5E22-31D0-4343-AE9E-8102CC0051F9}.Debug|Win32.ActiveCfg = 
Debug|Win32
{ADFE5E22-31D0-4343-AE9E-8102CC0051F9}.Debug|Win32.Build.0 = 
Debug|Win32
{ADFE5E22-31D0-4343-AE9E-8102CC0051F9}.Debug|x64.ActiveCfg = 
Debug|x64
@@ -43,14 +43,14 @@ Global
{ADFE5E22-31D0-4343-AE9E-8102CC0051F9}.Release|Win32.Build.0 = 
Release|Win32
{ADFE5E22-31D0-4343-AE9E-8102CC0051F9}.Release|x64.ActiveCfg = 
Release|x64
{ADFE5E22-31D0-4343-AE9E-8102CC0051F9}.Release|x64.Build.0 = 
Release|x64
-   {ADFE5E22-31D0-4343-AE9E-8102CC0051F9}.Win10 
Debug|Win32.ActiveCfg = Win10 Debug|Win32
-   {ADFE5E22-31D0-4343-AE9E-8102CC0051F9}.Win10 
Debug|Win32.Build.0 = Win10 Debug|Win32
-   {ADFE5E22-31D0-4343-AE9E-8102CC0051F9}.Win10 
Debug|x64.ActiveCfg = Debug|x64
-   {ADFE5E22-31D0-4343-AE9E-8102CC0051F9}.Win10 Debug|x64.Build.0 
= Debug|x64
-   {ADFE5E22-31D0-4343-AE9E-8102CC0051F9}.Win10 
Release|Win32.ActiveCfg = Win10 Release|Win32
-   {ADFE5E22-31D0-4343-AE9E-8102CC0051F9}.Win10 
Release|Win32.Build.0 = Win10 Release|Win32
-   {ADFE5E22-31D0-4343-AE9E-8102CC0051F9}.Win10 
Release|x64.ActiveCfg = Release|x64
-   {ADFE5E22-31D0-4343-AE9E-8102CC0051F9}.Win10 
Release|x64.Build.0 = Release|x64
+   
{ADFE5E22-31D0-4343-

[Spice-devel] [RFC PATCH vdagent 11/16] Unify projects configurations

2016-07-18 Thread Dmitry Fleytman
Signed-off-by: Dmitry Fleytman <dmi...@daynix.com>
---
 vdagent.sln |  10 +--
 vdservice/vdservice.vcxproj | 170 
 2 files changed, 175 insertions(+), 5 deletions(-)

diff --git a/vdagent.sln b/vdagent.sln
index 1c29664..38a728d 100644
--- a/vdagent.sln
+++ b/vdagent.sln
@@ -1,7 +1,7 @@
 
 Microsoft Visual Studio Solution File, Format Version 12.00
 # Visual Studio 14
-VisualStudioVersion = 14.0.23107.0
+VisualStudioVersion = 14.0.24720.0
 MinimumVisualStudioVersion = 10.0.40219.1
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vdagent", 
"vdagent\vdagent.vcxproj", "{CAD5A7E6-E9F5-4071-AFDA-25F76FDA5442}"
 EndProject
@@ -43,12 +43,12 @@ Global
{ADFE5E22-31D0-4343-AE9E-8102CC0051F9}.Release|Win32.Build.0 = 
Release|Win32
{ADFE5E22-31D0-4343-AE9E-8102CC0051F9}.Release|x64.ActiveCfg = 
Release|x64
{ADFE5E22-31D0-4343-AE9E-8102CC0051F9}.Release|x64.Build.0 = 
Release|x64
-   {ADFE5E22-31D0-4343-AE9E-8102CC0051F9}.Win10 
Debug|Win32.ActiveCfg = Debug|Win32
-   {ADFE5E22-31D0-4343-AE9E-8102CC0051F9}.Win10 
Debug|Win32.Build.0 = Debug|Win32
+   {ADFE5E22-31D0-4343-AE9E-8102CC0051F9}.Win10 
Debug|Win32.ActiveCfg = Win10 Debug|Win32
+   {ADFE5E22-31D0-4343-AE9E-8102CC0051F9}.Win10 
Debug|Win32.Build.0 = Win10 Debug|Win32
{ADFE5E22-31D0-4343-AE9E-8102CC0051F9}.Win10 
Debug|x64.ActiveCfg = Debug|x64
{ADFE5E22-31D0-4343-AE9E-8102CC0051F9}.Win10 Debug|x64.Build.0 
= Debug|x64
-   {ADFE5E22-31D0-4343-AE9E-8102CC0051F9}.Win10 
Release|Win32.ActiveCfg = Release|Win32
-   {ADFE5E22-31D0-4343-AE9E-8102CC0051F9}.Win10 
Release|Win32.Build.0 = Release|Win32
+   {ADFE5E22-31D0-4343-AE9E-8102CC0051F9}.Win10 
Release|Win32.ActiveCfg = Win10 Release|Win32
+   {ADFE5E22-31D0-4343-AE9E-8102CC0051F9}.Win10 
Release|Win32.Build.0 = Win10 Release|Win32
{ADFE5E22-31D0-4343-AE9E-8102CC0051F9}.Win10 
Release|x64.ActiveCfg = Release|x64
{ADFE5E22-31D0-4343-AE9E-8102CC0051F9}.Win10 
Release|x64.Build.0 = Release|x64
EndGlobalSection
diff --git a/vdservice/vdservice.vcxproj b/vdservice/vdservice.vcxproj
index 7cf2628..9b54f95 100644
--- a/vdservice/vdservice.vcxproj
+++ b/vdservice/vdservice.vcxproj
@@ -17,6 +17,22 @@
   Release
   x64
 
+
+  Win10 Debug
+  Win32
+
+
+  Win10 Debug
+  x64
+
+
+  Win10 Release
+  Win32
+
+
+  Win10 Release
+  x64
+
   
   
 {ADFE5E22-31D0-4343-AE9E-8102CC0051F9}
@@ -31,22 +47,44 @@
 Unicode
 true
   
+  
+Application
+v140
+Unicode
+true
+  
   
 Application
 v140
 Unicode
   
+  
+Application
+v140
+Unicode
+  
   
 Application
 v140
 Unicode
 true
   
+  
+Application
+v140
+Unicode
+true
+  
   
 Application
 v140
 Unicode
   
+  
+Application
+v140
+Unicode
+  
   
   
   
@@ -54,18 +92,34 @@
 
 
   
+  
+
+
+  
   
 
 
   
+  
+
+
+  
   
 
 
   
+  
+
+
+  
   
 
 
   
+  
+
+
+  
   
   
 <_ProjectFileVersion>14.0.23107.0
@@ -75,21 +129,41 @@
 $(Configuration)\
 true
   
+  
+$(SolutionDir)$(Configuration)\
+$(Configuration)\
+true
+  
   
 $(SolutionDir)$(Platform)\$(Configuration)\
 $(Platform)\$(Configuration)\
 true
   
+  
+$(SolutionDir)$(Platform)\$(Configuration)\
+$(Platform)\$(Configuration)\
+true
+  
   
 $(SolutionDir)$(Configuration)\
 $(Configuration)\
 false
   
+  
+$(SolutionDir)$(Configuration)\
+$(Configuration)\
+false
+  
   
 $(SolutionDir)$(Platform)\$(Configuration)\
 $(Platform)\$(Configuration)\
 false
   
+  
+$(SolutionDir)$(Platform)\$(Configuration)\
+$(Platform)\$(Configuration)\
+false
+  
   
 
   Disabled
@@ -111,6 +185,29 @@
   MachineX86
 
   
+  
+
+  Disabled
+  
..\common;..\spice-protocol\;%(AdditionalIncludeDirectories)
+  
WIN32;_DEBUG;_CONSOLE;_WIN32_WINNT=0x0501;%(PreprocessorDefinitions)
+  true
+  EnableFastChecks
+  MultiThreadedDebug
+  
+  
+  Level3
+  EditAndContinue
+
+
+  
WtsApi32.lib;Userenv.lib;Version.lib;%(AdditionalDependencies)
+  true
+  Console
+  false
+  
+  
+  MachineX86
+
+  
   
 
   X64
@@ -135,6 +232,32 @@
   MachineX64
 
   
+  
+
+  X64
+
+
+  Disabled
+  
..\common;..\spice-protocol\;%(AdditionalIncludeDirectories)
+  
WIN32;_DEBUG;_CONSOLE;_WIN32_WINNT=0x0501;%(PreprocessorDefinitions)
+  true
+  EnableFastChecks
+  MultiThreadedDebug
+  
+  
+  Level3
+  ProgramDatabase
+   

[Spice-devel] [RFC PATCH vdagent 01/16] Fix 'Run-Time Check Failure #2' when running a 64bit guest

2016-07-18 Thread Dmitry Fleytman
From: Sandy Stutsman 

---
 vdagent/display_setting.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/vdagent/display_setting.cpp b/vdagent/display_setting.cpp
index 1ec7397..f5eb0d7 100644
--- a/vdagent/display_setting.cpp
+++ b/vdagent/display_setting.cpp
@@ -306,7 +306,7 @@ bool DisplaySetting::reload_wallpaper(HKEY desktop_reg_key)
 wallpaper_path[value_size] = '\0';
 }
 
-if (SystemParametersInfo(SPI_GETDESKWALLPAPER, sizeof(cur_wallpaper), 
cur_wallpaper, 0)) {
+if (SystemParametersInfo(SPI_GETDESKWALLPAPER, MAX_PATH, cur_wallpaper, 
0)) {
 if (_tcscmp(cur_wallpaper, TEXT("")) != 0) {
 vd_printf("wallpaper wasn't disabled");
 return true;
-- 
1.8.3.1

___
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/spice-devel


[Spice-devel] [RFC PATCH vdagent 15/16] Replacing tabs with spaces

2016-07-18 Thread Dmitry Fleytman
From: Sameeh Jubran <sam...@daynix.com>

Signed-off-by: Sameeh Jubran <sam...@daynix.com>
Signed-off-by: Dmitry Fleytman <dmi...@daynix.com>
---
 vdagent/CCD.h | 182 +++---
 vdagent/display_configuration.cpp |   2 +-
 vdagent/display_configuration.h   |   2 +-
 3 files changed, 93 insertions(+), 93 deletions(-)

diff --git a/vdagent/CCD.h b/vdagent/CCD.h
index a457fc1..7b071ee 100644
--- a/vdagent/CCD.h
+++ b/vdagent/CCD.h
@@ -68,103 +68,103 @@ typedef enum {
 
 
 typedef enum {
-   DISPLAYCONFIG_OUTPUT_TECHNOLOGY_OTHER= -1,
-   DISPLAYCONFIG_OUTPUT_TECHNOLOGY_HD15 = 0,
-   DISPLAYCONFIG_OUTPUT_TECHNOLOGY_SVIDEO   = 1,
-   DISPLAYCONFIG_OUTPUT_TECHNOLOGY_COMPOSITE_VIDEO  = 2,
-   DISPLAYCONFIG_OUTPUT_TECHNOLOGY_COMPONENT_VIDEO  = 3,
-   DISPLAYCONFIG_OUTPUT_TECHNOLOGY_DVI  = 4,
-   DISPLAYCONFIG_OUTPUT_TECHNOLOGY_HDMI = 5,
-   DISPLAYCONFIG_OUTPUT_TECHNOLOGY_LVDS = 6,
-   DISPLAYCONFIG_OUTPUT_TECHNOLOGY_D_JPN= 8,
-   DISPLAYCONFIG_OUTPUT_TECHNOLOGY_SDI  = 9,
-   DISPLAYCONFIG_OUTPUT_TECHNOLOGY_DISPLAYPORT_EXTERNAL = 10,
-   DISPLAYCONFIG_OUTPUT_TECHNOLOGY_DISPLAYPORT_EMBEDDED = 11,
-   DISPLAYCONFIG_OUTPUT_TECHNOLOGY_UDI_EXTERNAL = 12,
-   DISPLAYCONFIG_OUTPUT_TECHNOLOGY_UDI_EMBEDDED = 13,
-   DISPLAYCONFIG_OUTPUT_TECHNOLOGY_SDTVDONGLE   = 14,
-   DISPLAYCONFIG_OUTPUT_TECHNOLOGY_MIRACAST = 15,
-   DISPLAYCONFIG_OUTPUT_TECHNOLOGY_INTERNAL = 0x8000,
-   DISPLAYCONFIG_OUTPUT_TECHNOLOGY_FORCE_UINT32 = 0x
+DISPLAYCONFIG_OUTPUT_TECHNOLOGY_OTHER= -1,
+DISPLAYCONFIG_OUTPUT_TECHNOLOGY_HD15 = 0,
+DISPLAYCONFIG_OUTPUT_TECHNOLOGY_SVIDEO   = 1,
+DISPLAYCONFIG_OUTPUT_TECHNOLOGY_COMPOSITE_VIDEO  = 2,
+DISPLAYCONFIG_OUTPUT_TECHNOLOGY_COMPONENT_VIDEO  = 3,
+DISPLAYCONFIG_OUTPUT_TECHNOLOGY_DVI  = 4,
+DISPLAYCONFIG_OUTPUT_TECHNOLOGY_HDMI = 5,
+DISPLAYCONFIG_OUTPUT_TECHNOLOGY_LVDS = 6,
+DISPLAYCONFIG_OUTPUT_TECHNOLOGY_D_JPN= 8,
+DISPLAYCONFIG_OUTPUT_TECHNOLOGY_SDI  = 9,
+DISPLAYCONFIG_OUTPUT_TECHNOLOGY_DISPLAYPORT_EXTERNAL = 10,
+DISPLAYCONFIG_OUTPUT_TECHNOLOGY_DISPLAYPORT_EMBEDDED = 11,
+DISPLAYCONFIG_OUTPUT_TECHNOLOGY_UDI_EXTERNAL = 12,
+DISPLAYCONFIG_OUTPUT_TECHNOLOGY_UDI_EMBEDDED = 13,
+DISPLAYCONFIG_OUTPUT_TECHNOLOGY_SDTVDONGLE   = 14,
+DISPLAYCONFIG_OUTPUT_TECHNOLOGY_MIRACAST = 15,
+DISPLAYCONFIG_OUTPUT_TECHNOLOGY_INTERNAL = 0x8000,
+DISPLAYCONFIG_OUTPUT_TECHNOLOGY_FORCE_UINT32 = 0x
 } DISPLAYCONFIG_VIDEO_OUTPUT_TECHNOLOGY;
 
 
 typedef enum {
-   DISPLAYCONFIG_ROTATION_IDENTITY = 1,
-   DISPLAYCONFIG_ROTATION_ROTATE90 = 2,
-   DISPLAYCONFIG_ROTATION_ROTATE180= 3,
-   DISPLAYCONFIG_ROTATION_ROTATE270= 4,
-   DISPLAYCONFIG_ROTATION_FORCE_UINT32 = 0x
+DISPLAYCONFIG_ROTATION_IDENTITY = 1,
+DISPLAYCONFIG_ROTATION_ROTATE90 = 2,
+DISPLAYCONFIG_ROTATION_ROTATE180= 3,
+DISPLAYCONFIG_ROTATION_ROTATE270= 4,
+DISPLAYCONFIG_ROTATION_FORCE_UINT32 = 0x
 } DISPLAYCONFIG_ROTATION;
 
 typedef enum {
-   DISPLAYCONFIG_SCANLINE_ORDERING_UNSPECIFIED= 0,
-   DISPLAYCONFIG_SCANLINE_ORDERING_PROGRESSIVE= 1,
-   DISPLAYCONFIG_SCANLINE_ORDERING_INTERLACED = 2,
-   DISPLAYCONFIG_SCANLINE_ORDERING_INTERLACED_UPPERFIELDFIRST = 
DISPLAYCONFIG_SCANLINE_ORDERING_INTERLACED,
-   DISPLAYCONFIG_SCANLINE_ORDERING_INTERLACED_LOWERFIELDFIRST = 3,
-   DISPLAYCONFIG_SCANLINE_ORDERING_FORCE_UINT32   = 0x
+DISPLAYCONFIG_SCANLINE_ORDERING_UNSPECIFIED= 0,
+DISPLAYCONFIG_SCANLINE_ORDERING_PROGRESSIVE= 1,
+DISPLAYCONFIG_SCANLINE_ORDERING_INTERLACED = 2,
+DISPLAYCONFIG_SCANLINE_ORDERING_INTERLACED_UPPERFIELDFIRST = 
DISPLAYCONFIG_SCANLINE_ORDERING_INTERLACED,
+DISPLAYCONFIG_SCANLINE_ORDERING_INTERLACED_LOWERFIELDFIRST = 3,
+DISPLAYCONFIG_SCANLINE_ORDERING_FORCE_UINT32   = 0x
 } DISPLAYCONFIG_SCANLINE_ORDERING;
 
 
 typedef enum {
-   DISPLAYCONFIG_SCALING_IDENTITY   = 1,
-   DISPLAYCONFIG_SCALING_CENTERED   = 2,
-   DISPLAYCONFIG_SCALING_STRETCHED  = 3,
-   DISPLAYCONFIG_SCALING_ASPECTRATIOCENTEREDMAX = 4,
-   DISPLAYCONFIG_SCALING_CUSTOM = 5,
-   DISPLAYCONFIG_SCALING_PREFERRED  = 128,
-   DISPLAYCONFIG_SCALING_FORCE_UINT32   = 0x
+DISPLAYCONFIG_SCALING_IDENTITY

[Spice-devel] [RFC PATCH qxl-wddm-dod 27/28] Fix source buffer mapping in PresentDisplayOnly

2016-07-18 Thread Dmitry Fleytman
From: Sameeh Jubran <sam...@daynix.com>

Part of source image mapped by PresentDisplayOnly
should be big enough to cover all rectangles being
transferred.

Signed-off-by: Sameeh Jubran <sam...@daynix.com>
Signed-off-by: Dmitry Fleytman <dmi...@daynix.com>
---
 qxldod/QxlDod.cpp | 28 +++-
 qxldod/QxlDod.h   |  1 +
 2 files changed, 24 insertions(+), 5 deletions(-)

diff --git a/qxldod/QxlDod.cpp b/qxldod/QxlDod.cpp
index 7b3d353..0ec00fe 100755
--- a/qxldod/QxlDod.cpp
+++ b/qxldod/QxlDod.cpp
@@ -3642,12 +3642,11 @@ QxlDevice::ExecutePresentDisplayOnly(
 ctx->Mdl  = NULL;
 ctx->DisplaySource= this;
 
-// Alternate between synch and asynch execution, for demonstrating 
-// that a real hardware implementation can do either
-
+// Source bitmap is in user mode, must be locked under __try/__except
+// and mapped to kernel space before use.
 {
-// Map Source into kernel space, as Blt will be executed by system 
worker thread
-UINT sizeToMap = ctx->SrcPitch * ctx->SrcHeight;
+LONG maxHeight = GetMaxSourceMappingHeight(ctx->Moves, ctx->NumMoves, 
ctx->DirtyRect, ctx->NumDirtyRects);
+UINT sizeToMap = ctx->SrcPitch * maxHeight;
 
 PMDL mdl = IoAllocateMdl((PVOID)SrcAddr, sizeToMap,  FALSE, FALSE, 
NULL);
 if(!mdl)
@@ -4527,6 +4526,25 @@ void 
QxlDevice::SaveVDAgentState(QXLEscapeVDAgentRunning* vdagent_running)
 m_VDAgentRunning = (vdagent_running->running == 0) ? FALSE : TRUE;
 }
 
+LONG QxlDevice::GetMaxSourceMappingHeight(D3DKMT_MOVE_RECT* Moves, ULONG 
NumMoves, RECT* DirtyRects, ULONG NumDirtyRects)
+{
+LONG maxHeight = 0;
+if (Moves != NULL) {
+for (UINT i = 0; i < NumMoves; i++) {
+POINT*   pSourcePoint = [i].SourcePoint;
+RECT*pDestRect = [i].DestRect;
+maxHeight = MAX(maxHeight, pDestRect->bottom - pDestRect->top + 
pSourcePoint->y);
+}
+}
+if (DirtyRects != NULL) {
+for (UINT i = 0; i < NumDirtyRects; i++) {
+RECT*pDirtyRect = [i];
+maxHeight = MAX(maxHeight, pDirtyRect->bottom);
+}
+}
+return maxHeight;
+}
+
 NTSTATUS QxlDevice::Escape(_In_ CONST DXGKARG_ESCAPE* pEscape)
 {
 PAGED_CODE();
diff --git a/qxldod/QxlDod.h b/qxldod/QxlDod.h
index 41189b3..0757648 100755
--- a/qxldod/QxlDod.h
+++ b/qxldod/QxlDod.h
@@ -553,6 +553,7 @@ private:
 NTSTATUS SetCustomDisplay(QXLEscapeSetCustomDisplay* custom_display);
 void SetMonitorConfig(QXLHead* monitor_config);
 void SaveVDAgentState(QXLEscapeVDAgentRunning* vdagent_running);
+LONG static GetMaxSourceMappingHeight(D3DKMT_MOVE_RECT* Moves, ULONG 
NumMoves, RECT* DirtyRects, ULONG NumDirtyRects);
 
 private:
 BOOLEAN m_VDAgentRunning;
-- 
1.8.3.1

___
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/spice-devel


[Spice-devel] [RFC PATCH spice-protocol 1/1] Adding new ioctl for updating Vdagent state

2016-07-18 Thread Dmitry Fleytman
From: Sameeh Jubran 

New ioctl for updating the driver with vdagent running state.

Signed-off-by: Sameeh Jubran 
---
 spice/qxl_windows.h | 6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/spice/qxl_windows.h b/spice/qxl_windows.h
index bc2ceff..92715d5 100644
--- a/spice/qxl_windows.h
+++ b/spice/qxl_windows.h
@@ -7,7 +7,8 @@
 
 enum {
 QXL_ESCAPE_SET_CUSTOM_DISPLAY = 0x10001,
-QXL_ESCAPE_MONITOR_CONFIG
+QXL_ESCAPE_MONITOR_CONFIG,
+QXL_ESCAPE_VDAGENT_RUNNING
 };
 
 typedef struct SPICE_ATTR_PACKED QXLEscapeSetCustomDisplay {
@@ -16,6 +17,9 @@ typedef struct SPICE_ATTR_PACKED QXLEscapeSetCustomDisplay {
 uint32_t bpp;
 } QXLEscapeSetCustomDisplay;
 
+typedef struct QXLEscapeVDAgentRunning {
+uint32_t running;
+} QXLEscapeVDAgentRunning;
 #include 
 
 #endif /* _H_QXL_WINDOWS */
-- 
1.8.3.1

___
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/spice-devel


[Spice-devel] [RFC PATCH vdagent 13/16] VDAgent: Fixing primary display detachment issue

2016-07-18 Thread Dmitry Fleytman
From: Sameeh Jubran <sam...@daynix.com>

After detaching the primary display (when multi monitors are connected)
the detached monitor fails to reattach which leads to other issues with
arbitrary resolution of attached monitors.

The problem is when Vdagent marks the detached monitor as active, it
dosen't apply the changes and thus the monitor fails to attach. This
patch fixes the issue by applying the changes after marking the monitor
as active.

Signed-off-by: Sameeh Jubran <sam...@daynix.com>
Signed-off-by: Dmitry Fleytman <dmi...@daynix.com>
---
 vdagent/display_configuration.cpp | 1 +
 1 file changed, 1 insertion(+)

diff --git a/vdagent/display_configuration.cpp 
b/vdagent/display_configuration.cpp
index 19641e9..f20605a 100644
--- a/vdagent/display_configuration.cpp
+++ b/vdagent/display_configuration.cpp
@@ -865,6 +865,7 @@ bool CCD::set_path_state(LPCTSTR device_name, MONITOR_STATE 
new_state)
 }
 else {
 path->flags = path->flags | DISPLAYCONFIG_PATH_ACTIVE;
+set_display_config();
 }
 return true;
 }
-- 
1.8.3.1

___
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/spice-devel


[Spice-devel] [RFC PATCH vdagent 02/16] Provide support for Windows 10 CCD API

2016-07-18 Thread Dmitry Fleytman
From: Sandy Stutsman 

---
 Spice.props   |  38 ++
 vdagent.sln   |  94 ++--
 vdagent/CCD.h | 259 +++
 vdagent/D3Dkmt.h  | 134 ++
 vdagent/desktop_layout.cpp| 152 ++-
 vdagent/desktop_layout.h  |   9 +-
 vdagent/display_configuration.cpp | 889 ++
 vdagent/display_configuration.h   | 192 
 vdagent/vdagent.vcxproj   | 380 
 vdservice/vdservice.vcxproj   | 197 +
 10 files changed, 2185 insertions(+), 159 deletions(-)
 create mode 100644 Spice.props
 create mode 100644 vdagent/CCD.h
 create mode 100644 vdagent/D3Dkmt.h
 create mode 100644 vdagent/display_configuration.cpp
 create mode 100644 vdagent/display_configuration.h
 create mode 100644 vdagent/vdagent.vcxproj
 create mode 100644 vdservice/vdservice.vcxproj

diff --git a/Spice.props b/Spice.props
new file mode 100644
index 000..217bfc7
--- /dev/null
+++ b/Spice.props
@@ -0,0 +1,38 @@
+
+http://schemas.microsoft.com/developer/msbuild/2003;>
+  
+  
+D:\SANDBOX\Master\spice-protocol
+D:\Sandbox\WSpice\
+
cximage.lib;jasper.lib;jbig.lib;jpeg.lib;libdcr.lib;mng.lib;png.lib;tiff.lib;zlib.lib
+
cximage.lib;jasper.lib;jbig.lib;jpeg.lib;libdcr.lib;mng.lib;png.lib;tiff.lib;zlib.lib
+$(SPICE_LIBS)\$(Platform)\Release
+
$(SPICE_LIBS)\$(Platform)\Debug
+  
+  
+  
+  
+
+  $(SPICE_PROTOCOL_DIR)
+  true
+
+
+  $(SPICE_LIBS)
+  true
+
+
+  $(SPICE_LIB_LIST)
+  true
+
+
+  $(SPICE_DEBUG_LIB_LIST)
+  true
+
+
+  $(SPICE_LIBS_DIR)
+
+
+  $(SPICE_DEBUG_LIBS_DIR)
+
+  
+
\ No newline at end of file
diff --git a/vdagent.sln b/vdagent.sln
index 2622f2e..1c29664 100644
--- a/vdagent.sln
+++ b/vdagent.sln
@@ -1,36 +1,58 @@
-
-Microsoft Visual Studio Solution File, Format Version 10.00
-# Visual Studio 2008
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vdagent", 
"vdagent\vdagent.vcproj", "{CAD5A7E6-E9F5-4071-AFDA-25F76FDA5442}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vdservice", 
"vdservice\vdservice.vcproj", "{ADFE5E22-31D0-4343-AE9E-8102CC0051F9}"
-EndProject
-Global
-   GlobalSection(SolutionConfigurationPlatforms) = preSolution
-   Debug|Win32 = Debug|Win32
-   Debug|x64 = Debug|x64
-   Release|Win32 = Release|Win32
-   Release|x64 = Release|x64
-   EndGlobalSection
-   GlobalSection(ProjectConfigurationPlatforms) = postSolution
-   {CAD5A7E6-E9F5-4071-AFDA-25F76FDA5442}.Debug|Win32.ActiveCfg = 
Debug|Win32
-   {CAD5A7E6-E9F5-4071-AFDA-25F76FDA5442}.Debug|Win32.Build.0 = 
Debug|Win32
-   {CAD5A7E6-E9F5-4071-AFDA-25F76FDA5442}.Debug|x64.ActiveCfg = 
Debug|x64
-   {CAD5A7E6-E9F5-4071-AFDA-25F76FDA5442}.Debug|x64.Build.0 = 
Debug|x64
-   {CAD5A7E6-E9F5-4071-AFDA-25F76FDA5442}.Release|Win32.ActiveCfg 
= Release|Win32
-   {CAD5A7E6-E9F5-4071-AFDA-25F76FDA5442}.Release|Win32.Build.0 = 
Release|Win32
-   {CAD5A7E6-E9F5-4071-AFDA-25F76FDA5442}.Release|x64.ActiveCfg = 
Release|x64
-   {CAD5A7E6-E9F5-4071-AFDA-25F76FDA5442}.Release|x64.Build.0 = 
Release|x64
-   {ADFE5E22-31D0-4343-AE9E-8102CC0051F9}.Debug|Win32.ActiveCfg = 
Debug|Win32
-   {ADFE5E22-31D0-4343-AE9E-8102CC0051F9}.Debug|Win32.Build.0 = 
Debug|Win32
-   {ADFE5E22-31D0-4343-AE9E-8102CC0051F9}.Debug|x64.ActiveCfg = 
Debug|x64
-   {ADFE5E22-31D0-4343-AE9E-8102CC0051F9}.Debug|x64.Build.0 = 
Debug|x64
-   {ADFE5E22-31D0-4343-AE9E-8102CC0051F9}.Release|Win32.ActiveCfg 
= Release|Win32
-   {ADFE5E22-31D0-4343-AE9E-8102CC0051F9}.Release|Win32.Build.0 = 
Release|Win32
-   {ADFE5E22-31D0-4343-AE9E-8102CC0051F9}.Release|x64.ActiveCfg = 
Release|x64
-   {ADFE5E22-31D0-4343-AE9E-8102CC0051F9}.Release|x64.Build.0 = 
Release|x64
-   EndGlobalSection
-   GlobalSection(SolutionProperties) = preSolution
-   HideSolutionNode = FALSE
-   EndGlobalSection
-EndGlobal
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio 14
+VisualStudioVersion = 14.0.23107.0
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vdagent", 
"vdagent\vdagent.vcxproj", "{CAD5A7E6-E9F5-4071-AFDA-25F76FDA5442}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vdservice", 
"vdservice\vdservice.vcxproj", "{ADFE5E22-31D0-4343-AE9E-8102CC0051F9}"
+EndProject
+Global
+   GlobalSection(SolutionConfigurationPlatforms) = preSolution
+   Debug|Win32 = Debug|Win32
+   Debug|x64 = Debug|x64
+   Release|Win32 = Release|Win32
+   Release|x64 = Release|x64
+   Win10 Debug|Win32 = Win10 Debug|Win32
+ 

[Spice-devel] [RFC PATCH vdagent 10/16] Add simple build script

2016-07-18 Thread Dmitry Fleytman
Signed-off-by: Dmitry Fleytman <dmi...@daynix.com>
---
 Tools/vs_cmdline.vbs | 23 +++
 Tools/vs_run.bat | 26 ++
 buildAll.bat | 14 ++
 rebuildAll.bat   | 13 +
 4 files changed, 76 insertions(+)
 create mode 100644 Tools/vs_cmdline.vbs
 create mode 100644 Tools/vs_run.bat
 create mode 100644 buildAll.bat
 create mode 100644 rebuildAll.bat

diff --git a/Tools/vs_cmdline.vbs b/Tools/vs_cmdline.vbs
new file mode 100644
index 000..65bd0e5
--- /dev/null
+++ b/Tools/vs_cmdline.vbs
@@ -0,0 +1,23 @@
+Dim strCmdLine, strTemp
+Set WshShell = Wscript.CreateObject("Wscript.Shell")
+
+On Error Resume Next
+strCmdLine = 
WshShell.RegRead("HKLM\SOFTWARE\Microsoft\VisualStudio\14.0\InstallDir")
+' In case of error assume WoW64 case
+If Err <> 0 Then
+  On Error Goto 0
+  strCmdLine = 
WshShell.RegRead("HKLM\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\14.0\InstallDir")
+End If
+
+On Error Goto 0
+strCmdLine = chr(34) + strCmdLine + "devenv.com" + chr(34)
+For i = 0 to (Wscript.Arguments.Count - 1)
+  strTemp = Wscript.Arguments(i)
+  If InStr(strTemp, " ") Or InStr(strTemp, "|") Then
+  strCmdLine = strCmdLine + " " + chr(34) + strTemp + chr(34)
+  Else
+  strCmdLine = strCmdLine + " " + strTemp
+  End If
+Next
+
+WScript.Echo strCmdLine + vbCrLf
diff --git a/Tools/vs_run.bat b/Tools/vs_run.bat
new file mode 100644
index 000..b057fe3
--- /dev/null
+++ b/Tools/vs_run.bat
@@ -0,0 +1,26 @@
+@echo off
+
+for /f "tokens=*" %%a in (
+'cscript.exe /nologo "%~dp0\vs_cmdline.vbs" %*'
+) do (
+SET vs_cmd=%%a
+)
+
+IF NOT DEFINED vs_cmd (
+echo Visual Studio not found
+EXIT /b 1
+)
+
+SET vs_cmd_no_quotes="%vs_cmd:"=%"
+IF "vs_cmd_no_quotes" == "" (
+echo Visual Studio not found
+EXIT /b 2
+)
+
+%vs_cmd%
+if %ERRORLEVEL% GEQ 1 (
+echo Build with Visual Studio FAILED
+EXIT /b 3
+)
+
+EXIT /b 0
diff --git a/buildAll.bat b/buildAll.bat
new file mode 100644
index 000..2f33ead
--- /dev/null
+++ b/buildAll.bat
@@ -0,0 +1,14 @@
+@echo off
+
+SETLOCAL EnableExtensions EnableDelayedExpansion
+
+git submodule update --init
+
+cd cximage
+call buildAll.bat
+if !ERRORLEVEL! NEQ 0 exit /B 1
+cd ..
+
+call rebuildAll.bat
+
+ENDLOCAL
diff --git a/rebuildAll.bat b/rebuildAll.bat
new file mode 100644
index 000..37ae925
--- /dev/null
+++ b/rebuildAll.bat
@@ -0,0 +1,13 @@
+@echo off
+
+SETLOCAL EnableExtensions EnableDelayedExpansion
+
+del *.log
+
+call tools\vs_run.bat vdagent.sln /Rebuild "Win10_Debug|Win32" /Out 
build_Win10_Debug.log
+if !ERRORLEVEL! NEQ 0 exit /B 1
+
+call tools\vs_run.bat vdagent.sln /Rebuild "Win10_Release|Win32" /Out 
build_Win10_Release.log
+if !ERRORLEVEL! NEQ 0 exit /B 1
+
+ENDLOCAL
-- 
1.8.3.1

___
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/spice-devel


[Spice-devel] [RFC PATCH spice-protocol 0/1] Win10 support patches

2016-07-18 Thread Dmitry Fleytman
This patch adds definitions of a new QXL
escape code used by Win10 QXL-WDDM-DOD/VDAgent patches

Sameeh Jubran (1):
  Adding new ioctl for updating Vdagent state

 spice/qxl_windows.h | 6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

-- 
1.8.3.1

___
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/spice-devel


[Spice-devel] [RFC PATCH vdagent 03/16] Add cximage submodule

2016-07-18 Thread Dmitry Fleytman
Signed-off-by: Dmitry Fleytman <dmi...@daynix.com>
---
 .gitmodules | 3 +++
 cximage | 1 +
 2 files changed, 4 insertions(+)
 create mode 16 cximage

diff --git a/.gitmodules b/.gitmodules
index f946a4d..04211d8 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -1,3 +1,6 @@
 [submodule "spice-protocol"]
path = spice-protocol
url = git://git.freedesktop.org/git/spice/spice-protocol.git
+[submodule "cximage"]
+   path = cximage
+   url = ../daynix-spice.cximage.git
diff --git a/cximage b/cximage
new file mode 16
index 000..516061f
--- /dev/null
+++ b/cximage
@@ -0,0 +1 @@
+Subproject commit 516061fb908954ced223fea7703f5b5d79daac26
-- 
1.8.3.1

___
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/spice-devel


[Spice-devel] [RFC PATCH vdagent 07/16] Advance target platform version

2016-07-18 Thread Dmitry Fleytman
Signed-off-by: Dmitry Fleytman <dmi...@daynix.com>
---
 vdagent/vdagent.vcxproj | 2 +-
 vdservice/vdservice.vcxproj | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/vdagent/vdagent.vcxproj b/vdagent/vdagent.vcxproj
index bffc8a6..80de609 100644
--- a/vdagent/vdagent.vcxproj
+++ b/vdagent/vdagent.vcxproj
@@ -38,7 +38,7 @@
 {CAD5A7E6-E9F5-4071-AFDA-25F76FDA5442}
 redagent
 Win32Proj
-10.0.10240.0
+10.0.10586.0
   
   
   
diff --git a/vdservice/vdservice.vcxproj b/vdservice/vdservice.vcxproj
index b324802..7cf2628 100644
--- a/vdservice/vdservice.vcxproj
+++ b/vdservice/vdservice.vcxproj
@@ -22,7 +22,7 @@
 {ADFE5E22-31D0-4343-AE9E-8102CC0051F9}
 redservice
 Win32Proj
-8.1
+10.0.10586.0
   
   
   
-- 
1.8.3.1

___
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/spice-devel


[Spice-devel] [RFC PATCH vdagent 16/16] Fix return value of update_dev_mode_position

2016-07-18 Thread Dmitry Fleytman
From: Sameeh Jubran <sam...@daynix.com>

update_dev_mode_position() should propagate
error of update_mode_position() in case it fails.

Signed-off-by: Sameeh Jubran <sam...@daynix.com>
Signed-off-by: Dmitry Fleytman <dmi...@daynix.com>
---
 vdagent/display_configuration.cpp | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/vdagent/display_configuration.cpp 
b/vdagent/display_configuration.cpp
index 98b3d82..59dc032 100644
--- a/vdagent/display_configuration.cpp
+++ b/vdagent/display_configuration.cpp
@@ -361,8 +361,7 @@ bool WDDMInterface::update_dev_mode_position(LPCTSTR 
device_name, DEVMODE* dev_m
 //Convert the position so that the primary is always at (0,0)
 dev_mode->dmPosition.x = x;
 dev_mode->dmPosition.y = y;
-_ccd.update_mode_position(device_name, dev_mode);
-return true;
+return _ccd.update_mode_position(device_name, dev_mode);
 }
 
 bool WDDMInterface::init_d3d_api()
-- 
1.8.3.1

___
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/spice-devel


[Spice-devel] [RFC PATCH vdagent 08/16] Register path to cximage

2016-07-18 Thread Dmitry Fleytman
Signed-off-by: Dmitry Fleytman <dmi...@daynix.com>
---
 vdagent/vdagent.vcxproj | 30 ++
 1 file changed, 18 insertions(+), 12 deletions(-)

diff --git a/vdagent/vdagent.vcxproj b/vdagent/vdagent.vcxproj
index 80de609..8ada675 100644
--- a/vdagent/vdagent.vcxproj
+++ b/vdagent/vdagent.vcxproj
@@ -150,11 +150,17 @@
   
   
 $(SolutionDir)$(Platform)\$(Configuration)\
+
+
+  
+  
+
+
   
   
 
   Disabled
-  
..\common;..\spice-protocol\;$(SPICE_LIBS)\include\CxImage;%(AdditionalIncludeDirectories)
+  
..\common;..\spice-protocol\;..\cximage\CxImage;%(AdditionalIncludeDirectories)
   
WIN32;_DEBUG;_WINDOWS;_WIN32_WINNT=0x0501;%(PreprocessorDefinitions)
   true
   EnableFastChecks
@@ -180,7 +186,7 @@
   
 
   Disabled
-  
..\common;..\spice-protocol\;$(SPICE_LIBS)\include\CxImage;$(WindowsSdkDir)\Include\$(TargetPlatformVersion);%(AdditionalIncludeDirectories)
+  
..\common;..\spice-protocol\;..\cximage\CxImage;$(WindowsSdkDir)\Include\$(TargetPlatformVersion);%(AdditionalIncludeDirectories)
   
WIN32;_DEBUG;_WINDOWS;_WIN32_WINNT=_WIN32_WINNT_WIN10;%(PreprocessorDefinitions)
   true
   EnableFastChecks
@@ -192,7 +198,7 @@
 
 
   
Version.lib;$(SPICE_DEBUG_LIB_LIST);wtsapi32.lib;%(AdditionalDependencies)
-  
$(SPICE_DEBUG_LIBS_DIR);%(AdditionalLibraryDirectories)
+  
..\cximage\Build\Unicode_Debug\;%(AdditionalLibraryDirectories)
   true
   Windows
   false
@@ -211,7 +217,7 @@
 
 
   Disabled
-  
..\common;..\spice-protocol\;$(SPICE_LIBS)\include\CxImage;%(AdditionalIncludeDirectories)
+  
..\common;..\spice-protocol\;..\cximage\CxImage;%(AdditionalIncludeDirectories)
   
WIN32;_DEBUG;_WINDOWS;_WIN32_WINNT=0x0501;%(PreprocessorDefinitions)
   true
   EnableFastChecks
@@ -240,7 +246,7 @@
 
 
   Disabled
-  
..\common;..\spice-protocol\;$(SPICE_LIBS)\include\CxImage;$(WindowsSdkDir)\Include\$(TargetPlatformVersion);%(AdditionalIncludeDirectories)
+  
..\common;..\spice-protocol\;..\cximage\CxImage;$(WindowsSdkDir)\Include\$(TargetPlatformVersion);%(AdditionalIncludeDirectories)
   
WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)
   true
   EnableFastChecks
@@ -252,7 +258,7 @@
 
 
   
Version.lib;$(SPICE_DEBUG_LIB_LIST);wtsapi32.lib;%(AdditionalDependencies)
-  
$(SPICE_DEBUG_LIBS_DIR);%(AdditionalLibraryDirectories)
+  
..\cximage\Build\Unicode_Debug\;%(AdditionalLibraryDirectories)
   true
   Windows
   false
@@ -267,7 +273,7 @@
   
   
 
-  
..\common;..\spice-protocol\;$(SPICE_LIBS)\include\CxImage;%(AdditionalIncludeDirectories)
+  
..\common;..\spice-protocol\;..\cximage\CxImage;%(AdditionalIncludeDirectories)
   
WIN32;NDEBUG;_WINDOWS;_WIN32_WINNT=0x0501;%(PreprocessorDefinitions)
   MultiThreaded
   
@@ -295,7 +301,7 @@
   X64
 
 
-  
..\common;..\spice-protocol\;$(SPICE_LIBS)\include\CxImage;%(AdditionalIncludeDirectories)
+  
..\common;..\spice-protocol\;..\cximage\CxImage;%(AdditionalIncludeDirectories)
   
WIN32;NDEBUG;_WINDOWS;_WIN32_WINNT=0x0501;%(PreprocessorDefinitions)
   MultiThreaded
   
@@ -321,12 +327,12 @@
   
 
   
WIN32;NDEBUG;_WINDOWS;_WIN32_WINNT=_WIN32_WINNT_WIN10;%(PreprocessorDefinitions)
-  
..\common;..\spice-protocol\;$(SPICE_LIBS)\include\CxImage;$(WindowsSdkDir)\Include\$(TargetPlatformVersion);%(AdditionalIncludeDirectories)
+  
..\common;..\spice-protocol\;..\cximage\CxImage;$(WindowsSdkDir)\Include\$(TargetPlatformVersion);%(AdditionalIncludeDirectories)
   MultiThreaded
 
 
   
Version.lib;$(SPICE_LIB_LIST);wtsapi32.lib;%(AdditionalDependencies)
-  
$(SPICE_LIBS_DIR);%(AdditionalLibraryDirectories)
+  
..\cximage\Build\Unicode_Release\;%(AdditionalLibraryDirectories)
 
 
   
@@ -336,13 +342,13 @@
   
 
   
WIN32;NDEBUG;_WINDOWS;_WIN32_WINNT=_WIN32_WINNT_WIN10;%(PreprocessorDefinitions)
-  
..\common;..\spice-protocol\;$(SPICE_LIBS)\include\CxImage;$(WindowsSdkDir)\Include\$(TargetPlatformVersion);%(AdditionalIncludeDirectories)
+  
..\common;..\spice-protocol\;..\cximage\CxImage;$(WindowsSdkDir)\Include\$(TargetPlatformVersion);%(AdditionalIncludeDirectories)
   MultiThreaded
   true
 
 
   
Version.lib;$(SPICE_LIB_LIST);wtsapi32.lib;%(AdditionalDependencies)
-  
$(SPICE_LIBS_DIR);%(AdditionalLibraryDirectories)
+  
..\cximage\Build\Unicode_Release\;%(AdditionalLibraryDirectories)
 
 
   
-- 
1.8.3.1

___
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/spice-devel


[Spice-devel] [RFC PATCH vdagent 06/16] Fix include path to spice-protocol

2016-07-18 Thread Dmitry Fleytman
Signed-off-by: Dmitry Fleytman <dmi...@daynix.com>
---
 vdagent/vdagent.vcxproj | 16 
 vdservice/vdservice.vcxproj |  8 
 2 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/vdagent/vdagent.vcxproj b/vdagent/vdagent.vcxproj
index 4f6f54a..bffc8a6 100644
--- a/vdagent/vdagent.vcxproj
+++ b/vdagent/vdagent.vcxproj
@@ -154,7 +154,7 @@
   
 
   Disabled
-  
..\common;$(SPICE_PROTOCOL_DIR);$(SPICE_LIBS)\include\CxImage;%(AdditionalIncludeDirectories)
+  
..\common;..\spice-protocol\;$(SPICE_LIBS)\include\CxImage;%(AdditionalIncludeDirectories)
   
WIN32;_DEBUG;_WINDOWS;_WIN32_WINNT=0x0501;%(PreprocessorDefinitions)
   true
   EnableFastChecks
@@ -180,7 +180,7 @@
   
 
   Disabled
-  
..\common;$(SPICE_PROTOCOL_DIR);$(SPICE_LIBS)\include\CxImage;$(WindowsSdkDir)\Include\$(TargetPlatformVersion);%(AdditionalIncludeDirectories)
+  
..\common;..\spice-protocol\;$(SPICE_LIBS)\include\CxImage;$(WindowsSdkDir)\Include\$(TargetPlatformVersion);%(AdditionalIncludeDirectories)
   
WIN32;_DEBUG;_WINDOWS;_WIN32_WINNT=_WIN32_WINNT_WIN10;%(PreprocessorDefinitions)
   true
   EnableFastChecks
@@ -211,7 +211,7 @@
 
 
   Disabled
-  
..\common;$(SPICE_PROTOCOL_DIR);$(SPICE_LIBS)\include\CxImage;%(AdditionalIncludeDirectories)
+  
..\common;..\spice-protocol\;$(SPICE_LIBS)\include\CxImage;%(AdditionalIncludeDirectories)
   
WIN32;_DEBUG;_WINDOWS;_WIN32_WINNT=0x0501;%(PreprocessorDefinitions)
   true
   EnableFastChecks
@@ -240,7 +240,7 @@
 
 
   Disabled
-  
..\common;$(SPICE_PROTOCOL_DIR);$(SPICE_LIBS)\include\CxImage;$(WindowsSdkDir)\Include\$(TargetPlatformVersion);%(AdditionalIncludeDirectories)
+  
..\common;..\spice-protocol\;$(SPICE_LIBS)\include\CxImage;$(WindowsSdkDir)\Include\$(TargetPlatformVersion);%(AdditionalIncludeDirectories)
   
WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)
   true
   EnableFastChecks
@@ -267,7 +267,7 @@
   
   
 
-  
..\common;$(SPICE_PROTOCOL_DIR);$(SPICE_LIBS)\include\CxImage;%(AdditionalIncludeDirectories)
+  
..\common;..\spice-protocol\;$(SPICE_LIBS)\include\CxImage;%(AdditionalIncludeDirectories)
   
WIN32;NDEBUG;_WINDOWS;_WIN32_WINNT=0x0501;%(PreprocessorDefinitions)
   MultiThreaded
   
@@ -295,7 +295,7 @@
   X64
 
 
-  
..\common;$(SPICE_PROTOCOL_DIR);$(SPICE_LIBS)\include\CxImage;%(AdditionalIncludeDirectories)
+  
..\common;..\spice-protocol\;$(SPICE_LIBS)\include\CxImage;%(AdditionalIncludeDirectories)
   
WIN32;NDEBUG;_WINDOWS;_WIN32_WINNT=0x0501;%(PreprocessorDefinitions)
   MultiThreaded
   
@@ -321,7 +321,7 @@
   
 
   
WIN32;NDEBUG;_WINDOWS;_WIN32_WINNT=_WIN32_WINNT_WIN10;%(PreprocessorDefinitions)
-  
..\common;$(SPICE_PROTOCOL_DIR);$(SPICE_LIBS)\include\CxImage;$(WindowsSdkDir)\Include\$(TargetPlatformVersion);%(AdditionalIncludeDirectories)
+  
..\common;..\spice-protocol\;$(SPICE_LIBS)\include\CxImage;$(WindowsSdkDir)\Include\$(TargetPlatformVersion);%(AdditionalIncludeDirectories)
   MultiThreaded
 
 
@@ -336,7 +336,7 @@
   
 
   
WIN32;NDEBUG;_WINDOWS;_WIN32_WINNT=_WIN32_WINNT_WIN10;%(PreprocessorDefinitions)
-  
..\common;$(SPICE_PROTOCOL_DIR);$(SPICE_LIBS)\include\CxImage;$(WindowsSdkDir)\Include\$(TargetPlatformVersion);%(AdditionalIncludeDirectories)
+  
..\common;..\spice-protocol\;$(SPICE_LIBS)\include\CxImage;$(WindowsSdkDir)\Include\$(TargetPlatformVersion);%(AdditionalIncludeDirectories)
   MultiThreaded
   true
 
diff --git a/vdservice/vdservice.vcxproj b/vdservice/vdservice.vcxproj
index 7ea66ea..b324802 100644
--- a/vdservice/vdservice.vcxproj
+++ b/vdservice/vdservice.vcxproj
@@ -93,7 +93,7 @@
   
 
   Disabled
-  
..\common;$(SPICE_PROTOCOL_DIR);%(AdditionalIncludeDirectories)
+  
..\common;..\spice-protocol\;%(AdditionalIncludeDirectories)
   
WIN32;_DEBUG;_CONSOLE;_WIN32_WINNT=0x0501;%(PreprocessorDefinitions)
   true
   EnableFastChecks
@@ -117,7 +117,7 @@
 
 
   Disabled
-  
..\common;$(SPICE_PROTOCOL_DIR);%(AdditionalIncludeDirectories)
+  
..\common;..\spice-protocol\;%(AdditionalIncludeDirectories)
   
WIN32;_DEBUG;_CONSOLE;_WIN32_WINNT=0x0501;%(PreprocessorDefinitions)
   true
   EnableFastChecks
@@ -137,7 +137,7 @@
   
   
 
-  
..\common;$(SPICE_PROTOCOL_DIR);%(AdditionalIncludeDirectories)
+  
..\common;..\spice-protocol\;%(AdditionalIncludeDirectories)
   
WIN32;NDEBUG;_CONSOLE;_WIN32_WINNT=0x0501;%(PreprocessorDefinitions)
   MultiThreaded
   
@@ -160,7 +160,7 @@
   X64
 
 
-  
..\common;$(SPICE_PROTOCOL_DIR);%(AdditionalIncludeDirectories)
+  
..\common;..\spice-protocol\;%(AdditionalIncludeDirectories)
   
WIN32;NDEBUG;_CONSOLE;_WIN32_WINNT=0x0501;%(PreprocessorDefinitions)
   MultiThreaded
   
-- 
1

[Spice-devel] [RFC PATCH vdagent 05/16] Add .gitignore file

2016-07-18 Thread Dmitry Fleytman
Signed-off-by: Dmitry Fleytman <dmi...@daynix.com>
---
 .gitignore | 13 +
 1 file changed, 13 insertions(+)
 create mode 100644 .gitignore

diff --git a/.gitignore b/.gitignore
new file mode 100644
index 000..5db05d8
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,13 @@
+.vs/
+Debug/
+Release/
+Win10 Debug/
+Win10 Release/
+vdagent.VC.opendb
+vdagent.sdf
+vdagent/Win10 Debug/
+vdagent/Win10 Release/
+vdagent/vdagent.vcxproj.user
+vdservice/Debug/
+vdservice/Release/
+build*.log
\ No newline at end of file
-- 
1.8.3.1

___
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/spice-devel


[Spice-devel] [RFC PATCH qxl-wddm-dod 05/28] Add functions called from non-pageable functions to non-paged segments

2016-07-18 Thread Dmitry Fleytman
From: Sandy Stutsman 

Found by Driver Verifier
---
 qxldod/QxlDod.cpp | 55 ---
 1 file changed, 32 insertions(+), 23 deletions(-)

diff --git a/qxldod/QxlDod.cpp b/qxldod/QxlDod.cpp
index 1225f04..1b3bdf1 100755
--- a/qxldod/QxlDod.cpp
+++ b/qxldod/QxlDod.cpp
@@ -44,6 +44,7 @@ BYTE PixelMask[BITS_PER_BYTE]  = {0x80, 0x40, 0x20, 0x10, 
0x08, 0x04, 0x02, 0x01
 
 #pragma code_seg(pop)
 
+#pragma code_seg("PAGE")
 
 
 QxlDod::QxlDod(_In_ DEVICE_OBJECT* pPhysicalDeviceObject) : 
m_pPhysicalDevice(pPhysicalDeviceObject),
@@ -1916,6 +1917,20 @@ NTSTATUS QxlDod::RegisterHWInfo(ULONG Id)
 //
 #pragma code_seg(push)
 #pragma code_seg()
+
+UINT BPPFromPixelFormat(D3DDDIFORMAT Format)
+{
+switch (Format) {
+case D3DDDIFMT_UNKNOWN: return 0;
+case D3DDDIFMT_P8: return 8;
+case D3DDDIFMT_R5G6B5: return 16;
+case D3DDDIFMT_R8G8B8: return 24;
+case D3DDDIFMT_X8R8G8B8: // fall through
+case D3DDDIFMT_A8R8G8B8: return 32;
+default: QXL_LOG_ASSERTION1("Unknown D3DDDIFORMAT 0x%I64x", Format); 
return 0;
+}
+}
+
 D3DDDI_VIDEO_PRESENT_SOURCE_ID 
QxlDod::FindSourceForTarget(D3DDDI_VIDEO_PRESENT_TARGET_ID TargetId, BOOLEAN 
DefaultToZero)
 {
 UNREFERENCED_PARAMETER(TargetId);
@@ -1930,7 +1945,6 @@ D3DDDI_VIDEO_PRESENT_SOURCE_ID 
QxlDod::FindSourceForTarget(D3DDDI_VIDEO_PRESENT_
 return DefaultToZero ? 0 : D3DDDI_ID_UNINITIALIZED;
 }
 
-#pragma code_seg(pop) // End Non-Paged Code
 
 //
 // Frame buffer map/unmap
@@ -2278,6 +2292,7 @@ VOID BltBits (
 DbgPrint(TRACE_LEVEL_ERROR, ("Either dst (0x%I64x) or src (0x%I64x) 
bits encountered exception during access.\n", pDst->pBits, pSrc->pBits));
 }
 }
+#pragma code_seg(pop) // End Non-Paged Code
 
 VgaDevice::VgaDevice(_In_ QxlDod* pQxlDod)
 {
@@ -2862,6 +2877,9 @@ VOID VgaDevice::BlackOutScreen(CURRENT_BDD_MODE* 
pCurrentBddMod)
 pCurrentBddMod->ZeroedOutStart.QuadPart = NewPhysAddrStart.QuadPart;
 pCurrentBddMod->ZeroedOutEnd.QuadPart = NewPhysAddrEnd.QuadPart;
 }
+#pragma code_seg(push)
+#pragma code_seg()
+// BEGIN: Non-Paged Code Segment
 
 BOOLEAN VgaDevice::InterruptRoutine(_In_ PDXGKRNL_INTERFACE pDxgkInterface, 
_In_  ULONG MessageNumber)
 {
@@ -2877,6 +2895,7 @@ VOID VgaDevice::DpcRoutine(PVOID)
 VOID VgaDevice::ResetDevice(VOID)
 {
 }
+#pragma  code_seg(pop) //end non-paged code
 
 NTSTATUS  VgaDevice::SetPointerShape(_In_ CONST DXGKARG_SETPOINTERSHAPE* 
pSetPointerShape)
 {
@@ -3530,14 +3549,6 @@ void QxlDevice::InitMspace(UINT32 mspace_type, UINT8 
*start, size_t capacity)
 DbgPrint(TRACE_LEVEL_VERBOSE, ("<--- %s _mspace = %p\n", __FUNCTION__, 
m_MSInfo[mspace_type]._mspace));
 }
 
-void QxlDevice::ResetDevice(void)
-{
-DbgPrint(TRACE_LEVEL_VERBOSE, ("---> %s\n", __FUNCTION__));
-m_RamHdr->int_mask = ~0;
-WRITE_PORT_UCHAR(m_IoBase + QXL_IO_MEMSLOT_ADD, 0);
-DbgPrint(TRACE_LEVEL_VERBOSE, ("<--- %s\n", __FUNCTION__));
-}
-
 NTSTATUS
 QxlDevice::ExecutePresentDisplayOnly(
 _In_ BYTE* DstAddr,
@@ -4484,6 +4495,9 @@ VOID QxlDevice::PushCursor(VOID)
 DbgPrint(TRACE_LEVEL_VERBOSE, ("<--- %s notify = %d\n", __FUNCTION__, 
notify));
 }
 
+#pragma code_seg(push)
+#pragma code_seg()
+// BEGIN: Non-Paged Code Segment
 BOOLEAN QxlDevice::InterruptRoutine(_In_ PDXGKRNL_INTERFACE pDxgkInterface, 
_In_  ULONG MessageNumber)
 {
 UNREFERENCED_PARAMETER(MessageNumber);
@@ -4543,6 +4557,15 @@ VOID QxlDevice::DpcRoutine(PVOID ptr)
 DbgPrint(TRACE_LEVEL_INFORMATION, ("<--- %s\n", __FUNCTION__));
 }
 
+void QxlDevice::ResetDevice(void)
+{
+DbgPrint(TRACE_LEVEL_VERBOSE, ("---> %s\n", __FUNCTION__));
+m_RamHdr->int_mask = ~0;
+WRITE_PORT_UCHAR(m_IoBase + QXL_IO_MEMSLOT_ADD, 0);
+DbgPrint(TRACE_LEVEL_VERBOSE, ("<--- %s\n", __FUNCTION__));
+}
+#pragma code_seg(pop) //end non-paged code
+
 VOID QxlDevice::UpdateArea(CONST RECT* area, UINT32 surface_id)
 {
 DbgPrint(TRACE_LEVEL_VERBOSE, ("---> %s\n", __FUNCTION__));
@@ -4569,20 +4592,6 @@ VOID QxlDevice::DpcCallback(PDPC_CB_CONTEXT ctx)
 
 }
 
-UINT BPPFromPixelFormat(D3DDDIFORMAT Format)
-{
-switch (Format)
-{
-case D3DDDIFMT_UNKNOWN: return 0;
-case D3DDDIFMT_P8: return 8;
-case D3DDDIFMT_R5G6B5: return 16;
-case D3DDDIFMT_R8G8B8: return 24;
-case D3DDDIFMT_X8R8G8B8: // fall through
-case D3DDDIFMT_A8R8G8B8: return 32;
-default: QXL_LOG_ASSERTION1("Unknown D3DDDIFORMAT 0x%I64x", Format); 
return 0;
-}
-}
-
 // Given bits per pixel, return the pixel format at the same bpp
 D3DDDIFORMAT PixelFormatFromBPP(UINT BPP)
 {
-- 
1.8.3.1

___
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/spice-devel


[Spice-devel] [RFC PATCH qxl-wddm-dod 08/28] Use SrcPitch when calculating size of memory to map PresentDisplayOnly

2016-07-18 Thread Dmitry Fleytman
From: Sandy Stutsman 

Otherwise, can result in a BSOD.
---
 qxldod/QxlDod.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/qxldod/QxlDod.cpp b/qxldod/QxlDod.cpp
index 9d13934..7b60e0c 100755
--- a/qxldod/QxlDod.cpp
+++ b/qxldod/QxlDod.cpp
@@ -3606,7 +3606,7 @@ QxlDevice::ExecutePresentDisplayOnly(
 
 {
 // Map Source into kernel space, as Blt will be executed by system 
worker thread
-UINT sizeToMap = SrcBytesPerPixel * ctx->SrcWidth * ctx->SrcHeight;
+UINT sizeToMap = ctx->SrcPitch * ctx->SrcHeight;
 
 PMDL mdl = IoAllocateMdl((PVOID)SrcAddr, sizeToMap,  FALSE, FALSE, 
NULL);
 if(!mdl)
-- 
1.8.3.1

___
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/spice-devel


[Spice-devel] [RFC PATCH qxl-wddm-dod 23/28] Replacing <#ifdef USE_FRAMEBUFFER> with runtime logic

2016-07-18 Thread Dmitry Fleytman
Framebuffer should only be used in VGA mode,
however the mode is only known at runtime therefore
framebuffer logic should be active when the driver
is operating in vga mode only.

Signed-off-by: Sameeh Jubran <sam...@daynix.com>
Signed-off-by: Dmitry Fleytman <dmi...@daynix.com>
---
 qxldod/QxlDod.cpp | 21 +++--
 qxldod/QxlDod.h   |  1 +
 2 files changed, 12 insertions(+), 10 deletions(-)

diff --git a/qxldod/QxlDod.cpp b/qxldod/QxlDod.cpp
index f6542c4..a550306 100755
--- a/qxldod/QxlDod.cpp
+++ b/qxldod/QxlDod.cpp
@@ -219,9 +219,10 @@ VOID QxlDod::CleanUp(VOID)
 {
 if (m_CurrentModes[Source].FrameBuffer.Ptr)
 {
-#ifdef USE_FRAMEBUFFER
-UnmapFrameBuffer(m_CurrentModes[Source].FrameBuffer.Ptr, 
m_CurrentModes[Source].DispInfo.Height * m_CurrentModes[Source].DispInfo.Pitch);
-#endif
+if (m_pHWDevice->GetType() == VGA_DEVICE)
+{
+UnmapFrameBuffer(m_CurrentModes[Source].FrameBuffer.Ptr, 
m_CurrentModes[Source].DispInfo.Height * m_CurrentModes[Source].DispInfo.Pitch);
+}
 m_CurrentModes[Source].FrameBuffer.Ptr = NULL;
 m_CurrentModes[Source].Flags.FrameBufferIsActive = FALSE;
 }
@@ -1395,10 +1396,11 @@ NTSTATUS QxlDod::CommitVidPn(_In_ CONST 
DXGKARG_COMMITVIDPN* CONST pCommitVidPn)
 if (m_CurrentModes[pCommitVidPn->AffectedVidPnSourceId].FrameBuffer.Ptr &&
 
!m_CurrentModes[pCommitVidPn->AffectedVidPnSourceId].Flags.DoNotMapOrUnmap)
 {
-#ifdef USE_FRAMEBUFFER
-Status = 
UnmapFrameBuffer(m_CurrentModes[pCommitVidPn->AffectedVidPnSourceId].FrameBuffer.Ptr,
-  
m_CurrentModes[pCommitVidPn->AffectedVidPnSourceId].DispInfo.Pitch * 
m_CurrentModes[pCommitVidPn->AffectedVidPnSourceId].DispInfo.Height);
-#endif
+if (m_pHWDevice->GetType() == VGA_DEVICE)
+{
+Status = 
UnmapFrameBuffer(m_CurrentModes[pCommitVidPn->AffectedVidPnSourceId].FrameBuffer.Ptr,
+
m_CurrentModes[pCommitVidPn->AffectedVidPnSourceId].DispInfo.Pitch * 
m_CurrentModes[pCommitVidPn->AffectedVidPnSourceId].DispInfo.Height);
+}
 m_CurrentModes[pCommitVidPn->AffectedVidPnSourceId].FrameBuffer.Ptr = 
NULL;
 
m_CurrentModes[pCommitVidPn->AffectedVidPnSourceId].Flags.FrameBufferIsActive = 
FALSE;
 
@@ -1525,8 +1527,7 @@ NTSTATUS QxlDod::SetSourceModeAndPath(CONST 
D3DKMDT_VIDPN_SOURCE_MODE* pSourceMo
 pCurrentBddMode->DispInfo.Height = 
pSourceMode->Format.Graphics.PrimSurfSize.cy;
 pCurrentBddMode->DispInfo.Pitch = 
pSourceMode->Format.Graphics.PrimSurfSize.cx * 
BPPFromPixelFormat(pCurrentBddMode->DispInfo.ColorFormat) / BITS_PER_BYTE;
 
-#ifdef USE_FRAMEBUFFER
-if (!pCurrentBddMode->Flags.DoNotMapOrUnmap)
+if (m_pHWDevice->GetType() == VGA_DEVICE && 
!pCurrentBddMode->Flags.DoNotMapOrUnmap)
 {
 // Map the new frame buffer
 QXL_ASSERT(pCurrentBddMode->FrameBuffer.Ptr == NULL);
@@ -1534,7 +1535,7 @@ NTSTATUS QxlDod::SetSourceModeAndPath(CONST 
D3DKMDT_VIDPN_SOURCE_MODE* pSourceMo
 pCurrentBddMode->DispInfo.Pitch * 
pCurrentBddMode->DispInfo.Height,
 &(pCurrentBddMode->FrameBuffer.Ptr));
 }
-#endif
+
 if (NT_SUCCESS(Status))
 {
 
diff --git a/qxldod/QxlDod.h b/qxldod/QxlDod.h
index c28f97f..41189b3 100755
--- a/qxldod/QxlDod.h
+++ b/qxldod/QxlDod.h
@@ -263,6 +263,7 @@ public:
 virtual NTSTATUS SetPointerPosition(_In_ CONST DXGKARG_SETPOINTERPOSITION* 
pSetPointerPosition) = 0;
 virtual NTSTATUS Escape(_In_ CONST DXGKARG_ESCAPE* pEscap) = 0;
 ULONG GetId(void) { return m_Id; }
+WIN_QXL_DEVICE_TYPE GetType(void) { return m_type; }
 protected:
 virtual NTSTATUS GetModeList(DXGK_DISPLAY_INFORMATION* pDispInfo) = 0;
 protected:
-- 
1.8.3.1

___
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/spice-devel


[Spice-devel] [RFC PATCH qxl-wddm-dod 19/28] Add simple build script

2016-07-18 Thread Dmitry Fleytman
Signed-off-by: Dmitry Fleytman <dmi...@daynix.com>
---
 Tools/vs_cmdline.vbs| 23 +++
 Tools/vs_run.bat| 26 ++
 buildAll.bat| 15 +++
 buildAll_NoSign.bat | 19 +++
 qxldod/buildAll.bat | 31 ---
 qxldod/callVisualStudio.bat | 28 
 qxldod/checkWin8Tools.bat   |  8 
 qxldod/clean.bat| 12 
 8 files changed, 83 insertions(+), 79 deletions(-)
 create mode 100644 Tools/vs_cmdline.vbs
 create mode 100644 Tools/vs_run.bat
 create mode 100644 buildAll.bat
 create mode 100644 buildAll_NoSign.bat
 delete mode 100755 qxldod/buildAll.bat
 delete mode 100755 qxldod/callVisualStudio.bat
 delete mode 100755 qxldod/checkWin8Tools.bat
 delete mode 100755 qxldod/clean.bat

diff --git a/Tools/vs_cmdline.vbs b/Tools/vs_cmdline.vbs
new file mode 100644
index 000..65bd0e5
--- /dev/null
+++ b/Tools/vs_cmdline.vbs
@@ -0,0 +1,23 @@
+Dim strCmdLine, strTemp
+Set WshShell = Wscript.CreateObject("Wscript.Shell")
+
+On Error Resume Next
+strCmdLine = 
WshShell.RegRead("HKLM\SOFTWARE\Microsoft\VisualStudio\14.0\InstallDir")
+' In case of error assume WoW64 case
+If Err <> 0 Then
+  On Error Goto 0
+  strCmdLine = 
WshShell.RegRead("HKLM\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\14.0\InstallDir")
+End If
+
+On Error Goto 0
+strCmdLine = chr(34) + strCmdLine + "devenv.com" + chr(34)
+For i = 0 to (Wscript.Arguments.Count - 1)
+  strTemp = Wscript.Arguments(i)
+  If InStr(strTemp, " ") Or InStr(strTemp, "|") Then
+  strCmdLine = strCmdLine + " " + chr(34) + strTemp + chr(34)
+  Else
+  strCmdLine = strCmdLine + " " + strTemp
+  End If
+Next
+
+WScript.Echo strCmdLine + vbCrLf
diff --git a/Tools/vs_run.bat b/Tools/vs_run.bat
new file mode 100644
index 000..b057fe3
--- /dev/null
+++ b/Tools/vs_run.bat
@@ -0,0 +1,26 @@
+@echo off
+
+for /f "tokens=*" %%a in (
+'cscript.exe /nologo "%~dp0\vs_cmdline.vbs" %*'
+) do (
+SET vs_cmd=%%a
+)
+
+IF NOT DEFINED vs_cmd (
+echo Visual Studio not found
+EXIT /b 1
+)
+
+SET vs_cmd_no_quotes="%vs_cmd:"=%"
+IF "vs_cmd_no_quotes" == "" (
+echo Visual Studio not found
+EXIT /b 2
+)
+
+%vs_cmd%
+if %ERRORLEVEL% GEQ 1 (
+echo Build with Visual Studio FAILED
+EXIT /b 3
+)
+
+EXIT /b 0
diff --git a/buildAll.bat b/buildAll.bat
new file mode 100644
index 000..dbbd46b
--- /dev/null
+++ b/buildAll.bat
@@ -0,0 +1,15 @@
+@echo off
+
+SETLOCAL EnableExtensions EnableDelayedExpansion
+
+del *.log
+
+call buildAll_NoSign.bat
+
+call tools\vs_run.bat qxldod.sln /Rebuild "Win10Debug|Win32" /Out 
build_Win10_Debug_Win32.log
+if !ERRORLEVEL! NEQ 0 exit /B 1
+
+call tools\vs_run.bat qxldod.sln /Rebuild "Win10Debug|x64" /Out 
build_Win10_Debug_x64.log
+if !ERRORLEVEL! NEQ 0 exit /B 1
+
+ENDLOCAL
diff --git a/buildAll_NoSign.bat b/buildAll_NoSign.bat
new file mode 100644
index 000..20f1db4
--- /dev/null
+++ b/buildAll_NoSign.bat
@@ -0,0 +1,19 @@
+@echo off
+
+SETLOCAL EnableExtensions EnableDelayedExpansion
+
+del *.log
+
+call tools\vs_run.bat qxldod.sln /Rebuild "Win10Debug_NoSign|Win32" /Out 
build_Win10_Debug_NoSign_Win32.log
+if !ERRORLEVEL! NEQ 0 exit /B 1
+
+call tools\vs_run.bat qxldod.sln /Rebuild "Win10Release|Win32" /Out 
build_Win10_Release_Win32.log
+if !ERRORLEVEL! NEQ 0 exit /B 1
+
+call tools\vs_run.bat qxldod.sln /Rebuild "Win10Debug_NoSign|x64" /Out 
build_Win10_Debug_NoSign_x64.log
+if !ERRORLEVEL! NEQ 0 exit /B 1
+
+call tools\vs_run.bat qxldod.sln /Rebuild "Win10Release|x64" /Out 
build_Win10_Release_x64.log
+if !ERRORLEVEL! NEQ 0 exit /B 1
+
+ENDLOCAL
diff --git a/qxldod/buildAll.bat b/qxldod/buildAll.bat
deleted file mode 100755
index 072a2b4..000
--- a/qxldod/buildAll.bat
+++ /dev/null
@@ -1,31 +0,0 @@
-@echo off
-
-call clean.bat
-
-rem WIN8_64
-setlocal
-if exist Install\win8\amd64 rmdir Install\win8\amd64 /s /q
-call callVisualStudio.bat 12 qxldod.vcxproj /Rebuild "Win8 Release|x64" /Out 
buildfre_win8_amd64.log
-mkdir .\Install\Win8\x64
-del /Q .\Install\Win8\x64\*
-copy /Y objfre_win8_amd64\amd64\qxldod.sys .\Install\Win8\x64
-copy /Y objfre_win8_amd64\amd64\qxldod.inf .\Install\Win8\x64
-copy /Y objfre_win8_amd64\amd64\qxldod.cat .\Install\Win8\x64
-copy /Y objfre_win8_amd64\amd64\qxldod.pdb .\Install\Win8\x64
-endlocal
-if %ERRORLEVEL% NEQ 0 goto :eof
-
-rem WIN8_32
-setlocal
-if exist Install\win8\x86 rmdir Install\win8\x86 /s /q
-call callVisualStudio.bat 12 qxldod.vcxproj /Rebuild "Win8 Release|Win32" /Out 
buildfre_win8_x86.log
-mkdir .\Install\Win8\x86
-del /Q .\Install\Win8\x86\*
-copy /Y objfre_win8_x86\i386\qxldod.sys .\Install\Win8\x86
-copy /Y objfre_win8_x86\i386\qxldod.inf .\Install\Win8\x86
-copy /Y objfre_win8_x86\i386\qx

[Spice-devel] [RFC PATCH qxl-wddm-dod 25/28] Support future Qxl revisions

2016-07-18 Thread Dmitry Fleytman
The driver determines operation mode
(QXL or VGA) by checking device hardware
ids including revision id field.

Without this patch driver operates in VGA
mode for all revisions other than 4.

This patch makes driver operate in QXL
mode revision 4 and newer devices.

Signed-off-by: Sameeh Jubran <sam...@daynix.com>
Signed-off-by: Dmitry Fleytman <dmi...@daynix.com>
---
 qxldod/QxlDod.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/qxldod/QxlDod.cpp b/qxldod/QxlDod.cpp
index a34c728..6d0a525 100755
--- a/qxldod/QxlDod.cpp
+++ b/qxldod/QxlDod.cpp
@@ -108,7 +108,7 @@ NTSTATUS QxlDod::CheckHardware()
 Status = STATUS_GRAPHICS_DRIVER_MISMATCH;
 if (Header.VendorID == REDHAT_PCI_VENDOR_ID &&
 Header.DeviceID == 0x0100 &&
-Header.RevisionID == 4)
+Header.RevisionID >= 4)
 {
 Status = STATUS_SUCCESS;
 }
-- 
1.8.3.1

___
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/spice-devel


[Spice-devel] [RFC PATCH qxl-wddm-dod 26/28] Set SupportNonVGA in QueryAdapterInfo callback

2016-07-18 Thread Dmitry Fleytman
This capability flag should be set in order
to indicate to the OS that callback
DxgkDdiStopDeviceAndReleasePostDisplayOwnership
is supported.

Signed-off-by: Sameeh Jubran <sam...@daynix.com>
Signed-off-by: Dmitry Fleytman <dmi...@daynix.com>
---
 qxldod/QxlDod.cpp | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/qxldod/QxlDod.cpp b/qxldod/QxlDod.cpp
index 6d0a525..7b3d353 100755
--- a/qxldod/QxlDod.cpp
+++ b/qxldod/QxlDod.cpp
@@ -433,6 +433,8 @@ NTSTATUS QxlDod::QueryAdapterInfo(_In_ CONST 
DXGKARG_QUERYADAPTERINFO* pQueryAda
 pDriverCaps->PointerCaps.Monochrome = 1;
 pDriverCaps->PointerCaps.Color = 1;
 
+pDriverCaps->SupportNonVGA = TRUE;
+
 DbgPrint(TRACE_LEVEL_VERBOSE, ("<--- %s 1\n", __FUNCTION__));
 return STATUS_SUCCESS;
 }
-- 
1.8.3.1

___
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/spice-devel


[Spice-devel] [RFC PATCH qxl-wddm-dod 03/28] Set DriverStarted flag at the begining of the StartDriver function

2016-07-18 Thread Dmitry Fleytman
From: Sandy Stutsman 

With the Driver Verifier on, a DPC generated during the call will assert if
the flag is not set.

Changed error handling so that if something fails, the code will break out
of a do loop and reset the flag to false before returning the error status.
---
 qxldod/QxlDod.cpp | 110 +++---
 1 file changed, 54 insertions(+), 56 deletions(-)

diff --git a/qxldod/QxlDod.cpp b/qxldod/QxlDod.cpp
index 94f2d18..77f4f86 100755
--- a/qxldod/QxlDod.cpp
+++ b/qxldod/QxlDod.cpp
@@ -113,72 +113,73 @@ NTSTATUS QxlDod::StartDevice(_In_  DXGK_START_INFO*   
pDxgkStartInfo,
 {
 PHYSICAL_ADDRESS PhysicAddress;
 PAGED_CODE();
+NTSTATUS Status;
 QXL_ASSERT(pDxgkStartInfo != NULL);
 QXL_ASSERT(pDxgkInterface != NULL);
 QXL_ASSERT(pNumberOfViews != NULL);
 QXL_ASSERT(pNumberOfChildren != NULL);
-//CHECK ME!
+//CHECK ME!
 RtlCopyMemory(_DxgkInterface, pDxgkInterface, sizeof(m_DxgkInterface));
 RtlZeroMemory(m_CurrentModes, sizeof(m_CurrentModes));
-//CHECK ME!
+//CHECK ME!
 m_CurrentModes[0].DispInfo.TargetId = D3DDDI_ID_UNINITIALIZED;
-// Get device information from OS.
-NTSTATUS Status = 
m_DxgkInterface.DxgkCbGetDeviceInformation(m_DxgkInterface.DeviceHandle, 
_DeviceInfo);
-if (!NT_SUCCESS(Status))
-{
-QXL_LOG_ASSERTION1("DxgkCbGetDeviceInformation failed with status 
0x%X\n",
-   Status);
-return Status;
-}
+m_Flags.DriverStarted = TRUE;
+do {
 
-Status = CheckHardware();
-if (NT_SUCCESS(Status))
-{
-m_pHWDevice = new(NonPagedPoolNx) QxlDevice(this);
-}
-else
-{
-m_pHWDevice = new(NonPagedPoolNx) VgaDevice(this);
-}
+// Get device information from OS.
+Status = 
m_DxgkInterface.DxgkCbGetDeviceInformation(m_DxgkInterface.DeviceHandle, 
_DeviceInfo);
+if (!NT_SUCCESS(Status)) {
+QXL_LOG_ASSERTION1("DxgkCbGetDeviceInformation failed with status 
0x%X\n",
+Status);
+break;
+}
 
-if (!m_pHWDevice)
-{
-Status = STATUS_NO_MEMORY;
-DbgPrint(TRACE_LEVEL_ERROR, ("HWInit failed to allocate memory\n"));
-return Status;
-}
+Status = CheckHardware();
+if (NT_SUCCESS(Status)) {
+m_pHWDevice = new(NonPagedPoolNx) QxlDevice(this);
+}
+else {
+m_pHWDevice = new(NonPagedPoolNx) VgaDevice(this);
+}
 
-Status = m_pHWDevice->HWInit(m_DeviceInfo.TranslatedResourceList, 
_CurrentModes[0].DispInfo);
-if (!NT_SUCCESS(Status))
-{
-DbgPrint(TRACE_LEVEL_ERROR, ("HWInit failed with status 0x%X\n", 
Status));
-return Status;
-}
+if (!m_pHWDevice) {
+Status = STATUS_NO_MEMORY;
+DbgPrint(TRACE_LEVEL_ERROR, ("HWInit failed to allocate 
memory\n"));
+break;
+}
 
-Status = RegisterHWInfo(m_pHWDevice->GetId());
-if (!NT_SUCCESS(Status))
-{
-QXL_LOG_ASSERTION1("RegisterHWInfo failed with status 0x%X\n",
-   Status);
-return Status;
-}
+Status = m_pHWDevice->HWInit(m_DeviceInfo.TranslatedResourceList, 
_CurrentModes[0].DispInfo);
+if (!NT_SUCCESS(Status)) {
+DbgPrint(TRACE_LEVEL_ERROR, ("HWInit failed with status 0x%X\n", 
Status));
+break;
+}
 
-PhysicAddress.QuadPart = m_CurrentModes[0].DispInfo.PhysicAddress.QuadPart;
-if (m_pHWDevice->GetId() == 0)
-{
- Status = 
m_DxgkInterface.DxgkCbAcquirePostDisplayOwnership(m_DxgkInterface.DeviceHandle, 
&(m_CurrentModes[0].DispInfo));
-}
+Status = RegisterHWInfo(m_pHWDevice->GetId());
+if (!NT_SUCCESS(Status)) {
+QXL_LOG_ASSERTION1("RegisterHWInfo failed with status 0x%X\n",
+Status);
+break;
+}
 
-if (!NT_SUCCESS(Status) )
-{
-DbgPrint(TRACE_LEVEL_ERROR, ("DxgkCbAcquirePostDisplayOwnership failed 
with status 0x%X Width = %d\n",
-   Status, m_CurrentModes[0].DispInfo.Width));
-return STATUS_UNSUCCESSFUL;
+PhysicAddress.QuadPart = 
m_CurrentModes[0].DispInfo.PhysicAddress.QuadPart;
+if (m_pHWDevice->GetId() == 0) {
+Status = 
m_DxgkInterface.DxgkCbAcquirePostDisplayOwnership(m_DxgkInterface.DeviceHandle, 
&(m_CurrentModes[0].DispInfo));
+}
+
+if (!NT_SUCCESS(Status)) {
+DbgPrint(TRACE_LEVEL_ERROR, ("DxgkCbAcquirePostDisplayOwnership 
failed with status 0x%X Width = %d\n",
+Status, m_CurrentModes[0].DispInfo.Width));
+Status = STATUS_UNSUCCESSFUL;
+break;
+}
+} while (0);
+if (!NT_SUCCESS(Status)) {
+m_Flags.DriverStarted = FALSE;
+return Status;
 }
 
-if (m_CurrentModes[0].DispInfo.Width == 0)
-{
-

[Spice-devel] [RFC PATCH qxl-wddm-dod 16/28] Enable HW cursor support and fix handling of monochrome cursors.

2016-07-18 Thread Dmitry Fleytman
From: Sandy Stutsman 

* Turn on enable pointer
* Allow for 1bpp bitmap followed by 1bpp XOR map.
---
 qxldod/QxlDod.cpp | 19 +++
 qxldod/QxlDod.h   |  2 +-
 2 files changed, 12 insertions(+), 9 deletions(-)

diff --git a/qxldod/QxlDod.cpp b/qxldod/QxlDod.cpp
index ff987c4..3139092 100755
--- a/qxldod/QxlDod.cpp
+++ b/qxldod/QxlDod.cpp
@@ -4383,6 +4383,7 @@ NTSTATUS  QxlDevice::SetPointerShape(_In_ CONST 
DXGKARG_SETPOINTERSHAPE* pSetPoi
 UINT8 *now;
 UINT8 *end;
 int line_size;
+int num_images = 1;
 
 cursor_cmd = CursorCmd();
 cursor_cmd->type = QXL_CURSOR_SET;
@@ -4405,16 +4406,17 @@ NTSTATUS  QxlDevice::SetPointerShape(_In_ CONST 
DXGKARG_SETPOINTERSHAPE* pSetPoi
 cursor->header.width = (UINT16)pSetPointerShape->Width;
 cursor->header.height = (UINT16)pSetPointerShape->Height;
 if (cursor->header.type == SPICE_CURSOR_TYPE_MONO) {
-cursor->header.height >>= 1;
 line_size = ALIGN(cursor->header.width, 8) >> 3;
+cursor->data_size = line_size * pSetPointerShape->Height * 2;
+num_images = 2;
 } else {
 line_size = cursor->header.width << 2;
+cursor->data_size = line_size * pSetPointerShape->Height;
 }
 
 cursor->header.hot_spot_x = (UINT16)pSetPointerShape->XHot;
 cursor->header.hot_spot_y = (UINT16)pSetPointerShape->YHot;
 
-cursor->data_size = line_size * pSetPointerShape->Height;
 DbgPrint(TRACE_LEVEL_INFORMATION, ("<--> %s %d::%d::%d::%d::%d\n", 
__FUNCTION__, cursor->header.width, cursor->header.height, 
cursor->header.hot_spot_x, cursor->header.hot_spot_y, cursor->data_size));
 
 chunk = >chunk;
@@ -4426,7 +4428,7 @@ NTSTATUS  QxlDevice::SetPointerShape(_In_ CONST 
DXGKARG_SETPOINTERSHAPE* pSetPoi
 now = chunk->data;
 end = (UINT8 *)res + CURSOR_ALLOC_SIZE;
 
-src_end = src + (pSetPointerShape->Pitch * pSetPointerShape->Height);
+src_end = src + (pSetPointerShape->Pitch * pSetPointerShape->Height * 
num_images);
 for (; src != src_end; src += pSetPointerShape->Pitch) {
 PutBytesAlign(, , , src, line_size,
  PAGE_SIZE, 1);
@@ -4449,14 +4451,15 @@ NTSTATUS QxlDevice::SetPointerPosition(_In_ CONST 
DXGKARG_SETPOINTERPOSITION* pS
  pSetPointerPosition->VidPnSourceId,
  pSetPointerPosition->X,
  pSetPointerPosition->Y));
-if (EnablePointer()) {
+if (!EnablePointer()) {
 QXLCursorCmd *cursor_cmd = CursorCmd();
 if (pSetPointerPosition->X < 0) {
cursor_cmd->type = QXL_CURSOR_HIDE;
-} else {
-   cursor_cmd->type = QXL_CURSOR_MOVE;
-   cursor_cmd->u.position.x = (INT16)pSetPointerPosition->X;
-   cursor_cmd->u.position.y = (INT16)pSetPointerPosition->Y;
+}
+else {
+cursor_cmd->type = QXL_CURSOR_MOVE;
+cursor_cmd->u.position.x = (INT16) pSetPointerPosition->X;
+cursor_cmd->u.position.y = (INT16) pSetPointerPosition->Y;
 }
 PushCursorCmd(cursor_cmd);
 }
diff --git a/qxldod/QxlDod.h b/qxldod/QxlDod.h
index 8ecae19..9bc0bdb 100755
--- a/qxldod/QxlDod.h
+++ b/qxldod/QxlDod.h
@@ -462,7 +462,7 @@ public:
 NTSTATUS SetPowerState(DEVICE_POWER_STATE DevicePowerState, 
DXGK_DISPLAY_INFORMATION* pDispInfo);
 NTSTATUS HWInit(PCM_RESOURCE_LIST pResList, DXGK_DISPLAY_INFORMATION* 
pDispInfo);
 NTSTATUS HWClose(void);
-BOOLEAN EnablePointer(void) { return FALSE; }
+BOOLEAN EnablePointer(void) { return TRUE; }
 NTSTATUS ExecutePresentDisplayOnly(_In_ BYTE* DstAddr,
 _In_ UINT  DstBitPerPixel,
 _In_ BYTE* SrcAddr,
-- 
1.8.3.1

___
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/spice-devel


[Spice-devel] [RFC PATCH qxl-wddm-dod 04/28] Fix Code Integrity error generated by the Drive Verifier

2016-07-18 Thread Dmitry Fleytman
From: Sandy Stutsman 

Add MdlMappingNoExecute to MmGetSystemAddressForMDLSafe call in
ExecutePresentDisplayOnly.
---
 qxldod/QxlDod.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/qxldod/QxlDod.cpp b/qxldod/QxlDod.cpp
index 77f4f86..1225f04 100755
--- a/qxldod/QxlDod.cpp
+++ b/qxldod/QxlDod.cpp
@@ -2720,7 +2720,7 @@ VgaDevice::ExecutePresentDisplayOnly(
 // Note: double mapping the buffer this way causes lot of system
 // overhead for large size buffers.
 ctx->SrcAddr = reinterpret_cast
-(MmGetSystemAddressForMdlSafe(mdl, NormalPagePriority ));
+(MmGetSystemAddressForMdlSafe(mdl, NormalPagePriority | 
MdlMappingNoExecute));
 
 if(!ctx->SrcAddr) {
 Status = STATUS_INSUFFICIENT_RESOURCES;
@@ -3619,7 +3619,7 @@ QxlDevice::ExecutePresentDisplayOnly(
 // Note: double mapping the buffer this way causes lot of system
 // overhead for large size buffers.
 ctx->SrcAddr = reinterpret_cast
-(MmGetSystemAddressForMdlSafe(mdl, NormalPagePriority ));
+(MmGetSystemAddressForMdlSafe(mdl, NormalPagePriority | 
MdlMappingNoExecute));
 
 if(!ctx->SrcAddr) {
 Status = STATUS_INSUFFICIENT_RESOURCES;
-- 
1.8.3.1

___
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/spice-devel


[Spice-devel] [RFC PATCH qxl-wddm-dod 10/28] Add arbitrary resolution and monitors_config Escape

2016-07-18 Thread Dmitry Fleytman
From: Sandy Stutsman 

Implement the escapes for the qxl driver and add some debug output for multiple 
monitor support
---
 qxldod/QxlDod.cpp| 162 ++-
 qxldod/QxlDod.h  |  11 ++-
 qxldod/include/qxl_windows.h |   1 +
 3 files changed, 124 insertions(+), 50 deletions(-)

diff --git a/qxldod/QxlDod.cpp b/qxldod/QxlDod.cpp
index 0ee45a9..a1718a4 100755
--- a/qxldod/QxlDod.cpp
+++ b/qxldod/QxlDod.cpp
@@ -47,6 +47,14 @@ BYTE PixelMask[BITS_PER_BYTE]  = {0x80, 0x40, 0x20, 0x10, 
0x08, 0x04, 0x02, 0x01
((ULONG)LOWER_5_BITS((Pixel)) << 
SHIFT_LOWER_5_IN_565_BACK))
 
 
+typedef struct _QXL_ESCAPE {
+int ioctl;
+union {
+QXLEscapeSetCustomDisplay custom_display;
+QXLHead monitor_config;
+};
+}QXL_ESCAPE;
+
 #pragma code_seg(pop)
 
 #pragma code_seg("PAGE")
@@ -474,19 +482,7 @@ NTSTATUS QxlDod::Escape(_In_ CONST DXGKARG_ESCAPE* pEscape)
 DbgPrint(TRACE_LEVEL_VERBOSE, ("<---> %s Flags = %d\n", __FUNCTION__, 
pEscape->Flags));
 
 Status = m_pHWDevice->Escape(pEscape);
-if (Status == STATUS_SUCCESS)
-{
-DXGK_CHILD_STATUS ChildStatus;
-ChildStatus.Type = StatusConnection;
-ChildStatus.ChildUid = 0;
-ChildStatus.HotPlug.Connected = FALSE;
-Status = 
m_DxgkInterface.DxgkCbIndicateChildStatus(m_DxgkInterface.DeviceHandle, 
);
-if (Status == STATUS_SUCCESS)
-{
-ChildStatus.HotPlug.Connected = TRUE;
-Status = 
m_DxgkInterface.DxgkCbIndicateChildStatus(m_DxgkInterface.DeviceHandle, 
);
-}
-}
+
 DbgPrint(TRACE_LEVEL_VERBOSE, ("<---> %s Status = %x\n", __FUNCTION__, 
Status));
 return Status;
 }
@@ -613,7 +609,7 @@ NTSTATUS QxlDod::QueryVidPnHWCapability(_Inout_ 
DXGKARG_QUERYVIDPNHWCAPABILITY*
 NTSTATUS QxlDod::IsSupportedVidPn(_Inout_ DXGKARG_ISSUPPORTEDVIDPN* 
pIsSupportedVidPn)
 {
 PAGED_CODE();
-DbgPrint(TRACE_LEVEL_VERBOSE, ("---> %s\n", __FUNCTION__));
+DbgPrint(TRACE_LEVEL_VERBOSE, ("---> %s %d\n", __FUNCTION__, 
m_pHWDevice->Id()));
 
 QXL_ASSERT(pIsSupportedVidPn != NULL);
 
@@ -935,7 +931,7 @@ NTSTATUS QxlDod::EnumVidPnCofuncModality(_In_ CONST 
DXGKARG_ENUMVIDPNCOFUNCMODAL
 PAGED_CODE();
 
 QXL_ASSERT(pEnumCofuncModality != NULL);
-DbgPrint(TRACE_LEVEL_VERBOSE, ("---> %s\n", __FUNCTION__));
+DbgPrint(TRACE_LEVEL_VERBOSE, ("---> %s device %d\n", __FUNCTION__, 
m_pHWDevice->Id()));
 
 D3DKMDT_HVIDPNTOPOLOGY   hVidPnTopology = 0;
 D3DKMDT_HVIDPNSOURCEMODESET  hVidPnSourceModeSet = 0;
@@ -1291,7 +1287,7 @@ NTSTATUS QxlDod::EnumVidPnCofuncModality(_In_ CONST 
DXGKARG_ENUMVIDPNCOFUNCMODAL
 NTSTATUS QxlDod::SetVidPnSourceVisibility(_In_ CONST 
DXGKARG_SETVIDPNSOURCEVISIBILITY* pSetVidPnSourceVisibility)
 {
 PAGED_CODE();
-DbgPrint(TRACE_LEVEL_VERBOSE, ("---> %s\n", __FUNCTION__));
+DbgPrint(TRACE_LEVEL_VERBOSE, ("---> %s %d\n", __FUNCTION__, 
m_pHWDevice->Id()));
 QXL_ASSERT(pSetVidPnSourceVisibility != NULL);
 QXL_ASSERT((pSetVidPnSourceVisibility->VidPnSourceId < MAX_VIEWS) ||
(pSetVidPnSourceVisibility->VidPnSourceId == D3DDDI_ID_ALL));
@@ -3120,17 +3116,20 @@ NTSTATUS QxlDevice::QueryCurrentMode(PVIDEO_MODE 
RequestedMode)
 
 NTSTATUS QxlDevice::SetCurrentMode(ULONG Mode)
 {
-DbgPrint(TRACE_LEVEL_VERBOSE, ("---> %s Mode = %x\n", __FUNCTION__, Mode));
+DbgPrint(TRACE_LEVEL_INFORMATION, ("---> %s - %d: Mode = %d\n", 
__FUNCTION__, m_Id, Mode));
 for (ULONG idx = 0; idx < GetModeCount(); idx++)
 {
 if (Mode == m_ModeNumbers[idx])
 {
 DestroyPrimarySurface();
 CreatePrimarySurface(_ModeInfo[idx]);
+DbgPrint(TRACE_LEVEL_INFORMATION, ("%s device %d: setting current 
mode %d (%d x %d)\n",
+__FUNCTION__, m_Id, Mode, m_ModeInfo[idx].VisScreenWidth,
+m_ModeInfo[idx].VisScreenHeight));
 return STATUS_SUCCESS;
 }
 }
-DbgPrint(TRACE_LEVEL_VERBOSE, ("<--- %s\n", __FUNCTION__));
+DbgPrint(TRACE_LEVEL_VERBOSE, ("<--- %s failed\n", __FUNCTION__));
 return STATUS_UNSUCCESSFUL;
 }
 
@@ -3328,6 +3327,7 @@ NTSTATUS QxlDevice::QxlInit(DXGK_DISPLAY_INFORMATION* 
pDispInfo)
 m_RamHdr->int_mask = WIN_QXL_INT_MASK;
 CreateMemSlots();
 InitDeviceMemoryResources();
+InitMonitorConfig();
 return Status;
 }
 
@@ -3393,7 +3393,8 @@ void QxlDevice::DestroyMemSlots(void)
 void QxlDevice::CreatePrimarySurface(PVIDEO_MODE_INFORMATION pModeInfo)
 {
 QXLSurfaceCreate *primary_surface_create;
-DbgPrint(TRACE_LEVEL_VERBOSE, ("---> %s\n", __FUNCTION__));
+DbgPrint(TRACE_LEVEL_INFORMATION, ("---> %s - %d: (%d x %d)\n", 
__FUNCTION__, m_Id, 
+pModeInfo->VisScreenWidth, pModeInfo->VisScreenHeight));
 primary_surface_create = _RamHdr->create_surface;
 primary_surface_create->format = pModeInfo->BitsPerPlane;
   

[Spice-devel] [RFC PATCH qxl-wddm-dod 24/28] Fixing framebuffer usage logic

2016-07-18 Thread Dmitry Fleytman
This patch fixes 2 issues:

  1. Framebuffer should only be used in vga mode,
 therefore when QxlDevice is active
 FrameBufferIsActive flag shouldn't be checked;
  2. FrameBufferIsActive flag should be set true
 on successfull frame buffer allocation only.

Signed-off-by: Sameeh Jubran <sam...@daynix.com>
Signed-off-by: Dmitry Fleytman <dmi...@daynix.com>
---
 qxldod/QxlDod.cpp | 101 ++
 1 file changed, 49 insertions(+), 52 deletions(-)

diff --git a/qxldod/QxlDod.cpp b/qxldod/QxlDod.cpp
index a550306..a34c728 100755
--- a/qxldod/QxlDod.cpp
+++ b/qxldod/QxlDod.cpp
@@ -512,40 +512,37 @@ NTSTATUS QxlDod::PresentDisplayOnly(_In_ CONST 
DXGKARG_PRESENT_DISPLAYONLY* pPre
 return STATUS_SUCCESS;
 }
 
-if 
(m_CurrentModes[pPresentDisplayOnly->VidPnSourceId].Flags.FrameBufferIsActive)
-{
-
-// If actual pixels are coming through, will need to completely zero 
out physical address next time in BlackOutScreen
-
m_CurrentModes[pPresentDisplayOnly->VidPnSourceId].ZeroedOutStart.QuadPart = 0;
-
m_CurrentModes[pPresentDisplayOnly->VidPnSourceId].ZeroedOutEnd.QuadPart = 0;
 
-
-D3DKMDT_VIDPN_PRESENT_PATH_ROTATION RotationNeededByFb = 
pPresentDisplayOnly->Flags.Rotate ?
- 
m_CurrentModes[pPresentDisplayOnly->VidPnSourceId].Rotation :
- 
D3DKMDT_VPPR_IDENTITY;
-BYTE* pDst = 
(BYTE*)m_CurrentModes[pPresentDisplayOnly->VidPnSourceId].FrameBuffer.Ptr;
-UINT DstBitPerPixel = 
BPPFromPixelFormat(m_CurrentModes[pPresentDisplayOnly->VidPnSourceId].DispInfo.ColorFormat);
-if (m_CurrentModes[pPresentDisplayOnly->VidPnSourceId].Scaling == 
D3DKMDT_VPPS_CENTERED)
-{
-UINT CenterShift = 
(m_CurrentModes[pPresentDisplayOnly->VidPnSourceId].DispInfo.Height -
-
m_CurrentModes[pPresentDisplayOnly->VidPnSourceId].SrcModeHeight)*m_CurrentModes[pPresentDisplayOnly->VidPnSourceId].DispInfo.Pitch;
-CenterShift += 
(m_CurrentModes[pPresentDisplayOnly->VidPnSourceId].DispInfo.Width -
-
m_CurrentModes[pPresentDisplayOnly->VidPnSourceId].SrcModeWidth)*DstBitPerPixel/8;
-pDst += (int)CenterShift/2;
-}
-Status = m_pHWDevice->ExecutePresentDisplayOnly(
-pDst,
-DstBitPerPixel,
-(BYTE*)pPresentDisplayOnly->pSource,
-pPresentDisplayOnly->BytesPerPixel,
-pPresentDisplayOnly->Pitch,
-pPresentDisplayOnly->NumMoves,
-pPresentDisplayOnly->pMoves,
-pPresentDisplayOnly->NumDirtyRects,
-pPresentDisplayOnly->pDirtyRect,
-RotationNeededByFb,
-_CurrentModes[0]);
-}
+// If actual pixels are coming through, will need to completely zero out 
physical address next time in BlackOutScreen
+m_CurrentModes[pPresentDisplayOnly->VidPnSourceId].ZeroedOutStart.QuadPart 
= 0;
+m_CurrentModes[pPresentDisplayOnly->VidPnSourceId].ZeroedOutEnd.QuadPart = 
0;
+
+
+D3DKMDT_VIDPN_PRESENT_PATH_ROTATION RotationNeededByFb = 
pPresentDisplayOnly->Flags.Rotate ?
+ 
m_CurrentModes[pPresentDisplayOnly->VidPnSourceId].Rotation :
+ 
D3DKMDT_VPPR_IDENTITY;
+BYTE* pDst = 
(BYTE*)m_CurrentModes[pPresentDisplayOnly->VidPnSourceId].FrameBuffer.Ptr;
+UINT DstBitPerPixel = 
BPPFromPixelFormat(m_CurrentModes[pPresentDisplayOnly->VidPnSourceId].DispInfo.ColorFormat);
+if (m_CurrentModes[pPresentDisplayOnly->VidPnSourceId].Scaling == 
D3DKMDT_VPPS_CENTERED)
+{
+UINT CenterShift = 
(m_CurrentModes[pPresentDisplayOnly->VidPnSourceId].DispInfo.Height -
+
m_CurrentModes[pPresentDisplayOnly->VidPnSourceId].SrcModeHeight)*m_CurrentModes[pPresentDisplayOnly->VidPnSourceId].DispInfo.Pitch;
+CenterShift += 
(m_CurrentModes[pPresentDisplayOnly->VidPnSourceId].DispInfo.Width -
+
m_CurrentModes[pPresentDisplayOnly->VidPnSourceId].SrcModeWidth)*DstBitPerPixel/8;
+pDst += (int)CenterShift/2;
+}
+Status = m_pHWDevice->ExecutePresentDisplayOnly(
+pDst,
+DstBitPerPixel,
+(BYTE*)pPresentDisplayOnly->pSource,
+pPresentDisplayOnly->BytesPerPixel,
+pPresentDisplayOnly->Pitch,
+pPresentDisplayOnly->NumMoves,
+pPresentDisplayOnly-

[Spice-devel] [RFC PATCH qxl-wddm-dod 09/28] Remove unused notify present display only interrupt and fix interrupt mask

2016-07-18 Thread Dmitry Fleytman
From: Sandy Stutsman 

This interrupt is used for asynchronous present calls.
Fixed the interrupt mask to reflect currently used interrupts.
---
 qxldod/QxlDod.cpp | 22 +++---
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/qxldod/QxlDod.cpp b/qxldod/QxlDod.cpp
index 7b60e0c..0ee45a9 100755
--- a/qxldod/QxlDod.cpp
+++ b/qxldod/QxlDod.cpp
@@ -4,6 +4,11 @@
 
 #pragma code_seg(push)
 #pragma code_seg()
+
+#define WIN_QXL_INT_MASK ((QXL_INTERRUPT_DISPLAY) | \
+  (QXL_INTERRUPT_CURSOR) | \
+  (QXL_INTERRUPT_IO_CMD)) 
+
 // BEGIN: Non-Paged Code
 
 // Bit is 1 from Idx to end of byte, with bit count starting at high order
@@ -3320,7 +3325,7 @@ NTSTATUS QxlDevice::QxlInit(DXGK_DISPLAY_INFORMATION* 
pDispInfo)
 
 WRITE_PORT_UCHAR((PUCHAR)(m_IoBase + QXL_IO_RESET), 0);
 CreateRings();
-m_RamHdr->int_mask = ~0;
+m_RamHdr->int_mask = WIN_QXL_INT_MASK;
 CreateMemSlots();
 InitDeviceMemoryResources();
 return Status;
@@ -4514,17 +4519,12 @@ BOOLEAN QxlDevice::HWInterruptRoutine(_In_ 
PDXGKRNL_INTERFACE pDxgkInterface, _I
 WRITE_PORT_UCHAR((PUCHAR)(m_IoBase + QXL_IO_UPDATE_IRQ), 0);
 m_Pending |= m_RamHdr->int_pending;
 m_RamHdr->int_pending = 0;
-
-DXGKARGCB_NOTIFY_INTERRUPT_DATA  notifyInt;
-notifyInt.InterruptType = DXGK_INTERRUPT_DISPLAYONLY_PRESENT_PROGRESS;
-notifyInt.DisplayOnlyPresentProgress.VidPnSourceId = 0;
-
-
pDxgkInterface->DxgkCbNotifyInterrupt(pDxgkInterface->DeviceHandle,);
 if (!pDxgkInterface->DxgkCbQueueDpc(pDxgkInterface->DeviceHandle)) {
-m_RamHdr->int_mask = ~0;
-WRITE_PORT_UCHAR((PUCHAR)(m_IoBase + QXL_IO_UPDATE_IRQ), 0);
+m_RamHdr->int_mask = WIN_QXL_INT_MASK;
+WRITE_PORT_UCHAR((PUCHAR) (m_IoBase + QXL_IO_UPDATE_IRQ), 0);
 DbgPrint(TRACE_LEVEL_FATAL, ("---> %s DxgkCbQueueDpc failed\n", 
__FUNCTION__));
 }
+DbgPrint(TRACE_LEVEL_VERBOSE, ("<--- %s\n", __FUNCTION__));
 return TRUE;
 }
 
@@ -4554,7 +4554,7 @@ VOID QxlDevice::HWDpcRoutine(PDXGKRNL_INTERFACE 
pDxgkInterface)
 DbgPrint(TRACE_LEVEL_INFORMATION, ("---> %s m_IoCmdEvent\n", 
__FUNCTION__));
 KeSetEvent (_IoCmdEvent, IO_NO_INCREMENT, FALSE);
 }
-m_RamHdr->int_mask = ~0;
+m_RamHdr->int_mask = WIN_QXL_INT_MASK;
 WRITE_PORT_UCHAR((PUCHAR)(m_IoBase + QXL_IO_UPDATE_IRQ), 0);
 
 DbgPrint(TRACE_LEVEL_INFORMATION, ("<--- %s\n", __FUNCTION__));
@@ -4563,7 +4563,7 @@ VOID QxlDevice::HWDpcRoutine(PDXGKRNL_INTERFACE 
pDxgkInterface)
 void QxlDevice::HWResetDevice(void)
 {
 DbgPrint(TRACE_LEVEL_VERBOSE, ("---> %s\n", __FUNCTION__));
-m_RamHdr->int_mask = ~0;
+m_RamHdr->int_mask = WIN_QXL_INT_MASK;
 WRITE_PORT_UCHAR(m_IoBase + QXL_IO_MEMSLOT_ADD, 0);
 DbgPrint(TRACE_LEVEL_VERBOSE, ("<--- %s\n", __FUNCTION__));
 }
-- 
1.8.3.1

___
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/spice-devel


[Spice-devel] [RFC PATCH qxl-wddm-dod 14/28] Comment out frame buffer mapping.

2016-07-18 Thread Dmitry Fleytman
From: Sandy Stutsman 

WDDM DOD driver doesn't touch the frame buffer (bar0), so no reason to map in 
into memory.
Especially as there were rare BSOD failures when the mapping failed.  Leaving 
the code
in place so it clear where the frame buffer should be mapped if we need to do 
it in the future.
---
 qxldod/QxlDod.cpp | 8 ++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/qxldod/QxlDod.cpp b/qxldod/QxlDod.cpp
index e6c4ada..ff987c4 100755
--- a/qxldod/QxlDod.cpp
+++ b/qxldod/QxlDod.cpp
@@ -218,7 +218,9 @@ VOID QxlDod::CleanUp(VOID)
 {
 if (m_CurrentModes[Source].FrameBuffer.Ptr)
 {
+#ifdef USE_FRAMEBUFFER
 UnmapFrameBuffer(m_CurrentModes[Source].FrameBuffer.Ptr, 
m_CurrentModes[Source].DispInfo.Height * m_CurrentModes[Source].DispInfo.Pitch);
+#endif
 m_CurrentModes[Source].FrameBuffer.Ptr = NULL;
 m_CurrentModes[Source].Flags.FrameBufferIsActive = FALSE;
 }
@@ -1393,8 +1395,10 @@ NTSTATUS QxlDod::CommitVidPn(_In_ CONST 
DXGKARG_COMMITVIDPN* CONST pCommitVidPn)
 if (m_CurrentModes[pCommitVidPn->AffectedVidPnSourceId].FrameBuffer.Ptr &&
 
!m_CurrentModes[pCommitVidPn->AffectedVidPnSourceId].Flags.DoNotMapOrUnmap)
 {
+#ifdef USE_FRAMEBUFFER
 Status = 
UnmapFrameBuffer(m_CurrentModes[pCommitVidPn->AffectedVidPnSourceId].FrameBuffer.Ptr,
   
m_CurrentModes[pCommitVidPn->AffectedVidPnSourceId].DispInfo.Pitch * 
m_CurrentModes[pCommitVidPn->AffectedVidPnSourceId].DispInfo.Height);
+#endif
 m_CurrentModes[pCommitVidPn->AffectedVidPnSourceId].FrameBuffer.Ptr = 
NULL;
 
m_CurrentModes[pCommitVidPn->AffectedVidPnSourceId].Flags.FrameBufferIsActive = 
FALSE;
 
@@ -1521,7 +1525,7 @@ NTSTATUS QxlDod::SetSourceModeAndPath(CONST 
D3DKMDT_VIDPN_SOURCE_MODE* pSourceMo
 pCurrentBddMode->DispInfo.Height = 
pSourceMode->Format.Graphics.PrimSurfSize.cy;
 pCurrentBddMode->DispInfo.Pitch = 
pSourceMode->Format.Graphics.PrimSurfSize.cx * 
BPPFromPixelFormat(pCurrentBddMode->DispInfo.ColorFormat) / BITS_PER_BYTE;
 
-
+#ifdef USE_FRAMEBUFFER
 if (!pCurrentBddMode->Flags.DoNotMapOrUnmap)
 {
 // Map the new frame buffer
@@ -1530,7 +1534,7 @@ NTSTATUS QxlDod::SetSourceModeAndPath(CONST 
D3DKMDT_VIDPN_SOURCE_MODE* pSourceMo
 pCurrentBddMode->DispInfo.Pitch * 
pCurrentBddMode->DispInfo.Height,
 &(pCurrentBddMode->FrameBuffer.Ptr));
 }
-
+#endif
 if (NT_SUCCESS(Status))
 {
 
-- 
1.8.3.1

___
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/spice-devel


[Spice-devel] [RFC PATCH qxl-wddm-dod 18/28] Unify build output directories

2016-07-18 Thread Dmitry Fleytman
Signed-off-by: Dmitry Fleytman <dmi...@daynix.com>
---
 qxldod Package/qxldod Package.vcxproj  | 81 ++--
 qxldod Package/qxldod Package.vcxproj.user | 15 ++
 qxldod.sln | 69 +++-
 qxldod/qxldod.vcxproj  | 87 --
 qxldod/qxldod.vcxproj.user | 15 ++
 5 files changed, 221 insertions(+), 46 deletions(-)
 create mode 100644 qxldod Package/qxldod Package.vcxproj.user
 create mode 100644 qxldod/qxldod.vcxproj.user

diff --git a/qxldod Package/qxldod Package.vcxproj b/qxldod Package/qxldod 
Package.vcxproj
index 76fb33b..a0c0cb8 100755
--- a/qxldod Package/qxldod Package.vcxproj 
+++ b/qxldod Package/qxldod Package.vcxproj 
@@ -1,20 +1,28 @@
 
 http://schemas.microsoft.com/developer/msbuild/2003;>
   
-
-  Win10 Debug
+
+  Win10Debug_NoSign
   Win32
 
-
-  Win10 Debug
+
+  Win10Debug_NoSign
   x64
 
-
-  Win10 Release
+
+  Win10Debug
   Win32
 
-
-  Win10 Release
+
+  Win10Debug
+  x64
+
+
+  Win10Release
+  Win32
+
+
+  Win10Release
   x64
 
   
@@ -29,6 +37,8 @@
   
 qxldod_Package
 $(VCTargetsPath11)
+
$(LatestTargetPlatformVersion)
+qxldod_Package
   
   
 Utility
@@ -36,25 +46,35 @@
 true
   
   
-  
+  
 
 
 false
 WindowsKernelModeDriver10.0
   
-  
+  
+
+false
+WindowsKernelModeDriver10.0
+  
+  
 
 
 false
 WindowsKernelModeDriver10.0
   
-  
+  
 
 
 false
 WindowsKernelModeDriver10.0
   
-  
+  
+
+false
+WindowsKernelModeDriver10.0
+  
+  
 
 
 false
@@ -67,7 +87,9 @@
 
   
   
-  
+  
+$(SolutionDir)\build\$(Platform)\$(ConfigurationName)\
+  
   
 DbgengKernelDebugger
 False
@@ -81,22 +103,47 @@
 
 133563
   
-  
+  
+$(SolutionDir)\build\$(Platform)\$(ConfigurationName)\
+  
+  
+$(SolutionDir)\build\$(Platform)\$(ConfigurationName)\
+  
+  
+$(SolutionDir)\build\$(Platform)\$(ConfigurationName)\
+  
+  
+$(SolutionDir)\build\$(Platform)\$(ConfigurationName)\
+  
+  
+$(SolutionDir)\build\$(Platform)\$(ConfigurationName)\
+  
+  
+
+  
8_x64,Server8_x64,Server6_3_x64,6_3_x64
+
+  
+  
+
+  
8_x64,Server8_x64,Server6_3_x64,6_3_x64
+
+  
+  
 
   
8_x64,Server8_x64,Server6_3_x64,6_3_x64
 
   
-  
+  
 
   
8_x64,Server8_x64,Server6_3_x64,6_3_x64
 
   
-  
+  
 
   
8_x64,Server8_x64,Server6_3_x64,6_3_x64
 
   
-  
+  
 
   
8_x64,Server8_x64,Server6_3_x64,6_3_x64
 
diff --git a/qxldod Package/qxldod Package.vcxproj.user b/qxldod Package/qxldod 
Package.vcxproj.user
new file mode 100644
index 000..14b3bb5
--- /dev/null
+++ b/qxldod Package/qxldod Package.vcxproj.user
@@ -0,0 +1,15 @@
+
+http://schemas.microsoft.com/developer/msbuild/2003;>
+  
+Off
+  
+  
+Off
+  
+  
+Off
+  
+  
+Off
+  
+
\ No newline at end of file
diff --git a/qxldod.sln b/qxldod.sln
index 5b79b02..5989215 100755
--- a/qxldod.sln
+++ b/qxldod.sln
@@ -1,10 +1,10 @@
 Microsoft Visual Studio Solution File, Format Version 12.00
 # Visual Studio 14
-VisualStudioVersion = 14.0.23107.0
+VisualStudioVersion = 14.0.25123.0
 MinimumVisualStudioVersion = 10.0.40219.1
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "qxldod", 
"qxldod\qxldod.vcxproj", "{A6F48FC7-97E9-48EC-BCDF-1E4F9B43AADD}"
 EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "qxldod Package", "qxldod 
Package\qxldod Package.vcxproj", "{B8C04B51-4207-491D-A7DD-C54861E8B528}"
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "qxldod_Package", "qxldod 
Package\qxldod Package.vcxproj", "{B8C04B51-4207-491D-A7DD-C54861E8B528}"
ProjectSection(ProjectDependencies) = postProject
{A6F48FC7-97E9-48EC-BCDF-1E4F9B43AADD} = 
{A6F48FC7-97E9-48EC-BCDF-1E4F9B43AADD}
EndProjectSection
@@ -13,31 +13,50 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = 
"Solution Items", "Solution
 EndProject
 Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
-   Win10 Debug|Win32 = Win10 Debug|Win32
-   Win10 Debug|x64 = Win10 Debug|x64
-   Win10 Release|Win32 = Win10 Release|Win32
-   Win10 Release|x64 = Win10 Release|x64
+   Win10Debug_NoSign|Win32 = Win10Debug_NoSign|Win32
+   Win10Debug_NoSign|x64 = Win10Debug_NoSign|x64
+   Win10Debug|Win32 = Win10Debug|Win32
+   Win10Debug|x64 = Win10Debug|x64
+   Win10Release|Win32 = Win10Release|Win32
+   Win10Release|x64 = Win10Release|x64
EndGlobalSection
Globa

[Spice-devel] [RFC PATCH qxl-wddm-dod 28/28] Fixing Move rectangles implementation

2016-07-18 Thread Dmitry Fleytman
From: Sameeh Jubran <sam...@daynix.com>

As documented in MSDN, "DxgkDdiPresentDisplayOnly" should copy
each "move rectangle" from a given source point in the source buffer
to the destination. The current implementation dosen't take into account
the shift of the given source point at all. This patch fixies the issue.

Signed-off-by: Sameeh Jubran <sam...@daynix.com>
Signed-off-by: Dmitry Fleytman <dmi...@daynix.com>
---
 qxldod/QxlDod.cpp | 17 -
 qxldod/QxlDod.h   |  3 ++-
 2 files changed, 14 insertions(+), 6 deletions(-)

diff --git a/qxldod/QxlDod.cpp b/qxldod/QxlDod.cpp
index 0ec00fe..4c3835c 100755
--- a/qxldod/QxlDod.cpp
+++ b/qxldod/QxlDod.cpp
@@ -3748,20 +3748,26 @@ QxlDevice::ExecutePresentDisplayOnly(
 BltBits(,
 ,
 1,
-pDestRect);
+pDestRect,
+pSourcePoint);
 }
 
 // Copy all the dirty rects from source image to video frame buffer.
 for (UINT i = 0; i < ctx->NumDirtyRects; i++)
 {
 RECT*pDirtyRect = >DirtyRect[i];
+POINT   sourcePoint;
+sourcePoint.x = pDirtyRect->left;
+sourcePoint.y = pDirtyRect->top;
+
 DbgPrint(TRACE_LEVEL_INFORMATION, ("--- %d pDirtyRect->bottom = %ld, 
pDirtyRect->left = %ld, pDirtyRect->right = %ld, pDirtyRect->top = %ld\n", 
 i, pDirtyRect->bottom, pDirtyRect->left, pDirtyRect->right, 
pDirtyRect->top));
 
 BltBits(,
 ,
 1,
-pDirtyRect);
+pDirtyRect,
+);
 }
 
 // Unmap unmap and unlock the pages.
@@ -4189,7 +4195,8 @@ VOID QxlDevice::BltBits (
 BLT_INFO* pDst,
 CONST BLT_INFO* pSrc,
 UINT  NumRects,
-_In_reads_(NumRects) CONST RECT *pRects)
+_In_reads_(NumRects) CONST RECT *pRects,
+POINT*   pSourcePoint)
 {
 PAGED_CODE();
 QXLDrawable *drawable;
@@ -4254,8 +4261,8 @@ VOID QxlDevice::BltBits (
 internal->image.bitmap.stride = line_size;
 
 UINT8* src = (UINT8*)pSrc->pBits+
-(pRect->top) * pSrc->Pitch +
-(pRect->left * 4);
+(pSourcePoint->y) * pSrc->Pitch +
+(pSourcePoint->x * 4);
 UINT8* src_end = src - pSrc->Pitch;
 src += pSrc->Pitch * (height - 1);
 UINT8* dest = chunk->data;
diff --git a/qxldod/QxlDod.h b/qxldod/QxlDod.h
index 0757648..5caa43c 100755
--- a/qxldod/QxlDod.h
+++ b/qxldod/QxlDod.h
@@ -487,7 +487,8 @@ protected:
 VOID BltBits (BLT_INFO* pDst,
 CONST BLT_INFO* pSrc,
 UINT  NumRects,
-_In_reads_(NumRects) CONST RECT *pRects);
+_In_reads_(NumRects) CONST RECT *pRects,
+POINT*   pSourcePoint);
 QXLDrawable *Drawable(UINT8 type,
 CONST RECT *area,
 CONST RECT *clip,
-- 
1.8.3.1

___
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/spice-devel


[Spice-devel] [RFC PATCH qxl-wddm-dod 02/28] Add printer class to dump debug print statements to kernel debugger output

2016-07-18 Thread Dmitry Fleytman
From: Sandy Stutsman 

Allows the usage of Kd_IHVVIDEO_Mask to control print level while debugging
---
 qxldod/driver.cpp | 24 +++-
 qxldod/driver.h   | 22 ++
 2 files changed, 41 insertions(+), 5 deletions(-)

diff --git a/qxldod/driver.cpp b/qxldod/driver.cpp
index 4d1913c..2098421 100755
--- a/qxldod/driver.cpp
+++ b/qxldod/driver.cpp
@@ -667,7 +667,29 @@ void DebugPrintFunc(const char *format, ...)
 va_start(list, format);
 vDbgPrintEx(DPFLTR_DEFAULT_ID, 9 | DPFLTR_MASK, format, list);
 }
+ULONG kd_debug_printer::_xlate [] = { 0, 0, 1, 2, 3 };
+
+kd_debug_printer::kd_debug_printer(ULONG level) : _off(FALSE)
+{
+if (!level || level > 5) {
+_off = TRUE;
+_level = 0x;
+
+}
+else {
+_level = _xlate[level - 1];
+}
+}
+
+void kd_debug_printer::print(const char * fmt, ...)
+{
+va_list list;
+va_start(list, fmt);
+if (_off) {
+return;
+}
+vDbgPrintEx(DPFLTR_IHVVIDEO_ID, _level, fmt, list);
+}
 #endif
 
 #pragma code_seg(pop) // End Non-Paged Code
-
diff --git a/qxldod/driver.h b/qxldod/driver.h
index e64c098..d7f7bf8 100755
--- a/qxldod/driver.h
+++ b/qxldod/driver.h
@@ -208,15 +208,29 @@ DodSystemDisplayWrite(
 _In_  UINT  PositionY);
 
 #if DBG
+class kd_debug_printer 
+{
+public:
+kd_debug_printer(ULONG level);
+void print(const char * fmt, ...);
+private:
+ULONG _level;
+BOOLEAN _off;
+static ULONG _xlate[6];
+ };
 
 extern int nDebugLevel;
 void DebugPrintFuncSerial(const char *format, ...);
 
-void DebugPrintFunc(const char *format, ...);
+void DebugPrintFunc(const char *format, ...);
+
+#define DbgPrint(level, line)   \
+if (level > nDebugLevel) {} \
+else {  \
+   DebugPrintFuncSerial line;   \
+ }  \
+ kd_debug_printer(level).print line
 
-#define DbgPrint(level, line) \
-if (level > nDebugLevel) {} \
-else DebugPrintFuncSerial line
 #else
 #define DbgPrint(level, line) 
 #endif
-- 
1.8.3.1

___
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/spice-devel


[Spice-devel] [RFC PATCH qxl-wddm-dod 00/28] Win10 support patches

2016-07-18 Thread Dmitry Fleytman
This series contains the latest patches to support Windows 10.

Current patches may be compiled and will work for Windows 10 only.
Visual Studio 2015 with Win10 WDK is required to compile this code.

This series is RFC and not intended for commit. The plan is to
rebase patches on top of current QXL upstream repository,
and restore backward compatibility with pre-Win10 OS versions.

Dmitry Fleytman (6):
  Unify build output directories
  Add simple build script
  Replacing <#ifdef USE_FRAMEBUFFER> with runtime logic
  Fixing framebuffer usage logic
  Support future Qxl revisions
  Set SupportNonVGA in QueryAdapterInfo callback

Sameeh Jubran (5):
  Adding ioctl operation for updating Vdagent state
  Fixing mouse pointer issue when Vdagent is off
  Replacing tabs with spaces
  Fix source buffer mapping in PresentDisplayOnly
  Fixing Move rectangles implementation

Sandy Stutsman (17):
  Upgrade to Windows 10 WDK
  Add printer class to dump debug print statements to kernel debugger
output
  Set DriverStarted flag at the begining of the StartDriver function
  Fix Code Integrity error generated by the Drive Verifier
  Add functions called from non-pageable functions to non-paged segments
  Do not use virtual functions for code that must not be paged
  On power wake call the init functions before setting the vidpn to
black.  Otherwise, BSOD.
  Use SrcPitch when calculating size of memory to map PresentDisplayOnly
  Remove unused notify present display only interrupt and fix interrupt
mask
  Add arbitrary resolution and monitors_config Escape
  Code Analysis clean up.
  Use the second bar (VRAM) for qxl command buffer.
  Set Allow Date, Time and Timestamp property for all builds/platforms
  Comment out frame buffer mapping.
  Fix up project configuration names to be consistent. (+1 squashed
commits)
  Enable HW cursor support and fix handling of monochrome cursors.
  Remove minimum size restrict for custom resolution. (+1 squashed
commits)

 Tools/vs_cmdline.vbs   |   23 +
 Tools/vs_run.bat   |   26 +
 buildAll.bat   |   15 +
 buildAll_NoSign.bat|   19 +
 qxldod Package/qxldod Package.vcxproj  |  173 +-
 qxldod Package/qxldod Package.vcxproj.user |   15 +
 qxldod.sln |  106 +-
 qxldod/BaseObject.cpp  |   11 +
 qxldod/BaseObject.h|1 +
 qxldod/QxlDod.cpp  | 1266 +--
 qxldod/QxlDod.h|   69 +-
 qxldod/buildAll.bat|   31 -
 qxldod/callVisualStudio.bat|   28 -
 qxldod/checkWin8Tools.bat  |8 -
 qxldod/clean.bat   |   12 -
 qxldod/driver.cpp  |   26 +-
 qxldod/driver.h|   22 +-
 qxldod/include/qxl_windows.h   |5 +
 qxldod/mspace.c| 2437 ---
 qxldod/mspace.cpp  | 2439 
 qxldod/qxldod.vcxproj  |  247 ++-
 qxldod/qxldod.vcxproj.filters  |2 +-
 qxldod/qxldod.vcxproj.user |   15 +
 23 files changed, 3628 insertions(+), 3368 deletions(-)
 create mode 100644 Tools/vs_cmdline.vbs
 create mode 100644 Tools/vs_run.bat
 create mode 100644 buildAll.bat
 create mode 100644 buildAll_NoSign.bat
 create mode 100644 qxldod Package/qxldod Package.vcxproj.user
 delete mode 100755 qxldod/buildAll.bat
 delete mode 100755 qxldod/callVisualStudio.bat
 delete mode 100755 qxldod/checkWin8Tools.bat
 delete mode 100755 qxldod/clean.bat
 delete mode 100755 qxldod/mspace.c
 create mode 100644 qxldod/mspace.cpp
 create mode 100644 qxldod/qxldod.vcxproj.user

-- 
1.8.3.1

___
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/spice-devel


[Spice-devel] [RFC PATCH qxl-wddm-dod 20/28] Adding ioctl operation for updating Vdagent state

2016-07-18 Thread Dmitry Fleytman
From: Sameeh Jubran <sam...@daynix.com>

This patch adds a new ioctl to the driver which allows Vdagent
to update it's current state. This allowas the driver to know
when Vdgaent is running and when it is off.

Signed-off-by: Sameeh Jubran <sam...@daynix.com>
Signed-off-by: Dmitry Fleytman <dmi...@daynix.com>
---
 qxldod/QxlDod.cpp| 17 +
 qxldod/QxlDod.h  |  3 +++
 qxldod/include/qxl_windows.h |  4 
 3 files changed, 24 insertions(+)

diff --git a/qxldod/QxlDod.cpp b/qxldod/QxlDod.cpp
index 74cd259..42c82e3 100755
--- a/qxldod/QxlDod.cpp
+++ b/qxldod/QxlDod.cpp
@@ -52,6 +52,7 @@ typedef struct _QXL_ESCAPE {
 union {
 QXLEscapeSetCustomDisplay custom_display;
 QXLHead monitor_config;
+QXLEscapeVDAgentRunning vdagent_running;
 };
 }QXL_ESCAPE;
 
@@ -2927,6 +2928,7 @@ QxlDevice::QxlDevice(_In_ QxlDod* pQxlDod) : 
HwDeviceInterface(pQxlDod)
 m_FreeOutputs = 0;
 m_Pending = 0;
 m_type = QXL_DEVICE;
+m_VDAgentRunning = FALSE;
 }
 
 QxlDevice::~QxlDevice(void)
@@ -4520,6 +4522,11 @@ void QxlDevice::SetMonitorConfig(QXLHead * 
monitor_config)
 m_monitor_config->heads[0].width, m_monitor_config->heads[0].height));
 AsyncIo(QXL_IO_MONITORS_CONFIG_ASYNC, 0);
 }
+void QxlDevice::SaveVDAgentState(QXLEscapeVDAgentRunning* vdagent_running)
+{
+PAGED_CODE();
+m_VDAgentRunning = (vdagent_running->running == 0) ? FALSE : TRUE;
+}
 
 NTSTATUS QxlDevice::Escape(_In_ CONST DXGKARG_ESCAPE* pEscape)
 {
@@ -4550,6 +4557,16 @@ NTSTATUS QxlDevice::Escape(_In_ CONST DXGKARG_ESCAPE* 
pEscape)
 status = STATUS_SUCCESS;
 break;
 }
+case QXL_ESCAPE_VDAGENT_RUNNING: {
+data_size += sizeof(QXLEscapeVDAgentRunning);
+if (pEscape->PrivateDriverDataSize != data_size) {
+status = STATUS_INVALID_BUFFER_SIZE;
+break;
+}
+SaveVDAgentState(>vdagent_running);
+status = STATUS_SUCCESS;
+break;
+}
 default:
 DbgPrint(TRACE_LEVEL_ERROR, ("%s: invalid Escape 0x%x\n", 
__FUNCTION__, pQXLEscape->ioctl));
 status = STATUS_INVALID_PARAMETER;
diff --git a/qxldod/QxlDod.h b/qxldod/QxlDod.h
index 9bc0bdb..6c5d0f8 100755
--- a/qxldod/QxlDod.h
+++ b/qxldod/QxlDod.h
@@ -551,8 +551,11 @@ private:
 NTSTATUS UpdateChildStatus(BOOLEAN connect);
 NTSTATUS SetCustomDisplay(QXLEscapeSetCustomDisplay* custom_display);
 void SetMonitorConfig(QXLHead* monitor_config);
+void SaveVDAgentState(QXLEscapeVDAgentRunning* vdagent_running);
 
 private:
+BOOLEAN m_VDAgentRunning;
+
 PUCHAR m_IoBase;
 BOOLEAN m_IoMapped;
 ULONG m_IoSize;
diff --git a/qxldod/include/qxl_windows.h b/qxldod/include/qxl_windows.h
index 1f97fb7..a7e108f 100755
--- a/qxldod/include/qxl_windows.h
+++ b/qxldod/include/qxl_windows.h
@@ -4,6 +4,7 @@
 enum {
 QXL_ESCAPE_SET_CUSTOM_DISPLAY = 0x10001,
 QXL_ESCAPE_MONITOR_CONFIG,
+QXL_ESCAPE_VDAGENT_RUNNING
 };
 
 typedef struct QXLEscapeSetCustomDisplay {
@@ -12,4 +13,7 @@ typedef struct QXLEscapeSetCustomDisplay {
 uint32_t bpp;
 } QXLEscapeSetCustomDisplay;
 
+typedef struct QXLEscapeVDAgentRunning {
+uint32_t running;
+} QXLEscapeVDAgentRunning;
 #endif /* _H_QXL_WINDOWS */
-- 
1.8.3.1

___
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/spice-devel


[Spice-devel] [RFC PATCH qxl-wddm-dod 15/28] Fix up project configuration names to be consistent. (+1 squashed commits)

2016-07-18 Thread Dmitry Fleytman
From: Sandy Stutsman 

Squashed commits:

[7336760] Fix up project configuration names to be consistent. (+1 squashed 
commits)

Squashed commits:

[b87ec38] Fix up project configuration names to be consistent.
---
 qxldod.sln| 20 -
 qxldod/qxldod.vcxproj | 61 ---
 2 files changed, 43 insertions(+), 38 deletions(-)

diff --git a/qxldod.sln b/qxldod.sln
index 231b4e5..5b79b02 100755
--- a/qxldod.sln
+++ b/qxldod.sln
@@ -19,16 +19,16 @@ Global
Win10 Release|x64 = Win10 Release|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
-   {A6F48FC7-97E9-48EC-BCDF-1E4F9B43AADD}.Win10 
Debug|Win32.ActiveCfg = Win10 Debug|Win32
-   {A6F48FC7-97E9-48EC-BCDF-1E4F9B43AADD}.Win10 
Debug|Win32.Build.0 = Win10 Debug|Win32
-   {A6F48FC7-97E9-48EC-BCDF-1E4F9B43AADD}.Win10 
Debug|Win32.Deploy.0 = Win10 Debug|Win32
-   {A6F48FC7-97E9-48EC-BCDF-1E4F9B43AADD}.Win10 
Debug|x64.ActiveCfg = Win10 Debug|x64
-   {A6F48FC7-97E9-48EC-BCDF-1E4F9B43AADD}.Win10 Debug|x64.Build.0 
= Win10 Debug|x64
-   {A6F48FC7-97E9-48EC-BCDF-1E4F9B43AADD}.Win10 
Release|Win32.ActiveCfg = Win10 Release|Win32
-   {A6F48FC7-97E9-48EC-BCDF-1E4F9B43AADD}.Win10 
Release|Win32.Build.0 = Win10 Release|Win32
-   {A6F48FC7-97E9-48EC-BCDF-1E4F9B43AADD}.Win10 
Release|Win32.Deploy.0 = Win10 Release|Win32
-   {A6F48FC7-97E9-48EC-BCDF-1E4F9B43AADD}.Win10 
Release|x64.ActiveCfg = Win10 Release|x64
-   {A6F48FC7-97E9-48EC-BCDF-1E4F9B43AADD}.Win10 
Release|x64.Build.0 = Win10 Release|x64
+   {A6F48FC7-97E9-48EC-BCDF-1E4F9B43AADD}.Win10 
Debug|Win32.ActiveCfg = Win10Debug|Win32
+   {A6F48FC7-97E9-48EC-BCDF-1E4F9B43AADD}.Win10 
Debug|Win32.Build.0 = Win10Debug|Win32
+   {A6F48FC7-97E9-48EC-BCDF-1E4F9B43AADD}.Win10 
Debug|x64.ActiveCfg = Win10Debug|x64
+   {A6F48FC7-97E9-48EC-BCDF-1E4F9B43AADD}.Win10 Debug|x64.Build.0 
= Win10Debug|x64
+   {A6F48FC7-97E9-48EC-BCDF-1E4F9B43AADD}.Win10 Debug|x64.Deploy.0 
= Win10Debug|x64
+   {A6F48FC7-97E9-48EC-BCDF-1E4F9B43AADD}.Win10 
Release|Win32.ActiveCfg = Win10Debug|Win32
+   {A6F48FC7-97E9-48EC-BCDF-1E4F9B43AADD}.Win10 
Release|Win32.Build.0 = Win10Debug|Win32
+   {A6F48FC7-97E9-48EC-BCDF-1E4F9B43AADD}.Win10 
Release|x64.ActiveCfg = Win10Debug|x64
+   {A6F48FC7-97E9-48EC-BCDF-1E4F9B43AADD}.Win10 
Release|x64.Build.0 = Win10Debug|x64
+   {A6F48FC7-97E9-48EC-BCDF-1E4F9B43AADD}.Win10 
Release|x64.Deploy.0 = Win10Debug|x64
{B8C04B51-4207-491D-A7DD-C54861E8B528}.Win10 
Debug|Win32.ActiveCfg = Win10 Debug|Win32
{B8C04B51-4207-491D-A7DD-C54861E8B528}.Win10 
Debug|Win32.Build.0 = Win10 Debug|Win32
{B8C04B51-4207-491D-A7DD-C54861E8B528}.Win10 
Debug|x64.ActiveCfg = Win10 Debug|x64
diff --git a/qxldod/qxldod.vcxproj b/qxldod/qxldod.vcxproj
index 320748f..56b01c3 100755
--- a/qxldod/qxldod.vcxproj
+++ b/qxldod/qxldod.vcxproj
@@ -1,20 +1,20 @@
 
 http://schemas.microsoft.com/developer/msbuild/2003;>
   
-
-  Win10 Debug
+
+  Win10Debug
   Win32
 
-
-  Win10 Debug
+
+  Win10Debug
   x64
 
-
-  Win10 Release
+
+  Win10Release
   Win32
 
-
-  Win10 Release
+
+  Win10Release
   x64
 
   
@@ -29,13 +29,14 @@
   
 qxldod
 $(VCTargetsPath11)
+
$(LatestTargetPlatformVersion)
   
   
 Driver
 WDM
   
   
-  
+  
 
 
 false
@@ -43,21 +44,21 @@
 1
 Universal
   
-  
+  
 
 false
 WindowsKernelModeDriver10.0
 1
 Universal
   
-  
+  
 
 
 false
 WindowsKernelModeDriver10.0
 1
   
-  
+  
 
 
 false
@@ -74,27 +75,27 @@
   
 DbgengKernelDebugger
   
-  
-objfre_win8_x86\i386\
-objfre_win8_x86\i386\
+  
+$(Platform)\$(ConfigurationName)\
+$(Platform)\$(Configuration)\
 qxldod
   
-  
-objfre_win8_x86\i386\
-objfre_win8_x86\i386\
+  
+$(Platform)\$(ConfigurationName)\
+$(Platform)\$(Configuration)\
 qxldod
   
-  
-objfre_win8_amd64\amd64\
-objfre_win8_amd64\amd64\
+  
+$(Platform)\$(ConfigurationName)\
+$(Platform)\$(Configuration)\
 qxldod
   
-  
-objfre_win8_amd64\amd64\
-objfre_win8_amd64\amd64\
+  
+$(Platform)\$(ConfigurationName)\
+$(Platform)\$(Configuration)\
 qxldod
   
-  
+  
 
   
%(AdditionalDependencies);$(DDK_LIB_PATH)\displib.lib;$(DDK_LIB_PATH)\ntoskrnl.lib;$(DDK_LIB_PATH)\hal.lib
 
@@ -104,6 +105,8 @@
 
   
%(AdditionalIncludeDirectories);$(DDK_INC_PATH);$(SDK_INC_PATH);.\Include
   Level3
+  Disabled
+  
DBG;_X86_=1;i386=1;STD_CALL;%(PreprocessorDefinitions)
 
 
   Inf2Cat /driver:$(OutDir) 

[Spice-devel] [RFC PATCH qxl-wddm-dod 13/28] Set Allow Date, Time and Timestamp property for all builds/platforms

2016-07-18 Thread Dmitry Fleytman
From: Sandy Stutsman 

Defines standarc C/CPP macros __DATE__, __TIME__, __TIMESTAMP__
---
 qxldod/qxldod.vcxproj | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/qxldod/qxldod.vcxproj b/qxldod/qxldod.vcxproj
index ddd3fe0..320748f 100755
--- a/qxldod/qxldod.vcxproj
+++ b/qxldod/qxldod.vcxproj
@@ -55,12 +55,14 @@
 
 false
 WindowsKernelModeDriver10.0
+1
   
   
 
 
 false
 WindowsKernelModeDriver10.0
+1
   
   
   
-- 
1.8.3.1

___
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/spice-devel


[Spice-devel] [RFC PATCH qxl-wddm-dod 12/28] Use the second bar (VRAM) for qxl command buffer.

2016-07-18 Thread Dmitry Fleytman
From: Sandy Stutsman 

---
 qxldod/QxlDod.cpp | 52 ++--
 1 file changed, 26 insertions(+), 26 deletions(-)

diff --git a/qxldod/QxlDod.cpp b/qxldod/QxlDod.cpp
index a328d2d..e6c4ada 100755
--- a/qxldod/QxlDod.cpp
+++ b/qxldod/QxlDod.cpp
@@ -3429,7 +3429,7 @@ _inline QXLPHYSICAL QxlDevice::PA(PVOID virt, UINT8 
slot_id)
 {
 PAGED_CODE();
 DbgPrint(TRACE_LEVEL_VERBOSE, ("<--> %s\n", __FUNCTION__));
-MemSlot *pSlot = _MemSlots[slot_id];;
+MemSlot *pSlot = _MemSlots[slot_id];
 return pSlot->high_bits | ((UINT64)virt - pSlot->start_virt_addr);
 }
 
@@ -3437,7 +3437,7 @@ _inline UINT64 QxlDevice::VA(QXLPHYSICAL paddr, UINT8 
slot_id)
 {
 PAGED_CODE();
 UINT64 virt;
-MemSlot *pSlot = _MemSlots[slot_id];;
+MemSlot *pSlot = _MemSlots[slot_id];
 
 DbgPrint(TRACE_LEVEL_VERBOSE, ("---> %s\n", __FUNCTION__));
 virt = paddr & m_VaSlotMask;
@@ -3859,7 +3859,7 @@ UINT64 QxlDevice::ReleaseOutput(UINT64 output_id)
 RELEASE_RES(*now);
 }
 next = *(UINT64*)output->data;
-FreeMem(MSPACE_TYPE_DEVRAM, output);
+FreeMem(MSPACE_TYPE_VRAM, output);
 DbgPrint(TRACE_LEVEL_VERBOSE, ("<---%s\n", __FUNCTION__));
 return next;
 }
@@ -3939,7 +3939,7 @@ QXLDrawable *QxlDevice::GetDrawable()
 PAGED_CODE();
 QXLOutput *output;
 
-output = (QXLOutput *)AllocMem(MSPACE_TYPE_DEVRAM, sizeof(QXLOutput) + 
sizeof(QXLDrawable), TRUE);
+output = (QXLOutput *)AllocMem(MSPACE_TYPE_VRAM, sizeof(QXLOutput) + 
sizeof(QXLDrawable), TRUE);
 output->num_res = 0;
 RESOURCE_TYPE(output, RESOURCE_TYPE_DRAWABLE);
 ((QXLDrawable *)output->data)->release_info.id = (UINT64)output;
@@ -3954,7 +3954,7 @@ QXLCursorCmd *QxlDevice::CursorCmd()
 QXLOutput *output;
 
 DbgPrint(TRACE_LEVEL_VERBOSE, ("---> %s\n", __FUNCTION__));
-output = (QXLOutput *)AllocMem(MSPACE_TYPE_DEVRAM, sizeof(QXLOutput) + 
sizeof(QXLCursorCmd), TRUE);
+output = (QXLOutput *)AllocMem(MSPACE_TYPE_VRAM, sizeof(QXLOutput) + 
sizeof(QXLCursorCmd), TRUE);
 output->num_res = 0;
 RESOURCE_TYPE(output, RESOURCE_TYPE_CURSOR);
 cursor_cmd = (QXLCursorCmd *)output->data;
@@ -3975,7 +3975,7 @@ BOOL QxlDevice::SetClip(const RECT *clip, QXLDrawable 
*drawable)
 }
 
 QXLClipRects *rects;
-rects_res = (Resource *)AllocMem(MSPACE_TYPE_DEVRAM, sizeof(Resource) + 
sizeof(QXLClipRects) +
+rects_res = (Resource *)AllocMem(MSPACE_TYPE_VRAM, sizeof(Resource) + 
sizeof(QXLClipRects) +
 sizeof(QXLRect), TRUE);
 rects_res->refs = 1;
 rects_res->free = FreeClipRectsEx;
@@ -3989,7 +3989,7 @@ BOOL QxlDevice::SetClip(const RECT *clip, QXLDrawable 
*drawable)
 
 DrawableAddRes(drawable, rects_res);
 drawable->clip.type = SPICE_CLIP_TYPE_RECTS;
-drawable->clip.data = PA(rects_res->res, m_MainMemSlot);
+drawable->clip.data = PA(rects_res->res, m_SurfaceMemSlot);
 return TRUE;
 }
 
@@ -4034,11 +4034,11 @@ void QxlDevice::FreeClipRects(Resource *res)
 
 chunk_phys = ((QXLClipRects *)res->res)->chunk.next_chunk;
 while (chunk_phys) {
-QXLDataChunk *chunk = (QXLDataChunk *)VA(chunk_phys, m_MainMemSlot);
+QXLDataChunk *chunk = (QXLDataChunk *)VA(chunk_phys, m_SurfaceMemSlot);
 chunk_phys = chunk->next_chunk;
-FreeMem(MSPACE_TYPE_DEVRAM, chunk);
+FreeMem(MSPACE_TYPE_VRAM, chunk);
 }
-FreeMem(MSPACE_TYPE_DEVRAM, res);
+FreeMem(MSPACE_TYPE_VRAM, res);
 DbgPrint(TRACE_LEVEL_VERBOSE, ("<--- %s\n", __FUNCTION__));
 }
 
@@ -4061,12 +4061,12 @@ void QxlDevice::FreeBitmapImage(Resource *res)
 
 chunk_phys = ((QXLDataChunk *)(>image.bitmap + 1))->next_chunk;
 while (chunk_phys) {
-QXLDataChunk *chunk = (QXLDataChunk *)VA(chunk_phys, m_MainMemSlot);
+QXLDataChunk *chunk = (QXLDataChunk *)VA(chunk_phys, m_SurfaceMemSlot);
 chunk_phys = chunk->next_chunk;
-FreeMem(MSPACE_TYPE_DEVRAM, chunk);
+FreeMem(MSPACE_TYPE_VRAM, chunk);
 }
 
-FreeMem(MSPACE_TYPE_DEVRAM, res);
+FreeMem(MSPACE_TYPE_VRAM, res);
 DbgPrint(TRACE_LEVEL_VERBOSE, ("<--- %s\n", __FUNCTION__));
 }
 
@@ -4086,12 +4086,12 @@ void QxlDevice::FreeCursor(Resource *res)
 DbgPrint(TRACE_LEVEL_VERBOSE, ("---> %s\n", __FUNCTION__));
 chunk_phys = ((InternalCursor *)res->res)->cursor.chunk.next_chunk;
 while (chunk_phys) {
-QXLDataChunk *chunk = (QXLDataChunk *)VA(chunk_phys, m_MainMemSlot);
+QXLDataChunk *chunk = (QXLDataChunk *)VA(chunk_phys, m_SurfaceMemSlot);
 chunk_phys = chunk->next_chunk;
-FreeMem(MSPACE_TYPE_DEVRAM, chunk);
+FreeMem(MSPACE_TYPE_VRAM, chunk);
 }
 
-FreeMem(MSPACE_TYPE_DEVRAM, res);
+FreeMem(MSPACE_TYPE_VRAM, res);
 DbgPrint(TRACE_LEVEL_VERBOSE, ("<--- %s\n", __FUNCTION__));
 }
 
@@ -4134,7 +4134,7 @@ void QxlDevice::PushDrawable(QXLDrawable *drawable)
 WaitForCmdRing();
 cmd = 

[Spice-devel] [RFC PATCH qxl-wddm-dod 07/28] On power wake call the init functions before setting the vidpn to black. Otherwise, BSOD.

2016-07-18 Thread Dmitry Fleytman
From: Sandy Stutsman 

---
 qxldod/QxlDod.cpp | 66 ---
 1 file changed, 34 insertions(+), 32 deletions(-)

diff --git a/qxldod/QxlDod.cpp b/qxldod/QxlDod.cpp
index ec960e5..9d13934 100755
--- a/qxldod/QxlDod.cpp
+++ b/qxldod/QxlDod.cpp
@@ -284,12 +284,16 @@ NTSTATUS QxlDod::SetPowerState(_In_  ULONG HardwareUid,
_In_  DEVICE_POWER_STATE DevicePowerState,
_In_  POWER_ACTION   ActionType)
 {
+NTSTATUS Status(STATUS_SUCCESS);
 PAGED_CODE();
 DbgPrint(TRACE_LEVEL_INFORMATION, ("---> %s HardwareUid = 0x%x ActionType 
= %s DevicePowerState = %s AdapterPowerState = %s\n", __FUNCTION__, 
HardwareUid, DbgPowerActionString(ActionType), 
DbgDevicePowerString(DevicePowerState), 
DbgDevicePowerString(m_AdapterPowerState)));
 
 if (HardwareUid == DISPLAY_ADAPTER_HW_ID)
 {
-if (DevicePowerState == PowerDeviceD0)
+// There is nothing to do to specifically power up/down the display 
adapter
+Status = m_pHWDevice->SetPowerState(DevicePowerState, 
&(m_CurrentModes[0].DispInfo));
+
+if (NT_SUCCESS(Status) && DevicePowerState == PowerDeviceD0)
 {
 
 // When returning from D3 the device visibility defined to be off 
for all targets
@@ -305,12 +309,10 @@ NTSTATUS QxlDod::SetPowerState(_In_  ULONG HardwareUid,
 // Store new adapter power state
 m_AdapterPowerState = DevicePowerState;
 
-// There is nothing to do to specifically power up/down the display 
adapter
-return m_pHWDevice->SetPowerState(DevicePowerState, 
&(m_CurrentModes[0].DispInfo));
 }
 // TODO: This is where the specified monitor should be powered up/down
 
-return STATUS_SUCCESS;
+return Status;
 }
 
 NTSTATUS QxlDod::QueryChildRelations(_Out_writes_bytes_(ChildRelationsSize) 
DXGK_CHILD_DESCRIPTOR* pChildRelations,
@@ -2977,10 +2979,10 @@ BOOL QxlDevice::SetVideoModeInfo(UINT Idx, QXLMode* 
pModeInfo)
 void QxlDevice::UpdateVideoModeInfo(UINT Idx, UINT xres, UINT yres, UINT bpp)
 {
 PVIDEO_MODE_INFORMATION pMode = NULL;
-UINT bytes_pp = (bpp + 7) / 8;
+UINT bytes_pp = (bpp + 7) / 8;
 ULONG color_bits;
 PAGED_CODE();
-
+
 pMode = _ModeInfo[Idx];
 pMode->VisScreenWidth = xres;
 pMode->VisScreenHeight = yres;
@@ -4400,39 +4402,39 @@ NTSTATUS QxlDevice::Escape(_In_ CONST DXGKARG_ESCAPE* 
pEscap)
 {
 DbgPrint(TRACE_LEVEL_VERBOSE, ("---> %s\n", __FUNCTION__));
 QXLEscapeSetCustomDisplay *custom_display;
-UINT xres;
-UINT yres;
-UINT bpp;
+UINT xres;
+UINT yres;
+UINT bpp;
 
 if (pEscap->PrivateDriverDataSize != sizeof(QXLEscapeSetCustomDisplay)) {
 DbgPrint(TRACE_LEVEL_ERROR, ("<--> %s Incorrect buffer size %d instead 
of %d\n", __FUNCTION__, pEscap->PrivateDriverDataSize, 
sizeof(QXLEscapeSetCustomDisplay)));
 return STATUS_INVALID_BUFFER_SIZE;
 }
 custom_display = (QXLEscapeSetCustomDisplay*)pEscap->pPrivateDriverData;
-xres = custom_display->xres & ~0x3;
-yres = custom_display->yres & ~0x3;
-bpp = custom_display->bpp;
-if (bpp != QXL_BPP)
-{
-bpp = QXL_BPP;
-}
-if (xres < MIN_WIDTH_SIZE || yres < MIN_HEIGHT_SIZE)
-{
+xres = custom_display->xres & ~0x3;
+yres = custom_display->yres & ~0x3;
+bpp = custom_display->bpp;
+if (bpp != QXL_BPP)
+{
+bpp = QXL_BPP;
+}
+if (xres < MIN_WIDTH_SIZE || yres < MIN_HEIGHT_SIZE)
+{
 DbgPrint(TRACE_LEVEL_ERROR, ("%s: xres = %d, yres = %d\n", 
__FUNCTION__, xres, yres));
-return ERROR_INVALID_DATA;
-}
-
-if (m_CustomMode == (m_ModeCount - 1))
-m_CustomMode = (USHORT)(m_ModeCount - 2);
-else
-m_CustomMode = (USHORT)(m_ModeCount - 1);
-
-if ((xres * yres * bpp / 8) > m_RomHdr->surface0_area_size) {
-DbgPrint(TRACE_LEVEL_ERROR, ("%s: Mode (%dx%d#%d) doesn't fit in 
memory (%d)\n",
-__FUNCTION__, xres, yres, bpp, 
m_RomHdr->surface0_area_size));
-return STATUS_INVALID_PARAMETER;
-}
-UpdateVideoModeInfo(m_CustomMode, xres, yres, bpp);
+return ERROR_INVALID_DATA;
+}
+
+if (m_CustomMode == (m_ModeCount - 1))
+m_CustomMode = (USHORT)(m_ModeCount - 2);
+else
+m_CustomMode = (USHORT)(m_ModeCount - 1);
+
+if ((xres * yres * bpp / 8) > m_RomHdr->surface0_area_size) {
+DbgPrint(TRACE_LEVEL_ERROR, ("%s: Mode (%dx%d#%d) doesn't fit in 
memory (%d)\n",
+__FUNCTION__, xres, yres, bpp, 
m_RomHdr->surface0_area_size));
+return STATUS_INVALID_PARAMETER;
+}
+UpdateVideoModeInfo(m_CustomMode, xres, yres, bpp);
 DbgPrint(TRACE_LEVEL_VERBOSE, ("<--- %s\n", __FUNCTION__));
 return STATUS_SUCCESS;
 }
-- 
1.8.3.1

___
Spice-devel mailing list
Spice-devel@lists.freedesktop.org

[Spice-devel] [RFC PATCH qxl-wddm-dod 06/28] Do not use virtual functions for code that must not be paged

2016-07-18 Thread Dmitry Fleytman
From: Sandy Stutsman 

There is no way to guarantee that the static vtable will be in
non-pageable memory.  This patch converts 3 virtual non-pageble functions
to functions private to each device class, the parent class will make
an explicit call (based on a new device type initialized at object
creation) to the correct function.

Fixed one misspelling: HwDeviceInterface
---
 qxldod/QxlDod.cpp | 114 ++
 qxldod/QxlDod.h   |  48 +++
 2 files changed, 120 insertions(+), 42 deletions(-)

diff --git a/qxldod/QxlDod.cpp b/qxldod/QxlDod.cpp
index 1b3bdf1..ec960e5 100755
--- a/qxldod/QxlDod.cpp
+++ b/qxldod/QxlDod.cpp
@@ -2294,7 +2294,7 @@ VOID BltBits (
 }
 #pragma code_seg(pop) // End Non-Paged Code
 
-VgaDevice::VgaDevice(_In_ QxlDod* pQxlDod)
+VgaDevice::VgaDevice(_In_ QxlDod* pQxlDod) : HwDeviceInterface(pQxlDod)
 {
 m_pQxlDod = pQxlDod;
 m_ModeInfo = NULL;
@@ -2302,6 +2302,7 @@ VgaDevice::VgaDevice(_In_ QxlDod* pQxlDod)
 m_ModeNumbers = NULL;
 m_CurrentMode = 0;
 m_Id = 0;
+m_type = VGA_DEVICE;
 }
 
 VgaDevice::~VgaDevice(void)
@@ -2881,18 +2882,18 @@ VOID VgaDevice::BlackOutScreen(CURRENT_BDD_MODE* 
pCurrentBddMod)
 #pragma code_seg()
 // BEGIN: Non-Paged Code Segment
 
-BOOLEAN VgaDevice::InterruptRoutine(_In_ PDXGKRNL_INTERFACE pDxgkInterface, 
_In_  ULONG MessageNumber)
+BOOLEAN VgaDevice::HWInterruptRoutine(_In_ PDXGKRNL_INTERFACE pDxgkInterface, 
_In_  ULONG MessageNumber)
 {
 UNREFERENCED_PARAMETER(pDxgkInterface);
 UNREFERENCED_PARAMETER(MessageNumber);
 return FALSE;
 }
 
-VOID VgaDevice::DpcRoutine(PVOID)
+VOID VgaDevice::HWDpcRoutine(PDXGKRNL_INTERFACE pDxgkInterface)
 {
 }
 
-VOID VgaDevice::ResetDevice(VOID)
+VOID VgaDevice::HWResetDevice(VOID)
 {
 }
 #pragma  code_seg(pop) //end non-paged code
@@ -2916,7 +2917,7 @@ NTSTATUS VgaDevice::Escape(_In_ CONST DXGKARG_ESCAPE* 
pEscap)
 return STATUS_NOT_IMPLEMENTED;
 }
 
-QxlDevice::QxlDevice(_In_ QxlDod* pQxlDod)
+QxlDevice::QxlDevice(_In_ QxlDod* pQxlDod) : HwDeviceInterface(pQxlDod)
 {
 m_pQxlDod = pQxlDod;
 m_ModeInfo = NULL;
@@ -2926,6 +2927,7 @@ QxlDevice::QxlDevice(_In_ QxlDod* pQxlDod)
 m_CustomMode = 0;
 m_FreeOutputs = 0;
 m_Pending = 0;
+m_type = QXL_DEVICE;
 }
 
 QxlDevice::~QxlDevice(void)
@@ -3152,7 +3154,7 @@ NTSTATUS QxlDevice::SetPowerState(_In_ DEVICE_POWER_STATE 
DevicePowerState, DXGK
 NTSTATUS QxlDevice::HWInit(PCM_RESOURCE_LIST pResList, 
DXGK_DISPLAY_INFORMATION* pDispInfo)
 {
 DbgPrint(TRACE_LEVEL_VERBOSE, ("---> %s\n", __FUNCTION__));
-PDXGKRNL_INTERFACE pDxgkInterface = m_pQxlDod->GetDxgkInterrface();
+PDXGKRNL_INTERFACE pDxgkInterface = m_pQxlDod->GetDxgkInterface();
 UINT pci_range = QXL_RAM_RANGE_INDEX;
 for (ULONG i = 0; i < pResList->Count; ++i)
 {
@@ -3329,7 +3331,7 @@ void QxlDevice::QxlClose()
 
 void QxlDevice::UnmapMemory(void)
 {
-PDXGKRNL_INTERFACE pDxgkInterface = m_pQxlDod->GetDxgkInterrface();
+PDXGKRNL_INTERFACE pDxgkInterface = m_pQxlDod->GetDxgkInterface();
 if (m_IoMapped && m_IoBase)
 {
 pDxgkInterface->DxgkCbUnmapMemory( pDxgkInterface->DeviceHandle, 
_IoBase);
@@ -4498,7 +4500,8 @@ VOID QxlDevice::PushCursor(VOID)
 #pragma code_seg(push)
 #pragma code_seg()
 // BEGIN: Non-Paged Code Segment
-BOOLEAN QxlDevice::InterruptRoutine(_In_ PDXGKRNL_INTERFACE pDxgkInterface, 
_In_  ULONG MessageNumber)
+
+BOOLEAN QxlDevice::HWInterruptRoutine(_In_ PDXGKRNL_INTERFACE pDxgkInterface, 
_In_  ULONG MessageNumber)
 {
 UNREFERENCED_PARAMETER(MessageNumber);
 DbgPrint(TRACE_LEVEL_VERBOSE, ("---> %s\n", __FUNCTION__));
@@ -4523,10 +4526,8 @@ BOOLEAN QxlDevice::InterruptRoutine(_In_ 
PDXGKRNL_INTERFACE pDxgkInterface, _In_
 return TRUE;
 }
 
-VOID QxlDevice::DpcRoutine(PVOID ptr)
+VOID QxlDevice::HWDpcRoutine(PDXGKRNL_INTERFACE pDxgkInterface)
 {
-PDXGKRNL_INTERFACE pDxgkInterface = (PDXGKRNL_INTERFACE)ptr;
-
 DbgPrint(TRACE_LEVEL_INFORMATION, ("---> %s\n", __FUNCTION__));
 DPC_CB_CONTEXT ctx;
 BOOLEAN dummy;
@@ -4557,13 +4558,89 @@ VOID QxlDevice::DpcRoutine(PVOID ptr)
 DbgPrint(TRACE_LEVEL_INFORMATION, ("<--- %s\n", __FUNCTION__));
 }
 
-void QxlDevice::ResetDevice(void)
+void QxlDevice::HWResetDevice(void)
 {
 DbgPrint(TRACE_LEVEL_VERBOSE, ("---> %s\n", __FUNCTION__));
 m_RamHdr->int_mask = ~0;
 WRITE_PORT_UCHAR(m_IoBase + QXL_IO_MEMSLOT_ADD, 0);
 DbgPrint(TRACE_LEVEL_VERBOSE, ("<--- %s\n", __FUNCTION__));
 }
+
+// Given bits per pixel, return the pixel format at the same bpp
+D3DDDIFORMAT PixelFormatFromBPP(UINT BPP)
+{
+switch (BPP)
+{
+case  8: return D3DDDIFMT_P8;
+case 16: return D3DDDIFMT_R5G6B5;
+case 24: return D3DDDIFMT_R8G8B8;
+case 32: return D3DDDIFMT_X8R8G8B8;
+default: QXL_LOG_ASSERTION1("A bit per pixel of 0x%I64x is not 
supported.", BPP); return D3DDDIFMT_UNKNOWN;
+}
+}
+
+
+BOOLEAN 

[Spice-devel] [RFC PATCH qxl-wddm-dod 21/28] Fixing mouse pointer issue when Vdagent is off

2016-07-18 Thread Dmitry Fleytman
From: Sameeh Jubran <sam...@daynix.com>

The mouse pointer disappears once the Vdagent is not running, this
happens due to a bug in which the function  always
returns true. However the client mouse pointer should be disabled
when vdagent is off and enabled when it is on and thus this function
should return the current state of Vdagent.

Signed-off-by: Sameeh Jubran <sam...@daynix.com>
Signed-off-by: Dmitry Fleytman <dmi...@daynix.com>
---
 qxldod/QxlDod.cpp | 11 +--
 qxldod/QxlDod.h   |  2 +-
 2 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/qxldod/QxlDod.cpp b/qxldod/QxlDod.cpp
index 42c82e3..f6542c4 100755
--- a/qxldod/QxlDod.cpp
+++ b/qxldod/QxlDod.cpp
@@ -427,12 +427,11 @@ NTSTATUS QxlDod::QueryAdapterInfo(_In_ CONST 
DXGKARG_QUERYADAPTERINFO* pQueryAda
 pDriverCaps->WDDMVersion = DXGKDDI_WDDMv1_2;
 pDriverCaps->HighestAcceptableAddress.QuadPart = -1;
 
-if (m_pHWDevice->EnablePointer()) {
-pDriverCaps->MaxPointerWidth  = POINTER_SIZE;
-pDriverCaps->MaxPointerHeight = POINTER_SIZE;
-pDriverCaps->PointerCaps.Monochrome = 1;
-pDriverCaps->PointerCaps.Color = 1;
-}
+pDriverCaps->MaxPointerWidth  = POINTER_SIZE;
+pDriverCaps->MaxPointerHeight = POINTER_SIZE;
+pDriverCaps->PointerCaps.Monochrome = 1;
+pDriverCaps->PointerCaps.Color = 1;
+
 DbgPrint(TRACE_LEVEL_VERBOSE, ("<--- %s 1\n", __FUNCTION__));
 return STATUS_SUCCESS;
 }
diff --git a/qxldod/QxlDod.h b/qxldod/QxlDod.h
index 6c5d0f8..d3249eb 100755
--- a/qxldod/QxlDod.h
+++ b/qxldod/QxlDod.h
@@ -462,7 +462,7 @@ public:
 NTSTATUS SetPowerState(DEVICE_POWER_STATE DevicePowerState, 
DXGK_DISPLAY_INFORMATION* pDispInfo);
 NTSTATUS HWInit(PCM_RESOURCE_LIST pResList, DXGK_DISPLAY_INFORMATION* 
pDispInfo);
 NTSTATUS HWClose(void);
-BOOLEAN EnablePointer(void) { return TRUE; }
+BOOLEAN EnablePointer(void) { return m_VDAgentRunning; }
 NTSTATUS ExecutePresentDisplayOnly(_In_ BYTE* DstAddr,
 _In_ UINT  DstBitPerPixel,
 _In_ BYTE* SrcAddr,
-- 
1.8.3.1

___
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/spice-devel


[Spice-devel] [RFC PATCH qxl-wddm-dod 22/28] Replacing tabs with spaces

2016-07-18 Thread Dmitry Fleytman
From: Sameeh Jubran <sam...@daynix.com>

Signed-off-by: Sameeh Jubran <sam...@daynix.com>
Signed-off-by: Dmitry Fleytman <dmi...@daynix.com>
---
 qxldod/QxlDod.h   | 2 +-
 qxldod/driver.cpp | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/qxldod/QxlDod.h b/qxldod/QxlDod.h
index d3249eb..c28f97f 100755
--- a/qxldod/QxlDod.h
+++ b/qxldod/QxlDod.h
@@ -107,7 +107,7 @@ typedef struct
 
 #pragma pack(pop)
 
-typedef struct _X86BIOS_REGISTERS  // invented names
+typedef struct _X86BIOS_REGISTERS// invented names
 {
 ULONG Eax;
 ULONG Ecx;
diff --git a/qxldod/driver.cpp b/qxldod/driver.cpp
index 2098421..be8d2a2 100755
--- a/qxldod/driver.cpp
+++ b/qxldod/driver.cpp
@@ -634,7 +634,7 @@ DodSystemDisplayWrite(
 #if defined(DBG)
 
 #define RHEL_DEBUG_PORT ((PUCHAR)0x3F8)
-#define TEMP_BUFFER_SIZE   256
+#define TEMP_BUFFER_SIZE256
 
 void DebugPrintFuncSerial(const char *format, ...)
 {
-- 
1.8.3.1

___
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/spice-devel


[Spice-devel] [RFC PATCH qxl-wddm-dod 17/28] Remove minimum size restrict for custom resolution. (+1 squashed commits)

2016-07-18 Thread Dmitry Fleytman
From: Sandy Stutsman 

Squashed commits:

[9114b8b] Remove minimum size restrict for custom resolution.
---
 qxldod/QxlDod.cpp | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/qxldod/QxlDod.cpp b/qxldod/QxlDod.cpp
index 3139092..74cd259 100755
--- a/qxldod/QxlDod.cpp
+++ b/qxldod/QxlDod.cpp
@@ -4488,11 +4488,10 @@ NTSTATUS 
QxlDevice::SetCustomDisplay(QXLEscapeSetCustomDisplay* custom_display)
 UINT xres = custom_display->xres;
 UINT yres = custom_display->yres;
 UINT bpp = QXL_BPP;
-DbgPrint(TRACE_LEVEL_ERROR, ("%s - %d (%dx%d#%d)\n", __FUNCTION__, m_Id, 
xres, yres, bpp));
+DbgPrint(TRACE_LEVEL_WARNING, ("%s - %d (%dx%d#%d)\n", __FUNCTION__, m_Id, 
xres, yres, bpp));
 if (xres < MIN_WIDTH_SIZE || yres < MIN_HEIGHT_SIZE) {
-DbgPrint(TRACE_LEVEL_VERBOSE, ("%s: (%dx%d#%d) must be at least 
(%dxd)\n", __FUNCTION__,
+DbgPrint(TRACE_LEVEL_VERBOSE, ("%s: (%dx%d#%d) less than (%dxd)\n", 
__FUNCTION__,
 xres, yres, bpp, MIN_WIDTH_SIZE, MIN_HEIGHT_SIZE));
-return ERROR_INVALID_DATA;
 }
 m_CustomMode =(USHORT) ((m_CustomMode == m_ModeCount-1)?  m_ModeCount - 2 
: m_ModeCount - 1);
 
-- 
1.8.3.1

___
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/spice-devel


[Spice-devel] [RFC PATCH qxl-wddm-dod 01/28] Upgrade to Windows 10 WDK

2016-07-18 Thread Dmitry Fleytman
From: Sandy Stutsman 

Added delete operator.  Added Win10 configurations and removed older ones.
---
 qxldod Package/qxldod Package.vcxproj | 28 +--
 qxldod.sln| 84 ++-
 qxldod/BaseObject.cpp | 11 +
 qxldod/BaseObject.h   |  1 +
 qxldod/qxldod.vcxproj | 93 +++
 5 files changed, 135 insertions(+), 82 deletions(-)

diff --git a/qxldod Package/qxldod Package.vcxproj b/qxldod Package/qxldod 
Package.vcxproj
index 2935ed7..1a6b5c7 100755
--- a/qxldod Package/qxldod Package.vcxproj 
+++ b/qxldod Package/qxldod Package.vcxproj 
@@ -1,5 +1,5 @@
 
-http://schemas.microsoft.com/developer/msbuild/2003;>
+http://schemas.microsoft.com/developer/msbuild/2003;>
   
 
   Win8.1 Debug
@@ -53,7 +53,7 @@
   
 {B8C04B51-4207-491D-A7DD-C54861E8B528}
 {4605da2c-74a5-4865-98e1-152ef136825f}
-v4.5
+v4.5.2
 11.0
 Win8 Debug
 Win32
@@ -71,62 +71,62 @@
   
 WindowsV6.3
 true
-WindowsKernelModeDriver8.1
+WindowsKernelModeDriver10.0
   
   
 Windows8
 true
-WindowsKernelModeDriver8.1
+WindowsKernelModeDriver10.0
   
   
 WindowsV6.3
 false
-WindowsKernelModeDriver8.1
+WindowsKernelModeDriver10.0
   
   
 Windows8
 false
-WindowsKernelModeDriver8.1
+WindowsKernelModeDriver10.0
   
   
 Windows7
 true
-WindowsKernelModeDriver8.1
+WindowsKernelModeDriver10.0
   
   
 Windows7
 false
-WindowsKernelModeDriver8.1
+WindowsKernelModeDriver10.0
   
   
 WindowsV6.3
 true
-WindowsKernelModeDriver8.1
+WindowsKernelModeDriver10.0
   
   
 Windows8
 true
-WindowsKernelModeDriver8.1
+WindowsKernelModeDriver10.0
   
   
 WindowsV6.3
 false
-WindowsKernelModeDriver8.1
+WindowsKernelModeDriver10.0
   
   
 Windows8
 false
-WindowsKernelModeDriver8.1
+WindowsKernelModeDriver10.0
   
   
 Windows7
 true
-WindowsKernelModeDriver8.1
+WindowsKernelModeDriver10.0
   
   
 Windows7
 false
-WindowsKernelModeDriver8.1
+WindowsKernelModeDriver10.0
   
   
   
diff --git a/qxldod.sln b/qxldod.sln
index 14f4cd6..fdc967f 100755
--- a/qxldod.sln
+++ b/qxldod.sln
@@ -1,6 +1,6 @@
 Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio 2013
-VisualStudioVersion = 12.0.21005.1
+# Visual Studio 14
+VisualStudioVersion = 14.0.23107.0
 MinimumVisualStudioVersion = 10.0.40219.1
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "qxldod", 
"qxldod\qxldod.vcxproj", "{A6F48FC7-97E9-48EC-BCDF-1E4F9B43AADD}"
 EndProject
@@ -11,64 +11,32 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "qxldod 
Package", "qxldod Pa
 EndProject
 Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
-   Win8 Debug|Win32 = Win8 Debug|Win32
-   Win8 Debug|x64 = Win8 Debug|x64
-   Win8 Release|Win32 = Win8 Release|Win32
-   Win8 Release|x64 = Win8 Release|x64
-   Win8.1 Debug|Win32 = Win8.1 Debug|Win32
-   Win8.1 Debug|x64 = Win8.1 Debug|x64
-   Win8.1 Release|Win32 = Win8.1 Release|Win32
-   Win8.1 Release|x64 = Win8.1 Release|x64
+   Win10 Debug|Win32 = Win10 Debug|Win32
+   Win10 Debug|x64 = Win10 Debug|x64
+   Win10 Release|Win32 = Win10 Release|Win32
+   Win10 Release|x64 = Win10 Release|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
-   {A6F48FC7-97E9-48EC-BCDF-1E4F9B43AADD}.Win8 
Debug|Win32.ActiveCfg = Win8 Debug|Win32
-   {A6F48FC7-97E9-48EC-BCDF-1E4F9B43AADD}.Win8 Debug|Win32.Build.0 
= Win8 Debug|Win32
-   {A6F48FC7-97E9-48EC-BCDF-1E4F9B43AADD}.Win8 
Debug|Win32.Deploy.0 = Win8 Debug|Win32
-   {A6F48FC7-97E9-48EC-BCDF-1E4F9B43AADD}.Win8 Debug|x64.ActiveCfg 
= Win8 Debug|x64
-   {A6F48FC7-97E9-48EC-BCDF-1E4F9B43AADD}.Win8 Debug|x64.Build.0 = 
Win8 Debug|x64
-   {A6F48FC7-97E9-48EC-BCDF-1E4F9B43AADD}.Win8 Debug|x64.Deploy.0 
= Win8 Debug|x64
-   {A6F48FC7-97E9-48EC-BCDF-1E4F9B43AADD}.Win8 
Release|Win32.ActiveCfg = Win8 Release|Win32
-   {A6F48FC7-97E9-48EC-BCDF-1E4F9B43AADD}.Win8 
Release|Win32.Build.0 = Win8 Release|Win32
-   {A6F48FC7-97E9-48EC-BCDF-1E4F9B43AADD}.Win8 
Release|Win32.Deploy.0 = Win8 Release|Win32
-   {A6F48FC7-97E9-48EC-BCDF-1E4F9B43AADD}.Win8 
Release|x64.ActiveCfg = Win8 Release|x64
-   {A6F48FC7-97E9-48EC-BCDF-1E4F9B43AADD}.Win8 Release|x64.Build.0 
= Win8 Release|x64
-   {A6F48FC7-97E9-48EC-BCDF-1E4F9B43AADD}.Win8 
Release|x64.Deploy.0 = Win8 Release|x64
-   {A6F48FC7-97E9-48EC-BCDF-1E4F9B43AADD}.Win8.1 
Debug|Win32.ActiveCfg = Win8.1 Debug|Win32
-   

[Spice-devel] UsbDk 1.0.14 released

2016-07-10 Thread Dmitry Fleytman
Hi All,

The new version of UsbDk (1.0.14) was released.

This version fixes interoperability with devices
that do not have embedded device text descriptor.

The latest UsbDk source code available at:
http://cgit.freedesktop.org/spice/win32/usbdk

Latest source tarball is at: 
http://www.spice-space.org/download/windows/usbdk/spice-usbdk-win-1.0-14-sources.zip

Precompiled and signed by Red Hat binaries are available at:
1. 32 bit: 
http://www.spice-space.org/download/windows/usbdk/UsbDk_1.0.14_x86.msi
2. 64 bit: 
http://www.spice-space.org/download/windows/usbdk/UsbDk_1.0.14_x64.msi

UsbDk documentation:
1. Short presentation: 
http://www.spice-space.org/docs/usbdk/UsbDk_at_a_Glance.pdf
2. SDM: 
http://www.spice-space.org/docs/usbdk/UsbDk_Software_Development_Manual.pdf
3. UsbDk architecture specificatin (part of source tree):
  http://cgit.freedesktop.org/spice/win32/usbdk/tree/ARCHITECTURE

Best regards,
Dmitry

___
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/spice-devel


[Spice-devel] UsbDk 1.0.13 released

2016-07-04 Thread Dmitry Fleytman
Hi All,

The new version of UsbDk (1.0.13) was released.

This release contains improvements of hider API made
to fix issues of clients that rely on system hotplug events
for discovery of USB devices.

The latest UsbDk source code available at:
http://cgit.freedesktop.org/spice/win32/usbdk

Latest source tarball is at: 
http://www.spice-space.org/download/windows/usbdk/spice-usbdk-win-1.0-13-sources.zi
   p

Precompiled and signed by Red Hat binaries are available at:
1. 32 bit: 
http://www.spice-space.org/download/windows/usbdk/UsbDk_1.0.13_x86.msi
2. 64 bit: 
http://www.spice-space.org/download/windows/usbdk/UsbDk_1.0.13_x64.msi

UsbDk documentation:
1. Short presentation: 
http://www.spice-space.org/docs/usbdk/UsbDk_at_a_Glance.pdf
2. SDM: 
http://www.spice-space.org/docs/usbdk/UsbDk_Software_Development_Manual.pdf
3. UsbDk architecture specificatin (part of source tree):
  http://cgit.freedesktop.org/spice/win32/usbdk/tree/ARCHITECTURE

Best regards,
Dmitry

___
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/spice-devel


Re: [Spice-devel] [PATCH spice-gtk 1/2] SpiceUsbDeviceManager: propagate errors from sub-tasks

2016-03-30 Thread Dmitry Fleytman

> On 29 Mar 2016, at 18:25 PM, Jonathon Jongsma  wrote:
> 
> Thanks, I've pushed these along with the other usbdk patches from Dmitry and
> Kirill

Thanks, Jonathon.

> 
> 
> On Tue, 2016-03-29 at 16:49 +0200, Christophe Fergeau wrote:
>> Acked-by: Christophe Fergeau 
>> 
>> On Thu, Mar 24, 2016 at 03:29:23PM -0500, Jonathon Jongsma wrote:
>>> _connect_device_async_cb() just turned TRUE unconditionally even if the
>>> sub-task had failed. Instad, introduce a
>>> _spice_usb_device_manager_connect_device_finish() function which passes
>>> up the result of the subtask.
>>> ---
>>> src/usb-device-manager.c | 19 +--
>>> 1 file changed, 17 insertions(+), 2 deletions(-)
>>> 
>>> diff --git a/src/usb-device-manager.c b/src/usb-device-manager.c
>>> index 1bbf6b3..cc95c68 100644
>>> --- a/src/usb-device-manager.c
>>> +++ b/src/usb-device-manager.c
>>> @@ -1563,6 +1563,18 @@
>>> _spice_usb_device_manager_uninstall_driver_async(SpiceUsbDeviceManager
>>> *self,
>>> 
>>> #ifdef USE_USBREDIR
>>> 
>>> +static gboolean
>>> +_spice_usb_device_manager_connect_device_finish(SpiceUsbDeviceManager
>>> *self,
>>> +GAsyncResult *res,
>>> +GError **error)
>>> +{
>>> +GTask *task = G_TASK(res);
>>> +
>>> +g_return_val_if_fail(g_task_is_valid(task, G_OBJECT(self)), FALSE);
>>> +
>>> +return g_task_propagate_boolean(task, error);
>>> +}
>>> +
>>> static void
>>> _spice_usb_device_manager_connect_device_async(SpiceUsbDeviceManager *self,
>>>SpiceUsbDevice *device,
>>> @@ -1727,10 +1739,13 @@ void _connect_device_async_cb(GObject *gobject,
>>> {
>>> SpiceUsbDeviceManager *self = SPICE_USB_DEVICE_MANAGER(gobject);
>>> GTask *task = user_data;
>>> +GError *error = NULL;
>>> 
>>> _set_redirecting(self, FALSE);
>>> -
>>> -g_task_return_boolean(task, TRUE);
>>> +if (_spice_usb_device_manager_connect_device_finish(self, channel_res,
>>> ))
>>> +g_task_return_boolean(task, TRUE);
>>> +else
>>> +g_task_return_error(task, error);
>>> g_object_unref(task);
>>> }
>>> #endif

___
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/spice-devel


Re: [Spice-devel] [PATCH v7 06/14] usbredir: Spawn a different thread for device redirection flow

2016-03-22 Thread Dmitry Fleytman
Hi All,

I compiled and tested the current code. For my scenarios it is working Ok.
Please let me know if you need any additional help from me.

Thanks,
Dmitry

> On 21 Mar 2016, at 17:19 PM, Fabiano Fidêncio <fiden...@redhat.com> wrote:
> 
> On Mon, Mar 21, 2016 at 10:58 AM, Fabiano Fidêncio <fiden...@redhat.com 
> <mailto:fiden...@redhat.com>> wrote:
>> On Mon, Mar 21, 2016 at 8:21 AM, Dmitry Fleytman <dmi...@daynix.com> wrote:
>>> Hi,
>>> 
>>> I still cannot build:
>>> 
>>> 
>>> make[4]: Entering directory '/root/src/spice-gtk/src'
>>>  CCLD libspice-client-glib-2.0.la
>>>  CC   spice-widget.lo
>>> In file included from spice-widget.c:40:0:
>>> spice-widget-priv.h:27:23: fatal error: epoxy/egl.h: No such file or 
>>> directory
>>> #include 
>>>   ^
>>> compilation terminated.
>>> Makefile:1274: recipe for target 'spice-widget.lo' failed
>>> 
>>> 
>>> All epoxy packages are installed:
>>> 
>>> [root@localhost spice-gtk]# rpm -qa | grep epoxy
>>> libepoxy-devel-1.3.1-2.fc24.x86_64
>>> mingw32-libepoxy-1.3.1-2.fc24.noarch
>>> mingw64-libepoxy-1.3.1-2.fc24.noarch
>>> libepoxy-1.3.1-2.fc24.x86_64
>>> 
>>> Do you have any idea?
>> 
>> I've been working on a fix for this, I will send it to the mailing list soon.
> 
> The fixed was pushed upstream.
> 
>> 
>>> 
>>> Thanks,
>>> Dmitry
>>> 
>>>> On 20 Mar 2016, at 13:50 PM, Fabiano Fidêncio <fiden...@redhat.com> wrote:
>>>> 
>>>> On Sun, Mar 20, 2016 at 12:19 PM, Dmitry Fleytman <dmi...@daynix.com> 
>>>> wrote:
>>>>> Hi Jonathon,
>>>>> 
>>>>> Sure, I’ll test.
>>>>> I tried to build your branch but it requires newer spice-protocol:
>>>>> 
>>>>> configure: error: Package requirements (spice-protocol >= 0.12.11) were 
>>>>> not
>>>>> met:
>>>>> Requested 'spice-protocol >= 0.12.11' but version of spice-protocol is
>>>>> 0.12.10
>>>>> 
>>>>> Do you have any idea where one can get the corresponding mingw package?
>>>> 
>>>> http://koji.fedoraproject.org/koji/buildinfo?buildID=744124
>>>> 
>>>> At least one crash was found last week on my GTask work.
>>>> I'll send a few patches as soon as I have the crashes fixed.
>>>> 
>>>> Best Regards,

___
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/spice-devel


Re: [Spice-devel] [PATCH v7 06/14] usbredir: Spawn a different thread for device redirection flow

2016-03-21 Thread Dmitry Fleytman
Hi,

I still cannot build:


make[4]: Entering directory '/root/src/spice-gtk/src'
  CCLD libspice-client-glib-2.0.la
  CC   spice-widget.lo
In file included from spice-widget.c:40:0:
spice-widget-priv.h:27:23: fatal error: epoxy/egl.h: No such file or directory
 #include 
   ^
compilation terminated.
Makefile:1274: recipe for target 'spice-widget.lo' failed


All epoxy packages are installed:

[root@localhost spice-gtk]# rpm -qa | grep epoxy
libepoxy-devel-1.3.1-2.fc24.x86_64
mingw32-libepoxy-1.3.1-2.fc24.noarch
mingw64-libepoxy-1.3.1-2.fc24.noarch
libepoxy-1.3.1-2.fc24.x86_64

Do you have any idea?

Thanks,
Dmitry

> On 20 Mar 2016, at 13:50 PM, Fabiano Fidêncio <fiden...@redhat.com> wrote:
> 
> On Sun, Mar 20, 2016 at 12:19 PM, Dmitry Fleytman <dmi...@daynix.com> wrote:
>> Hi Jonathon,
>> 
>> Sure, I’ll test.
>> I tried to build your branch but it requires newer spice-protocol:
>> 
>> configure: error: Package requirements (spice-protocol >= 0.12.11) were not
>> met:
>> Requested 'spice-protocol >= 0.12.11' but version of spice-protocol is
>> 0.12.10
>> 
>> Do you have any idea where one can get the corresponding mingw package?
> 
> http://koji.fedoraproject.org/koji/buildinfo?buildID=744124
> 
> At least one crash was found last week on my GTask work.
> I'll send a few patches as soon as I have the crashes fixed.
> 
> Best Regards,

___
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/spice-devel


Re: [Spice-devel] [PATCH v7 06/14] usbredir: Spawn a different thread for device redirection flow

2016-03-20 Thread Dmitry Fleytman
Hi Jonathon,

Sure, I’ll test.
I tried to build your branch but it requires newer spice-protocol:

configure: error: Package requirements (spice-protocol >= 0.12.11) were not met:
Requested 'spice-protocol >= 0.12.11' but version of spice-protocol is 0.12.10

Do you have any idea where one can get the corresponding mingw package?

Thanks,
Dmitry

> On 17 Mar 2016, at 24:04 AM, Jonathon Jongsma  wrote:
> 
> On Wed, 2016-03-16 at 23:01 +0100, Fabiano Fidêncio wrote:
>> On Wed, Mar 16, 2016 at 10:54 PM, Jonathon Jongsma 
>> wrote:
>>> Updated proposal:
>>> 
>>> --- a/src/channel-usbredir.c
>>> +++ b/src/channel-usbredir.c
>>> @@ -368,16 +368,19 @@ _open_device_async_cb(GTask *task,
>>> spice_usbredir_channel_lock(channel);
>>> 
>>> if (!spice_usbredir_channel_open_device(channel, )) {
>>> -g_task_return_error(task, err);
>>> libusb_unref_device(priv->device);
>>> priv->device = NULL;
>>> g_boxed_free(spice_usb_device_get_type(), priv->spice_device);
>>> priv->spice_device = NULL;
>>> -} else {
>>> -g_task_return_boolean(task, TRUE);
>>> }
>>> 
>>> spice_usbredir_channel_unlock(channel);
>>> +
>>> +if (err) {
>>> +g_task_return_error(task, err);
>>> +} else {
>>> +g_task_return_boolean(task, TRUE);
>>> +}
>>> }
>>> #endif
>> 
>> ACK from my side. But I really would like to have Dmitry doing a last
>> round of tests on his series, this time with this GTask changes
>> applied.
>> Does it sound reasonable?
> 
> 
> Absolutely. my rebased branch is available here: 
> https://cgit.freedesktop.org/~jjongsma/spice-gtk/log/?h=usb-async 
> 
> 
> 
>> 
>>> 
>>> 
>>> 
>>> On Wed, 2016-03-16 at 16:44 -0500, Jonathon Jongsma wrote:
 On Wed, 2016-03-16 at 10:41 -0500, Jonathon Jongsma wrote:
> So, after adding the g_task_return_boolean back to
> _open_device_async_cb(),
> I
> noticed that since g_task_return_error() can potentially complete the
> task
> immediately (rather than in an idle handler done previously), we may be
> executing the GAsyncReadyCallback while the channel is locked.
> Currently, I
> don't think this causes any problems, but if the callback did anything
> that
> required locking the channel's mutex, that could result in a deadlock.
> So
> here's
> an additional proposed patch to unlock before completing the task. If
> this
> change is ACKed, I'd probably squash it into this patch.
> 
> 
> diff --git a/src/channel-usbredir.c b/src/channel-usbredir.c
> index cd2ff4f..aa8e943 100644
> --- a/src/channel-usbredir.c
> +++ b/src/channel-usbredir.c
> @@ -367,17 +367,19 @@ _open_device_async_cb(GTask *task,
> 
> spice_usbredir_channel_lock(channel);
> 
> -if (!spice_usbredir_channel_open_device(channel, )) {
> +spice_usbredir_channel_open_device(channel, );
> +libusb_unref_device(priv->device);
> +priv->device = NULL;
> +g_boxed_free(spice_usb_device_get_type(), priv->spice_device);
> +priv->spice_device = NULL;
> +
> +spice_usbredir_channel_unlock(channel);
> +
> +if (err) {
> g_task_return_error(task, err);
> -libusb_unref_device(priv->device);
> -priv->device = NULL;
> -g_boxed_free(spice_usb_device_get_type(), priv->spice_device);
> -priv->spice_device = NULL;
> } else {
> g_task_return_boolean(task, TRUE);
> }
> -
> -spice_usbredir_channel_unlock(channel);
> }
> #endif
> 
 
 ... And Fabiano pointed out that this patch is incorrect since it frees
 the
 device even if it was successfully redirected. That's clearly wrong. New
 patch
 coming.
 
 
> 
> 
> On Wed, 2016-03-16 at 10:16 -0500, Jonathon Jongsma wrote:
>> On Wed, 2016-03-16 at 11:27 +0100, Christophe Fergeau wrote:
>>> Hey,
>>> 
>>> On Tue, Mar 15, 2016 at 02:31:03PM -0500, Jonathon Jongsma wrote:
 +#ifndef USE_POLKIT
 +static void
 +_open_device_async_cb(GTask *task,
 +  gpointer object,
 +  gpointer task_data,
 +  GCancellable *cancellable)
 +{
 +GError *err = NULL;
 +SpiceUsbredirChannel *channel =
 SPICE_USBREDIR_CHANNEL(object);
 +SpiceUsbredirChannelPrivate *priv = channel->priv;
 +
 +spice_usbredir_channel_lock(channel);
 +
 +if (!spice_usbredir_channel_open_device(channel, )) {
 +g_task_return_error(task, err);
 +libusb_unref_device(priv->device);
 +priv->device = NULL;
 +g_boxed_free(spice_usb_device_get_type(), priv

Re: [Spice-devel] [PATCH v7 10/14] usbredir: Disconnect USB device asynchronously

2016-03-13 Thread Dmitry Fleytman
Hi Jonathon,

see below.

> On 10 Mar 2016, at 22:20 PM, Jonathon Jongsma <jjong...@redhat.com> wrote:
> 
> Sorry, I missed a few more things on this patch the last time I reviewed it :/
> 
> On Tue, 2016-03-08 at 16:05 +0200, Dmitry Fleytman wrote:
>> From: Kirill Moizik <kmoi...@redhat.com>
>> 
>> Signed-off-by: Kirill Moizik <kmoi...@redhat.com>
>> Signed-off-by: Dmitry Fleytman <dfley...@redhat.com>
>> ---
>> src/channel-usbredir.c | 48 +---
>> 1 file changed, 41 insertions(+), 7 deletions(-)
>> 
>> diff --git a/src/channel-usbredir.c b/src/channel-usbredir.c
>> index 7253ce6..ba9e4ab 100644
>> --- a/src/channel-usbredir.c
>> +++ b/src/channel-usbredir.c
>> @@ -113,20 +113,54 @@ static void
>> spice_usbredir_channel_init(SpiceUsbredirChannel *channel)
>> }
>> 
>> #ifdef USE_USBREDIR
>> +
>> +static void _channel_reset_finish(SpiceUsbredirChannel *channel)
>> +{
>> +SpiceUsbredirChannelPrivate *priv = channel->priv;
>> +
>> +spice_usbredir_channel_lock(channel);
>> +
>> +usbredirhost_close(priv->host);
>> +priv->host = NULL;
>> +
>> +/* Call set_context to re-create the host */
>> +spice_usbredir_channel_set_context(channel, priv->context);
>> +
>> +spice_usbredir_channel_unlock(channel);
>> +}
>> +
>> +static void _channel_reset_cb(GObject *gobject,
>> +  GAsyncResult *result,
>> +  gpointer user_data)
>> +{
>> +SpiceChannel *spice_channel =  SPICE_CHANNEL(gobject);
>> +SpiceUsbredirChannel *channel = SPICE_USBREDIR_CHANNEL(spice_channel);
>> +gboolean migrating = GPOINTER_TO_UINT(user_data);
>> +GError *err = NULL;
>> +
>> +_channel_reset_finish(channel);
>> +
>> +SPICE_CHANNEL_CLASS(spice_usbredir_channel_parent_class)
>> ->channel_reset(spice_channel, migrating);
>> +
>> +spice_usbredir_channel_disconnect_device_finish(channel, result, );
> 
> err is leaked if this call is returns a failure.

Right. Fixing it.

> 
>> +g_object_unref(result);
> 
> result should not be unreffed here. The only reference should be held by the
> async operation that invokes this callback. Presumably it will be released 
> after
> this function returns and you will get a crash. If there's no crash, there may
> be a leak, but it should be fixed elsewhere.
 
I may be missing something, but according to [1] result is unreferenced 
explicitly in the callback (see baked_cb sample function).
Please advise.

[1] https://developer.gnome.org/gio/stable/GSimpleAsyncResult.html

Thanks,
Dmitry

> 
>> +}
>> +
>> static void spice_usbredir_channel_reset(SpiceChannel *c, gboolean migrating)
>> {
>> SpiceUsbredirChannel *channel = SPICE_USBREDIR_CHANNEL(c);
>> SpiceUsbredirChannelPrivate *priv = channel->priv;
>> 
>> if (priv->host) {
>> -if (priv->state == STATE_CONNECTED)
>> -spice_usbredir_channel_disconnect_device(channel);
>> -usbredirhost_close(priv->host);
>> -priv->host = NULL;
>> -/* Call set_context to re-create the host */
>> -spice_usbredir_channel_set_context(channel, priv->context);
>> +if (priv->state == STATE_CONNECTED) {
>> +spice_usbredir_channel_disconnect_device_async(channel, NULL,
>> +_channel_reset_cb, GUINT_TO_POINTER(migrating));
>> +} else {
>> +_channel_reset_finish(channel);
>> +}
>> +} else {
>> +SPICE_CHANNEL_CLASS(spice_usbredir_channel_parent_class)
>> ->channel_reset(c, migrating);
>> }
>> -SPICE_CHANNEL_CLASS(spice_usbredir_channel_parent_class)
>> ->channel_reset(c, migrating);
>> }
>> #endif
>> 
> 
> 
> Reviewed-by: Jonathon Jongsma <jjong...@redhat.com 
> <mailto:jjong...@redhat.com>>

___
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/spice-devel


[Spice-devel] [PATCH v7 06/14] usbredir: Spawn a different thread for device redirection flow

2016-03-08 Thread Dmitry Fleytman
From: Kirill Moizik <kmoi...@redhat.com>

On Windows when using usbdk, opening and closing USB device handle,
i.e. calling libusb_open()/libusb_unref_device() can block for a few
seconds (3-5 second more specifically on patch author's HW).

libusb_open() is called by spice_usbredir_channel_open_device().

libusb_unref_device() is called implicitly via
usbredirhost_set_device(..., NULL) from
spice_usbredir_channel_disconnect_device().

Both these calls happen on the main thread. If it blocks,
this causes the UI to freeze.

This commit makes sure libusb_open() is called from a different
thread to avoid blocking the mainloop when usbdk is used.

Following commits also move usbredirhost_set_device(..., NULL) call
to separate threads.

Since this commit introduces additional execution contexts running in
parallel to the main thread there are thread safety concerns to be secured.
Mainly there are 3 types of objects accessed by newly introduced threads:
  1. libusb contexts
  2. usbredir context
  3. redirection channels

Fortunately libusb accesses are either thread safe or already
performed by a separate thread and protected by locks as needed.

As for channels and usbredir, in order to achieve thread safety
additional locks were introduced by previous patches
in preparation to adding asynchronous contexts:

1. Channel objects data accesses from different threads protected with a
   new lock (device_connect_mutex);
2. Handling usbredir messages protected by the same new lock in order to
   ensure there are no messages processing flows in progress when device gets
   connected or disconnected.

Signed-off-by: Kirill Moizik <kmoi...@redhat.com>
Signed-off-by: Dmitry Fleytman <dfley...@redhat.com>
---
 src/channel-usbredir.c | 40 ++--
 1 file changed, 30 insertions(+), 10 deletions(-)

diff --git a/src/channel-usbredir.c b/src/channel-usbredir.c
index 9491f60..b33122a 100644
--- a/src/channel-usbredir.c
+++ b/src/channel-usbredir.c
@@ -313,6 +313,30 @@ static void spice_usbredir_channel_open_acl_cb(
 }
 #endif
 
+#ifndef USE_POLKIT
+static void
+_open_device_async_cb(GSimpleAsyncResult *simple,
+  GObject *object,
+  GCancellable *cancellable)
+{
+GError *err = NULL;
+SpiceUsbredirChannel *channel = SPICE_USBREDIR_CHANNEL(object);
+SpiceUsbredirChannelPrivate *priv = channel->priv;
+
+spice_usbredir_channel_lock(channel);
+
+if (!spice_usbredir_channel_open_device(channel, )) {
+g_simple_async_result_take_error(simple, err);
+libusb_unref_device(priv->device);
+priv->device = NULL;
+g_boxed_free(spice_usb_device_get_type(), priv->spice_device);
+priv->spice_device = NULL;
+}
+
+spice_usbredir_channel_unlock(channel);
+}
+#endif
+
 G_GNUC_INTERNAL
 void spice_usbredir_channel_connect_device_async(
   SpiceUsbredirChannel *channel,
@@ -324,9 +348,6 @@ void spice_usbredir_channel_connect_device_async(
 {
 SpiceUsbredirChannelPrivate *priv = channel->priv;
 GSimpleAsyncResult *result;
-#if ! USE_POLKIT
-GError *err = NULL;
-#endif
 
 g_return_if_fail(SPICE_IS_USBREDIR_CHANNEL(channel));
 g_return_if_fail(device != NULL);
@@ -370,13 +391,12 @@ void spice_usbredir_channel_connect_device_async(
   channel);
 return;
 #else
-if (!spice_usbredir_channel_open_device(channel, )) {
-g_simple_async_result_take_error(result, err);
-libusb_unref_device(priv->device);
-priv->device = NULL;
-g_boxed_free(spice_usb_device_get_type(), priv->spice_device);
-priv->spice_device = NULL;
-}
+g_simple_async_result_run_in_thread(result,
+_open_device_async_cb,
+G_PRIORITY_DEFAULT,
+cancellable);
+g_object_unref(result);
+return;
 #endif
 
 done:
-- 
2.5.0

___
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/spice-devel


[Spice-devel] [PATCH v7 10/14] usbredir: Disconnect USB device asynchronously

2016-03-08 Thread Dmitry Fleytman
From: Kirill Moizik <kmoi...@redhat.com>

Signed-off-by: Kirill Moizik <kmoi...@redhat.com>
Signed-off-by: Dmitry Fleytman <dfley...@redhat.com>
---
 src/channel-usbredir.c | 48 +---
 1 file changed, 41 insertions(+), 7 deletions(-)

diff --git a/src/channel-usbredir.c b/src/channel-usbredir.c
index 7253ce6..ba9e4ab 100644
--- a/src/channel-usbredir.c
+++ b/src/channel-usbredir.c
@@ -113,20 +113,54 @@ static void 
spice_usbredir_channel_init(SpiceUsbredirChannel *channel)
 }
 
 #ifdef USE_USBREDIR
+
+static void _channel_reset_finish(SpiceUsbredirChannel *channel)
+{
+SpiceUsbredirChannelPrivate *priv = channel->priv;
+
+spice_usbredir_channel_lock(channel);
+
+usbredirhost_close(priv->host);
+priv->host = NULL;
+
+/* Call set_context to re-create the host */
+spice_usbredir_channel_set_context(channel, priv->context);
+
+spice_usbredir_channel_unlock(channel);
+}
+
+static void _channel_reset_cb(GObject *gobject,
+  GAsyncResult *result,
+  gpointer user_data)
+{
+SpiceChannel *spice_channel =  SPICE_CHANNEL(gobject);
+SpiceUsbredirChannel *channel = SPICE_USBREDIR_CHANNEL(spice_channel);
+gboolean migrating = GPOINTER_TO_UINT(user_data);
+GError *err = NULL;
+
+_channel_reset_finish(channel);
+
+
SPICE_CHANNEL_CLASS(spice_usbredir_channel_parent_class)->channel_reset(spice_channel,
 migrating);
+
+spice_usbredir_channel_disconnect_device_finish(channel, result, );
+g_object_unref(result);
+}
+
 static void spice_usbredir_channel_reset(SpiceChannel *c, gboolean migrating)
 {
 SpiceUsbredirChannel *channel = SPICE_USBREDIR_CHANNEL(c);
 SpiceUsbredirChannelPrivate *priv = channel->priv;
 
 if (priv->host) {
-if (priv->state == STATE_CONNECTED)
-spice_usbredir_channel_disconnect_device(channel);
-usbredirhost_close(priv->host);
-priv->host = NULL;
-/* Call set_context to re-create the host */
-spice_usbredir_channel_set_context(channel, priv->context);
+if (priv->state == STATE_CONNECTED) {
+spice_usbredir_channel_disconnect_device_async(channel, NULL,
+_channel_reset_cb, GUINT_TO_POINTER(migrating));
+} else {
+_channel_reset_finish(channel);
+}
+} else {
+
SPICE_CHANNEL_CLASS(spice_usbredir_channel_parent_class)->channel_reset(c, 
migrating);
 }
-SPICE_CHANNEL_CLASS(spice_usbredir_channel_parent_class)->channel_reset(c, 
migrating);
 }
 #endif
 
-- 
2.5.0

___
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/spice-devel


[Spice-devel] [PATCH v7 13/14] UsbDeviceWidget: Use asynchronous disconnect API

2016-03-08 Thread Dmitry Fleytman
From: Kirill Moizik <kmoi...@redhat.com>

Signed-off-by: Kirill Moizik <kmoi...@redhat.com>
Signed-off-by: Dmitry Fleytman <dfley...@redhat.com>
---
 src/usb-device-widget.c | 42 +-
 1 file changed, 33 insertions(+), 9 deletions(-)

diff --git a/src/usb-device-widget.c b/src/usb-device-widget.c
index 56bdeaf..cafaf78 100644
--- a/src/usb-device-widget.c
+++ b/src/usb-device-widget.c
@@ -436,6 +436,29 @@ typedef struct _connect_cb_data {
 SpiceUsbDeviceWidget *self;
 } connect_cb_data;
 
+static void connect_cb_data_free(connect_cb_data *data)
+{
+spice_usb_device_widget_update_status(data->self);
+g_object_unref(data->check);
+g_object_unref(data->self);
+g_free(data);
+}
+
+static void _disconnect_cb(GObject *gobject, GAsyncResult *res, gpointer 
user_data)
+{
+SpiceUsbDeviceManager *manager = SPICE_USB_DEVICE_MANAGER(gobject);
+connect_cb_data *data = user_data;
+GError *err = NULL;
+
+spice_usb_device_manager_disconnect_device_finish(manager, res, );
+if (err) {
+SPICE_DEBUG("Device disconnection failed");
+g_error_free(err);
+}
+
+connect_cb_data_free(data);
+}
+
 static void connect_cb(GObject *gobject, GAsyncResult *res, gpointer user_data)
 {
 SpiceUsbDeviceManager *manager = SPICE_USB_DEVICE_MANAGER(gobject);
@@ -461,10 +484,7 @@ static void connect_cb(GObject *gobject, GAsyncResult 
*res, gpointer user_data)
 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(data->check), FALSE);
 }
 
-spice_usb_device_widget_update_status(self);
-g_object_unref(data->check);
-g_object_unref(data->self);
-g_free(data);
+connect_cb_data_free(data);
 }
 
 static void checkbox_clicked_cb(GtkWidget *check, gpointer user_data)
@@ -474,19 +494,23 @@ static void checkbox_clicked_cb(GtkWidget *check, 
gpointer user_data)
 SpiceUsbDevice *device;
 
 device = g_object_get_data(G_OBJECT(check), "usb-device");
+connect_cb_data *data = g_new(connect_cb_data, 1);
+data->check = g_object_ref(check);
+data->self  = g_object_ref(self);
 
 if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(check))) {
-connect_cb_data *data = g_new(connect_cb_data, 1);
-data->check = g_object_ref(check);
-data->self  = g_object_ref(self);
 spice_usb_device_manager_connect_device_async(priv->manager,
   device,
   NULL,
   connect_cb,
   data);
 } else {
-spice_usb_device_manager_disconnect_device(priv->manager,
-   device);
+spice_usb_device_manager_disconnect_device_async(priv->manager,
+ device,
+ NULL,
+ _disconnect_cb,
+ data);
+
 }
 spice_usb_device_widget_update_status(self);
 }
-- 
2.5.0

___
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/spice-devel


[Spice-devel] [PATCH v7 07/14] UsbDeviceManager: Track device redirection operations in progress

2016-03-08 Thread Dmitry Fleytman
From: Kirill Moizik <kmoi...@redhat.com>

During device connection, unwanted hotplug events may happen.
We need to ignore those therefore we track redirection operations
in progress.

See also comment to commit
"Do not process USB hotplug events while redirection is in progress"
that introduces corresponding filtering out logic.

Signed-off-by: Kirill Moizik <kmoi...@redhat.com>
Signed-off-by: Dmitry Fleytman <dfley...@redhat.com>
---
 src/usb-device-manager.c | 69 +++-
 1 file changed, 56 insertions(+), 13 deletions(-)

diff --git a/src/usb-device-manager.c b/src/usb-device-manager.c
index 4d376b6..fc0f15f 100644
--- a/src/usb-device-manager.c
+++ b/src/usb-device-manager.c
@@ -122,6 +122,7 @@ struct _SpiceUsbDeviceManagerPrivate {
 GUdevClient *udev;
 libusb_device **coldplug_list; /* Avoid needless reprobing during init */
 #else
+gboolean redirecting; /* Handled by GUdevClient in the gudev case */
 libusb_hotplug_callback_handle hp_handle;
 #endif
 #ifdef G_OS_WIN32
@@ -208,10 +209,25 @@ 
_spice_usb_device_manager_connect_device_async(SpiceUsbDeviceManager *self,
GAsyncReadyCallback callback,
gpointer user_data);
 
+static
+void _connect_device_async_cb(GObject *gobject,
+  GAsyncResult *channel_res,
+  gpointer user_data);
+
 G_DEFINE_BOXED_TYPE(SpiceUsbDevice, spice_usb_device,
 (GBoxedCopyFunc)spice_usb_device_ref,
 (GBoxedFreeFunc)spice_usb_device_unref)
 
+static void
+_set_redirecting(SpiceUsbDeviceManager *self, gboolean is_redirecting)
+{
+#ifdef USE_GUDEV
+g_object_set(self->priv->udev, "redirecting", is_redirecting, NULL);
+#else
+self->priv->redirecting = is_redirecting;
+#endif
+}
+
 #else
 G_DEFINE_BOXED_TYPE(SpiceUsbDevice, spice_usb_device, g_object_ref, 
g_object_unref)
 #endif
@@ -1135,7 +1151,7 @@ static void 
spice_usb_device_manager_drv_install_cb(GObject *gobject,
 SpiceUsbDevice *device;
 UsbInstallCbInfo *cbinfo;
 GCancellable *cancellable;
-GAsyncReadyCallback callback;
+gpointer data;
 
 g_return_if_fail(user_data != NULL);
 
@@ -1144,8 +1160,7 @@ static void 
spice_usb_device_manager_drv_install_cb(GObject *gobject,
 device  = cbinfo->device;
 installer   = cbinfo->installer;
 cancellable = cbinfo->cancellable;
-callback= cbinfo->callback;
-user_data   = cbinfo->user_data;
+data= cbinfo->user_data;
 
 g_free(cbinfo);
 
@@ -1167,8 +1182,8 @@ static void 
spice_usb_device_manager_drv_install_cb(GObject *gobject,
 _spice_usb_device_manager_connect_device_async(self,
device,
cancellable,
-   callback,
-   user_data);
+   _connect_device_async_cb,
+   data);
 
 spice_usb_device_unref(device);
 }
@@ -1496,6 +1511,8 @@ 
_spice_usb_device_manager_uninstall_driver_async(SpiceUsbDeviceManager *self,
 
 #endif
 
+#ifdef USE_USBREDIR
+
 static void
 _spice_usb_device_manager_connect_device_async(SpiceUsbDeviceManager *self,
SpiceUsbDevice *device,
@@ -1513,7 +1530,6 @@ 
_spice_usb_device_manager_connect_device_async(SpiceUsbDeviceManager *self,
 result = g_simple_async_result_new(G_OBJECT(self), callback, user_data,
spice_usb_device_manager_connect_device_async);
 
-#ifdef USE_USBREDIR
 SpiceUsbDeviceManagerPrivate *priv = self->priv;
 libusb_device *libdev;
 guint i;
@@ -1559,18 +1575,17 @@ 
_spice_usb_device_manager_connect_device_async(SpiceUsbDeviceManager *self,
 libusb_unref_device(libdev);
 return;
 }
-#endif
 
 g_simple_async_result_set_error(result,
 SPICE_CLIENT_ERROR, SPICE_CLIENT_ERROR_FAILED,
 _("No free USB channel"));
-#ifdef USE_USBREDIR
 done:
-#endif
 g_simple_async_result_complete_in_idle(result);
 g_object_unref(result);
 }
 
+#endif
+
 /**
  * spice_usb_device_manager_connect_device_async:
  * @self: a #SpiceUsbDeviceManager.
@@ -1589,11 +1604,20 @@ void 
spice_usb_device_manager_connect_device_async(SpiceUsbDeviceManager *self,
  GAsyncReadyCallback callback,
  gpointer user_data)
 {
+g_return_if_fail(SPICE_IS_USB_DEVICE_MANAGER(self));
 
-#if defined(USE_USBREDIR) && defined(G_OS_WIN32)
+#ifdef USE_USBREDIR
+
+GSimpleAsy

[Spice-devel] [PATCH v7 04/14] GUdevClient: Do not process USB hotplug events while redirection is in progress

2016-03-08 Thread Dmitry Fleytman
From: Kirill Moizik <kmoi...@redhat.com>

USB redirection flow on Windows includes a number of reset requests issued
to the port that hosts the device deing redirected.

Each port reset emulates device removal and reinsertion and produces
corresponding hotplug events and a number of device list updates on
different levels of USB stack and USB redirection engine.

As a result, queriyng USB device list performed by spice-gtk's hotplug
event handler may return inconsistent results if performed in parallel
to redirection flow.

This patch suppresses handling of USB hotplug events during redirection
and injects a simulated hotplug event after redirection completion
in order to properly process real device list changes in case they
happened during the redirection flow.

Signed-off-by: Kirill Moizik <kmoi...@redhat.com>
Signed-off-by: Dmitry Fleytman <dfley...@redhat.com>
---
 src/win-usb-dev.c | 19 +++
 1 file changed, 19 insertions(+)

diff --git a/src/win-usb-dev.c b/src/win-usb-dev.c
index 0e86d39..1cf9f21 100644
--- a/src/win-usb-dev.c
+++ b/src/win-usb-dev.c
@@ -293,6 +293,8 @@ static void g_udev_client_get_property(GObject *gobject,
 }
 }
 
+static void handle_dev_change(GUdevClient *self);
+
 static void g_udev_client_set_property(GObject   *gobject,
guint  prop_id,
const GValue  *value,
@@ -300,10 +302,18 @@ static void g_udev_client_set_property(GObject   
*gobject,
 {
 GUdevClient *self = G_UDEV_CLIENT(gobject);
 GUdevClientPrivate *priv = self->priv;
+gboolean old_val;
 
 switch (prop_id) {
 case PROP_REDIRECTING:
+old_val = priv->redirecting;
 priv->redirecting = g_value_get_boolean(value);
+if (old_val && !priv->redirecting) {
+/* This is a redirection completion case.
+   Inject hotplug event in case we missed device changes
+   during redirection processing. */
+handle_dev_change(self);
+}
 break;
 default:
 G_OBJECT_WARN_INVALID_PROPERTY_ID(gobject, prop_id, pspec);
@@ -412,6 +422,15 @@ static void handle_dev_change(GUdevClient *self)
 GError *err = NULL;
 GList *now_devs = NULL;
 
+if (priv->redirecting == TRUE) {
+/* On Windows, querying USB device list may return inconsistent results
+   if performed in parallel to redirection flow.
+   A simulated hotplug event will be injected after redirection
+   completion in order to process real device list changes that may
+   had taken place during redirection process. */
+return;
+}
+
 if(g_udev_client_list_devices(self, _devs, , __FUNCTION__) < 0) {
 g_warning("could not retrieve device list");
 return;
-- 
2.5.0

___
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/spice-devel


[Spice-devel] [PATCH v7 09/14] UsbDeviceManager: Track device disconnection operations in progress

2016-03-08 Thread Dmitry Fleytman
From: Kirill Moizik <kmoi...@redhat.com>

During device disconnection, unwanted hotplug events may happen.
We need to ignore those therefore we track disconnection operations
in progress.

See also comment to commit
"Do not process USB hotplug events while redirection is in progress"
that introduces corresponding filtering out logic.

Signed-off-by: Kirill Moizik <kmoi...@redhat.com>
Signed-off-by: Dmitry Fleytman <dfley...@redhat.com>
---
 src/usb-device-manager.c | 7 +--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/usb-device-manager.c b/src/usb-device-manager.c
index 639e5cc..73f9083 100644
--- a/src/usb-device-manager.c
+++ b/src/usb-device-manager.c
@@ -1746,16 +1746,17 @@ void _disconnect_device_async_cb(GObject *gobject,
 SpiceUsbredirChannel  *channel = SPICE_USBREDIR_CHANNEL(gobject);
 disconnect_cb_data*data= user_data;
 GSimpleAsyncResult*result  = G_SIMPLE_ASYNC_RESULT(data->result);
+SpiceUsbDeviceManager *self = SPICE_USB_DEVICE_MANAGER(data->self);
 GError *err = NULL;
 
 #ifdef G_OS_WIN32
-SpiceUsbDeviceManager *self = SPICE_USB_DEVICE_MANAGER(data->self);
-
 if (self->priv->use_usbclerk) {
 _spice_usb_device_manager_uninstall_driver_async(self, data->device);
 }
 #endif
 
+_set_redirecting(self, FALSE);
+
 spice_usbredir_channel_disconnect_device_finish(channel, channel_res, 
);
 if (err) {
 g_simple_async_result_take_error(result, err);
@@ -1783,6 +1784,8 @@ void 
spice_usb_device_manager_disconnect_device_async(SpiceUsbDeviceManager *sel
 
 SpiceUsbredirChannel *channel;
 
+_set_redirecting(self, TRUE);
+
 channel = spice_usb_device_manager_get_channel_for_dev(self, device);
 nested  = g_simple_async_result_new(G_OBJECT(self), callback, user_data,
   
spice_usb_device_manager_disconnect_device_async);
-- 
2.5.0

___
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/spice-devel


[Spice-devel] [PATCH v7 12/14] UsbDeviceWidget: Consider asynchronous redirection flows

2016-03-08 Thread Dmitry Fleytman
From: Kirill Moizik <kmoi...@redhat.com>

Gray out redirection controls while there are
asynchronous redirection flows in progress.

Signed-off-by: Kirill Moizik <kmoi...@redhat.com>
Signed-off-by: Dmitry Fleytman <dfley...@redhat.com>
---
 src/usb-device-widget.c | 38 --
 1 file changed, 20 insertions(+), 18 deletions(-)

diff --git a/src/usb-device-widget.c b/src/usb-device-widget.c
index 9409036..56bdeaf 100644
--- a/src/usb-device-widget.c
+++ b/src/usb-device-widget.c
@@ -374,27 +374,29 @@ static void check_can_redirect(GtkWidget *widget, 
gpointer user_data)
 return; /* Non device widget, ie the info_bar */
 
 priv->device_count++;
-can_redirect = spice_usb_device_manager_can_redirect_device(priv->manager,
-device, );
-gtk_widget_set_sensitive(widget, can_redirect);
-
-/* If we cannot redirect this device, append the error message to
-   err_msg, but only if it is *not* already there! */
-if (!can_redirect) {
-if (priv->err_msg) {
-if (!strstr(priv->err_msg, err->message)) {
-gchar *old_err_msg = priv->err_msg;
 
-priv->err_msg = g_strdup_printf("%s\n%s", priv->err_msg,
-err->message);
-g_free(old_err_msg);
+if (spice_usb_device_manager_is_redirecting(priv->manager)) {
+can_redirect = FALSE;
+} else {
+can_redirect = 
spice_usb_device_manager_can_redirect_device(priv->manager,
+device, 
);
+/* If we cannot redirect this device, append the error message to
+   err_msg, but only if it is *not* already there! */
+if (!can_redirect) {
+if (priv->err_msg) {
+if (!strstr(priv->err_msg, err->message)) {
+gchar *old_err_msg = priv->err_msg;
+priv->err_msg = g_strdup_printf("%s\n%s", priv->err_msg,
+err->message);
+g_free(old_err_msg);
+}
+} else {
+priv->err_msg = g_strdup(err->message);
 }
-} else {
-priv->err_msg = g_strdup(err->message);
 }
+g_clear_error();
 }
-
-g_clear_error();
+gtk_widget_set_sensitive(widget, can_redirect);
 }
 
 static gboolean spice_usb_device_widget_update_status(gpointer user_data)
@@ -457,9 +459,9 @@ static void connect_cb(GObject *gobject, GAsyncResult *res, 
gpointer user_data)
 g_error_free(err);
 
 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(data->check), FALSE);
-spice_usb_device_widget_update_status(self);
 }
 
+spice_usb_device_widget_update_status(self);
 g_object_unref(data->check);
 g_object_unref(data->self);
 g_free(data);
-- 
2.5.0

___
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/spice-devel


  1   2   3   >