Commit Graph

133 Commits

Author SHA1 Message Date
Yuri Benditovich
53ca7ce4cd qxl-wddm-dod: Fix for screen not shown after driver disabled
https://bugzilla.redhat.com/show_bug.cgi?id=1411340
Do not set SupportNonVGA field for device rev.4 and higher.
Then the class driver will not call miniport's procedure
StopDeviceAndReleasePostDisplayOwnership upon PnP stop.
QXL device modes are not compatible with VGA ones; the
driver in this procedure returns display information related
to QXL mode which later used by BasicDisplay driver and causes
it to show the screen incorrectly or fail to show it at all.

Signed-off-by: Yuri Benditovich <yuri.benditovich@daynix.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2017-01-26 11:27:01 +00:00
Frediano Ziglio
31ca5d035d Implements screen to screen move correctly
Doing some fast check on Windows 8.1 you could note that
moving windows you got a weird effect were windows were a
bit misaligned.
As documented in DXGKARG_PRESENT_DISPLAYONLY page
NumMoves/pMoves fields point to an array of screen-to-screen
moves while our code implemented them as an image drawing
(the same implementation of dirty rects) causing the weird
effect mentioned.
This patch implement the moves using QXL_COPY_BITS operation
instead of a QXL_DRAW_COPY fixing the issue and avoiding sending
image to the server making the move/scroll operations on the
guest faster (and taking less bandwidth).
It seems that Windows 10 doesn't send the move commands but
instead send only dirty rects so you can't note this problem
using Windows 10.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Yuri Benditovich <yuri.benditovich@daynix.com>
2016-12-06 06:44:24 +00:00
Javier Celaya
a495c21748 Fix default mode pitch
Signed-off-by: Javier Celaya <javier.celaya@flexvdi.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2016-11-23 18:23:35 +00:00
Javier Celaya
1af6eb074c Remove unused code
Signed-off-by: Javier Celaya <javier.celaya@flexvdi.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2016-11-23 18:23:14 +00:00
Javier Celaya
0ee4b29ea5 Send HIDE command when pointer is not visible
This avoids having 2 pointers (client and server) if Windows decides
to render the mouse by itself. This happens, for instance, when moving
windows around.

Signed-off-by: Javier Celaya <javier.celaya@flexvdi.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2016-11-21 15:11:02 +00:00
Yuri Benditovich
da0680c8d5 qxl-wddm-dod: Enable hardware pointer acceleration
Windows disables hw pointer acceleration and draws the cursor
in frame buffer if the driver does not report pointer capabilities
in QueryAdapterInfo. In this mode OS usually does not send pointer
commands to the driver or does it with pointer set to invisible
state. This mode of operation consumes CPU time and device-to-host
traffic. Now we enable pointer hardware acceleration.

Signed-off-by: Yuri Benditovich <yuri.benditovich@daynix.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2016-11-21 14:05:49 +00:00
Frediano Ziglio
3fe5c540f7 Update some file copyright statements
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Christophe Fergeau <cfergeau@redhat.com>
2016-11-07 09:45:14 +00:00
Christophe Fergeau
4332d07c73 Change licence to Apache v2
A more permissive licence is more in line with what Microsoft requires
for its WHQL certification

Signed-off-by: Christophe Fergeau <cfergeau@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2016-11-04 11:18:09 +00:00
Sameeh Jubran
4cba150eee Fixing indentation
Signed-off-by: Sameeh Jubran <sameeh@daynix.com>
Acked-by: Pavel Grunt <pgrunt@redhat.com>
2016-10-31 09:34:45 +00:00
Sameeh Jubran
1afadc7aeb Indicate all Qxl devices as VGA
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

Signed-off-by: Sameeh Jubran <sameeh@daynix.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2016-10-19 17:58:55 +01:00
Sameeh Jubran
9501316d4c Code Analysis fix
Remove specifier that was causing a warning.

Based on a patch by Sandy Stutsman <sstutsma@redhat.com>

Signed-off-by: Sameeh Jubran <sameeh@daynix.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2016-10-19 17:45:21 +01:00
Frediano Ziglio
de8062e7b6 Use MmMapIoSpaceEx instead of MmMapIoSpace
Disable execution bit on mapping improving security.

MmMapIoSpaceEx is available only in Windows 10 so
to provide binary compatibility detect the new
function dynamically.
Added a separate compatibility file.

Based on a patch by Sandy Stutsman <sstutsma@redhat.com>

Signed-off-by: Sameeh Jubran <sameeh@daynix.com>
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
2016-10-19 17:39:42 +01:00
Frediano Ziglio
a86ef3acf8 Mark all functions that should go to non paged sections
This make sure that these function goes into the non
paged section.
Also this change is much shorter than marking code if
can be paged as almost code can be paged.
It's also coherent with other source files.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Sameeh Jubran <sameeh@daynix.com>
2016-10-19 17:39:15 +01:00
Frediano Ziglio
8eecca8c75 Add missing calls to PAGED_CODE
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
2016-10-19 17:34:50 +01:00
Sameeh Jubran
93cb3c8caf Call "DxgkCbAcquirePostDisplayOwnership" when changing Power State to D0
Starting with Windows Display Driver Model (WDDM) 1.2, if the
DevicePowerState parameter is set to PowerDeviceD0, the display miniport
driver should call DxgkCbAcquirePostDisplayOwnership to query the
information about the display mode.

This patch fixies this bug:
https://bugzilla.redhat.com/show_bug.cgi?id=1202267

Signed-off-by: Sameeh Jubran <sameeh@daynix.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2016-10-19 17:20:37 +01:00
Sameeh Jubran
14e2a147df Fixing black-white screen in installation when qxl revision = 3
When qxl revision is 3, the vga driver is the one that is running.
While installing the driver the function VgaDevice::HWInit
has displayInfo structure zeroed out. The displayInfo should be
initialized using DxgkCbAcquirePostDisplayOwnership and thus it
should be called before calling HWInit.

Please note that we can't just move the call to "DxgkCbAcquirePostDisplayOwnership"
before calling HWInit as the m_Id isn't initialized for QxlDevice until the call to HWinit is over.

This patch fixes a bug similar to the one found here:
https://bugzilla.redhat.com/show_bug.cgi?id=1202267
However this one occurs when installing the driver.

Signed-off-by: Sameeh Jubran <sameeh@daynix.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2016-10-19 17:17:43 +01:00
Sameeh Jubran
725c0827bf Code Analysis and style fix
Based on a patch by Sandy Stutsman <sstutsma@redhat.com>

Signed-off-by: Sameeh Jubran <sameeh@daynix.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2016-09-28 13:00:21 +01:00
Sameeh Jubran
f2c637c96d Use PAGED_CODE() at the beginning of each pageable method
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 <sstutsma@redhat.com>

Signed-off-by: Sameeh Jubran <sameeh@daynix.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2016-09-28 12:53:42 +01:00
Sameeh Jubran
bcff8a6d4e Fix source buffer mapping in PresentDisplayOnly
Part of source image mapped by PresentDisplayOnly
should be big enough to cover all rectangles being
transferred.

Signed-off-by: Sameeh Jubran <sameeh@daynix.com>
Signed-off-by: Dmitry Fleytman <dmitry@daynix.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2016-09-28 12:31:38 +01:00
Sameeh Jubran
54e2f808c9 Fixing framebuffer usage logic
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: Dmitry Fleytman <dmitry@daynix.com>
Signed-off-by: Sameeh Jubran <sameeh@daynix.com>
2016-09-28 11:43:19 +01:00
Sameeh Jubran
2ab3b7a1fc Use frame buffer in VGA mode only
Framebuffer should only be used in VGA mode, as WDDM DOD
driver doesn't use the frame buffer (bar0), so no
reason to map in into memory. However the mode is only known
at runtime therefore framebuffer logic should be active when the
driver is operating in vga mode only.

There were rare BSOD failures when the mapping failed.

Signed-off-by: Sameeh Jubran <sameeh@daynix.com>
Signed-off-by: Dmitry Fleytman <dmitry@daynix.com>
2016-09-26 16:53:52 +01:00
Sameeh Jubran
f5527d0ae3 Removing unnecessary call to BlackOutScreen
This call to BlackOutScreen is not needed since the actual
display surface is destroyed and created (redrawn) again.

Signed-off-by: Sameeh Jubran <sameeh@daynix.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2016-09-26 16:33:46 +01:00
Sameeh Jubran
f87019cb01 Fixing possible BSOD
Interrupts seem to arrive to the driver before the initialization phase
is over (m_pHWDevice = NULL), in that case we can't handle interrupts yet.
Even when m_pHWDevice isn't NULL, other fields aren't necessarily fully
initialized till the StartDevice function has finished initialization,
thus the flag DriverStarted should be checked upon interrupts.

Note: There is no way provided by Microsoft to disable interrupts in WDDM
drivers.

Signed-off-by: Sameeh Jubran <sameeh@daynix.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2016-09-26 15:37:32 +01:00
Sameeh Jubran
f6e099db39 Use the second bar (VRAM) for qxl command buffer.
Based on a patch by Sandy Stutsman <sstutsma@redhat.com>

Signed-off-by: Sameeh Jubran <sameeh@daynix.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2016-09-12 10:20:10 +01:00
Sameeh Jubran
af4947793e Add arbitrary resolution and monitors_config Escape
This patch adds support for arbitrary resolution and updating
monitor configurations using custom ioctls.

This patch doesn't make any restriction for minimal resolution at all
as Windows can handle low resolution just fine, moreover the old (XPDM)
driver behaves like this too.

Based on a patch by Sandy Stutsman <sstutsma@redhat.com>

Signed-off-by: Sameeh Jubran <sameeh@daynix.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2016-09-12 10:13:33 +01:00
Sameeh Jubran
ed816593b6 Fixed misspelling
Fixed misspelling: HwDeviceInterface
Fixed misspelling: GetDxgkInterface

Based on a patch by Sandy Stutsman <sstutsma@redhat.com>

Signed-off-by: Sameeh Jubran <sameeh@daynix.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2016-09-11 22:42:35 +01:00
Sameeh Jubran
aa0b291186 Support future Qxl revisions
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 <sameeh@daynix.com>
Signed-off-by: Dmitry Fleytman <dmitry@daynix.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2016-09-09 14:17:19 +01:00
Sameeh Jubran
27713ea765 Fixing Move rectangles implementation
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 doesn't take into account
the shift of the given source point at all. This patch fixies the issue.

Signed-off-by: Sameeh Jubran <sameeh@daynix.com>
Signed-off-by: Dmitry Fleytman <dmitry@daynix.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2016-09-09 14:15:18 +01:00
Sameeh Jubran
2a4def7434 Set SupportNonVGA in QueryAdapterInfo callback
This capability flag should be set in order
to indicate to the OS that callback
DxgkDdiStopDeviceAndReleasePostDisplayOwnership
is supported.

Signed-off-by: Sameeh Jubran <sameeh@daynix.com>
Signed-off-by: Dmitry Fleytman <dmitry@daynix.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2016-09-09 11:45:09 +01:00
Sameeh Jubran
7383452757 Replacing tabs with spaces
Signed-off-by: Sameeh Jubran <sameeh@daynix.com>
Signed-off-by: Dmitry Fleytman <dmitry@daynix.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2016-09-09 11:17:42 +01:00
Sameeh Jubran
30ee4d8b20 Fix handling of monochrome cursors
* Allow for 1bpp bitmap followed by 1bpp XOR map.

Based on a patch by Sandy Stutsman <sstutsma@redhat.com>

Signed-off-by: Sameeh Jubran <sameeh@daynix.com>

Acked-by: Frediano Ziglio <fziglio@redhat.com>
2016-09-09 11:02:16 +01:00
Sameeh Jubran
ebfb912125 Remove unused notify present display only interrupt
Signed-off-by: Sameeh Jubran <sameeh@daynix.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2016-09-09 10:53:40 +01:00
Frediano Ziglio
06ab9c9595 Normalise line ending
Some files had different line ending (some lines DOS while some others
UNIX). Use the same line ending using the nearest ending.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Christophe Fergeau <cfergeau@redhat.com>
2016-09-09 10:49:09 +01:00
Sameeh Jubran
eae8b8a103 Fixing monitor flicker on resolution change
Passing the flag QXL_SURF_FLAG_KEEP_DATA to the new created surface
causes weird flickering, thus this should be set to 0.

Signed-off-by: Sameeh Jubran <sameeh@daynix.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2016-09-08 13:20:23 +01:00
Sameeh Jubran
d1ceca6b07 Reserved must be set to 0
According to msdn, "The display miniport driver must set this
value to 0"

Signed-off-by: Sameeh Jubran <sameeh@daynix.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2016-09-08 13:19:31 +01:00
Sameeh Jubran
20487e2247 On power wake call the init functions before setting the vidpn to black. Otherwise, BSOD.
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2016-09-08 13:16:36 +01:00
Sameeh Jubran
35c93f3886 Fix interrupt mask
Signed-off-by: Sameeh Jubran <sameeh@daynix.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2016-09-08 13:15:38 +01:00
Sandy Stutsman
e828c45bf2 Use SrcPitch when calculating size of memory to map PresentDisplayOnly
Can result in a BSOD, as the image would be mapped only partially causing page faults when
accessing missing piece of the image.

Acked-by: Frediano Ziglio <fziglio@redhat.com>
2016-09-08 13:13:55 +01:00
Sandy Stutsman
8ec2bf9c68 Fix Code Integrity error generated by the Drive Verifier
Add MdlMappingNoExecute to MmGetSystemAddressForMDLSafe call in
ExecutePresentDisplayOnly.

Acked-by: Frediano Ziglio <fziglio@redhat.com>
2016-09-08 13:12:43 +01:00
Reza Jelveh
f1cee95ea2 move cursor to cursor channel 2015-07-20 21:45:32 +10:00
Vadim Rozenfeld
89e4d5dd6f Merge remote-tracking branch 'remotes/qxl-wddm-next/work'
Conflicts:
	qxldod/BaseObject.cpp
	qxldod/QxlDod.cpp
	qxldod/QxlDod.h
	qxldod/callVisualStudio.bat
	qxldod/checkWin8Tools.bat
	qxldod/driver.cpp
	qxldod/driver.h
	qxldod/getVisualStudioCmdLine.vbs
	qxldod/qxldod.vcxproj
	qxldod/qxldod.vcxproj.filters
2015-04-10 15:30:05 +10:00
Vadim Rozenfeld
165b53d48b fix BSOD when disabling device 2015-03-30 22:57:12 +11:00
Vadim Rozenfeld
4b168bbbef trivial cleanups 2015-03-24 17:22:45 +11:00
Vadim Rozenfeld
4fc48d370f fix crashes when verifier is running 2015-03-24 16:41:58 +11:00
Vadim Rozenfeld
5f7bba4cbc fix resize problem (reported and fixed by Sandy Stutsman 2015-03-18 22:58:25 +11:00
Vadim Rozenfeld
2317e7c1d4 align arbitrary resolution 2015-02-23 22:21:14 +11:00
Vadim Rozenfeld
f059ee240e fix resolution mismatch when switching between VGA and QXL modes
(cherry picked from commit b2a0aef4a5)
2015-02-19 21:09:45 +11:00
Vadim Rozenfeld
b2a0aef4a5 fix resolution mismatch when switching between VGA and QXL modes 2015-02-19 21:07:24 +11:00
Vadim Rozenfeld
fa8291cf37 publish adding a new resolution
(cherry picked from commit 7693d4153c)
2015-02-18 21:07:52 +11:00
Vadim Rozenfeld
8d33c3072e implement Escape handler
(cherry picked from commit 170be1696a)
2015-02-18 21:07:34 +11:00
Vadim Rozenfeld
3d329228d5 trivial cleanup
(cherry picked from commit 024b2b30b9)
2015-02-18 21:04:07 +11:00
Vadim Rozenfeld
7693d4153c publish adding a new resolution 2015-02-18 20:57:00 +11:00
Vadim Rozenfeld
170be1696a implement Escape handler 2015-02-08 21:04:39 +11:00
Vadim Rozenfeld
024b2b30b9 trivial cleanup 2014-12-15 20:31:09 +11:00
Vadim Rozenfeld
b15d2f5bbd Merge branch 'master' of https://github.com/vrozenfe/qxl-dod
Conflicts:
	qxldod/QxlDod.h
2014-12-08 18:51:38 +11:00
Vadim Rozenfeld
5c16429c9f add multi-monitor support in QXL mode
(cherry picked from commit 861b2d2d44)
2014-12-08 18:44:12 +11:00
Vadim Rozenfeld
ec8f7270bf publish qxl device id
(cherry picked from commit 2885958174)
2014-12-08 18:43:51 +11:00
Vadim Rozenfeld
861b2d2d44 add multi-monitor support in QXL mode 2014-12-06 15:44:28 +11:00
Vadim Rozenfeld
2885958174 publish qxl device id 2014-12-06 09:20:04 +11:00
Vadim Rozenfeld
c2872462a8 read vga and cursor registry parameters 2014-09-07 21:12:24 +10:00
Vadim Rozenfeld
5c52e50bf8 initial commit 2014-09-02 17:36:27 +10:00
Vadim Rozenfeld
8ffc5298ad fix compatebility issue 2014-08-24 20:02:56 +10:00
Vadim Rozenfeld
d2d1b4ddd5 disable HW pointer acceleration 2014-08-18 23:08:42 +10:00
Vadim Rozenfeld
7a701b755e disable UpdateArea 2014-07-08 14:07:43 +10:00
Vadim Rozenfeld
818fbe3d54 fix PM handlers 2014-06-30 21:52:18 +10:00
Vadim Rozenfeld
6a37c24fce fix pointer activation handler 2014-06-30 21:46:52 +10:00
Vadim Rozenfeld
81866f50f0 add support for color cursor 2014-06-22 19:18:15 +10:00
Vadim Rozenfeld
81b623f096 cursor shape and move support funtions 2014-06-16 21:26:18 +10:00
Vadim Rozenfeld
1f7a5e66f3 add qxl BlackOutScreen placeholder 2014-06-14 17:43:27 +10:00
Vadim Rozenfeld
eb3d966913 sync io access 2014-06-14 13:25:00 +10:00
Vadim Rozenfeld
29e0336de5 fix resolution problem 2014-06-12 23:36:15 +10:00
Vadim Rozenfeld
c43d7065b6 replace spinlocks with mutex 2014-06-12 23:34:25 +10:00
Vadim Rozenfeld
e04e2d683e fix dpc routine 2014-06-11 22:14:20 +10:00
Vadim Rozenfeld
2dffd51c87 fix blt path 2014-06-05 22:27:10 +10:00
Vadim Rozenfeld
e9449a5610 add isr, dpc, and bliting support sunctions 2014-05-12 23:10:30 +10:00
Vadim Rozenfeld
947a854992 add memory and resources allocation functions 2014-04-29 00:32:32 +10:00
Vadim Rozenfeld
529445dbb9 add dual interface to support QXL or VGA modes 2014-03-10 22:49:58 +11:00
Vadim Rozenfeld
08a8760977 more qxl bits 2014-02-04 22:50:47 +11:00
Vadim Rozenfeld
4947c22618 add qxl pci initialization bits.
Conflicts:
	qxldod/QxlDod.cpp
	qxldod/driver.cpp
2014-01-27 12:53:42 +11:00
Vadim Rozenfeld
52603878f1 add HW device interface 2014-01-26 22:28:01 +11:00
Vadim Rozenfeld
965ff992b6 fix bug in the modes initialization list 2014-01-02 20:58:18 +11:00
Vadim Rozenfeld
10be00160d add resolutions and PM support 2013-12-30 23:02:44 +11:00
Vadim Rozenfeld
a3f72ee429 Basic VGA support 2013-12-09 21:55:42 +11:00