Commit Graph

179 Commits

Author SHA1 Message Date
Yuri Benditovich
1594c4c545 add Wix script for driver installation
Signed-off-by: Yuri Benditovich <yuri.benditovich@daynix.com>
2019-12-09 16:18:51 +02:00
Yuri Benditovich
636adb0977 Updated Changelog for v0.19
Signed-off-by: Yuri Benditovich <yuri.benditovich@daynix.com>
2019-04-11 10:51:15 +03:00
Yuri Benditovich
6c7100de51 qxl-wddm-dod: prevent failure of power on transition
On return from S3 the driver may receive failure when
calls DxgkCbAcquirePostDisplayOwnership. In general the
driver is not expected to use this method when returns
from S3 but it is not simple to distinguish between S3
and S4 power transition (possible, due to hybrid sleep).
Current commit avoids returning error on power transition
and obtains best known default video mode info instead.

Signed-off-by: Yuri Benditovich <yuri.benditovich@daynix.com>
Acked-by: Marek Kedzierski <mkedzier@redhat.com>
2019-03-11 13:02:10 +00:00
Yuri Benditovich
7f81d670e4 qxl-wddm-dod: Load best know defaults for video mode at driver's start
Even if initial display resolution is not available at driver start, try
to find it in the registry. Then the driver can prevent black screen
on uninstall/disable also when it was installed on UEFI machine after
the production driver 0.18 which did not report valid video mode.

Signed-off-by: Yuri Benditovich <yuri.benditovich@daynix.com>
Acked-by: Marek Kedzierski <mkedzier@redhat.com>
2019-02-12 11:14:20 +00:00
Yuri Benditovich
61193f9cab Fix for black screen on driver uninstall on ovmf platform
https://bugzilla.redhat.com/show_bug.cgi?id=1661147
If display miniport driver does not pass valid display info to
the basic display driver on disable/uninstall, the basic
display driver raises run-time error and stays with yellow
bang. This behavior is specific to UEFI machines.
Reference: https://docs.microsoft.com/en-us/windows-hardware/drivers/ddi/content/dispmprt/nc-dispmprt-dxgkddi_stop_device_and_release_post_display_ownership

Signed-off-by: Yuri Benditovich <yuri.benditovich@daynix.com>
Reviewed-by: Christophe Fergeau <cfergeau@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2019-01-18 11:31:51 +00:00
Frediano Ziglio
7c0ced81d7 Do not set self_bitmap flag for QXL_DRAW_COPY command
Setting this flag on this command cause some performance issue.
When the server see this flag it updates the frame buffer and copy
part of it in a new allocated image. However for this command the
image is not used wasting only CPU and memory.
Also the frame buffer update causes the elimination optimisation
to be less effective causing more network usage.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Yuri Benditovich <yuri.benditovich@daynix.com>
2018-06-26 21:14:04 +01:00
Yuri Benditovich
c35b8bc1de Add support for resolution 800x600
https://bugzilla.redhat.com/show_bug.cgi?id=1477492
https://docs.microsoft.com/en-us/windows-hardware/design/minimum/minimum-hardware-requirements-overview
requires 800x600 to be supported.

Signed-off-by: Yuri Benditovich <yuri.benditovich@daynix.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2018-05-21 13:10:03 +01:00
Basil Salman
9b0bc81883 Prevent installation on OSes earlier than Windows 8
Limited the installation of the driver to Windows 8 and up
in order to prevent false driver installation on unsupported OSes
which lead to BSODs.

Signed-off-by: Basil Salman <basil@daynix.com>
Signed-off-by: Sameeh Jubran <sameeh@daynix.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2018-04-23 08:47:03 +01:00
yuri.benditovich@daynix.com
ef4d85ec2c qxl-wddm-dod: Add scripts for ETW recording and parsing
QxlDodCollectTrace.bat intended for recording of binary traces
in end-user environment (end-user runs it when instructed).
It uses built-in Windows ability of collecting ETW data.
QxlDodParseTrace.bat is to be used by developer to convert
received binary traces to formatted text.

Signed-off-by: Yuri Benditovich <yuri.benditovich@daynix.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2017-07-09 09:46:36 +01:00
yuri.benditovich@daynix.com
454a66a25a qxl-wddm-dod: Support ETW for release version
Add ability to produce ETW (Event Tracing for Windows) to release
version of the driver to be able to record binary traces in case
of problem in customer environment for further analysis.
Logging of debug build is not changed.

Signed-off-by: Yuri Benditovich <yuri.benditovich@daynix.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2017-07-09 09:46:33 +01:00
yuri.benditovich@daynix.com
87b13cd8fc qxl-wddm-dod: add trace definition file for WPP
Added file with Windows trace preprocessor definitions,
required for generating trace messages.

Signed-off-by: Yuri Benditovich <yuri.benditovich@daynix.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2017-07-09 09:46:13 +01:00
yuri.benditovich@daynix.com
132ef96f84 qxl-wddm-dod: Correct format of printouts
Fixed wrong formats of printouts producing errors with WPP.
All fixed format strings were wrong mainly due to incorrect
format for pointers.

Signed-off-by: Yuri Benditovich <yuri.benditovich@daynix.com>
Acked-by: Christophe Fergeau <cfergeau@redhat.com>
2017-07-09 09:45:56 +01:00
Dmitry Fleytman
764360acdc ci: Integrate with Appveyor
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 <dmitry@daynix.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2017-06-13 13:40:43 +01:00
Yuri Benditovich
1fbb9c5358 qxl-wddm-dod: Updated Changelog for v0.18 2017-05-28 11:23:41 +03:00
yuri.benditovich@daynix.com
d2e5bd8672 qxl-wddm-dod: Debug printouts of memory mapping
Print error case on proper level and fix typos.

Signed-off-by: Yuri Benditovich <yuri.benditovich@daynix.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2017-05-26 11:49:21 +01:00
yuri.benditovich@daynix.com
115477d9b3 qxl-wddm-dod: Prevent potential memory leak in class driver
In case the device initializes 4 memory bars, the driver maps
physical memory of bar 4 and never unmaps it. Fixing it by
immediate unmap of unused memory bars.

Signed-off-by: Yuri Benditovich <yuri.benditovich@daynix.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2017-05-26 11:49:19 +01:00
yuri.benditovich@daynix.com
9b55ed7041 qxl-wddm-dod: Fix unmapping of physical memory
https://bugzilla.redhat.com/show_bug.cgi?id=1454866
Due to wrong addresses passed to class driver, it never does
unmapping of physical memory, causing a leak of virtual address range.
On x86 systems the device fails to start due to failure to
map physical memory range after 10-50 cycles of disable-enable.

Signed-off-by: Yuri Benditovich <yuri.benditovich@daynix.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2017-05-26 11:49:11 +01:00
Yuri Benditovich
1a81d6d31f qxl-wddm-dod: Updated Changelog for v0.17 2017-05-15 00:25:36 +03:00
Frediano Ziglio
3f39e31a6f Synchronize display mode change and pushing drawables
Upon change of display mode the driver waits until all the
queued drawables pushed to the host or discarded. This eliminates
server warnings "rendering incorrect" in "get_drawable" when the
drawable command was created by guest driver just before change
of display mode and posted to the server during or after the change.

This patch and comments are heavily based on a patch sent by
Yuri Benditovich (with serialization code completely changed and
added generation to discard pending commands on old surface).

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Yuri Benditovich <yuri.benditovich@daynix.com>
2017-05-05 12:54:58 +01:00
Yuri Benditovich
42a911e2e9 Move code for discarding drawable to separate procedure
Signed-off-by: Yuri Benditovich <yuri.benditovich@daynix.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2017-05-05 11:23:16 +01:00
Frediano Ziglio
6041c81484 Move m_CustomMode field in QxlDevice
Only used by this class.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Yuri Benditovich <yuri.benditovich@daynix.com>
2017-04-12 15:49:26 +01:00
Frediano Ziglio
b83f6338bc Inline GetModeCount
As GetModeInfo is also inline there is no reason the derived class
could redefine the array anyway.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Yuri Benditovich <yuri.benditovich@daynix.com>
2017-04-12 15:49:24 +01:00
Frediano Ziglio
720e6955dd Use C++ style for allocations for m_ModeInfo field
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Yuri Benditovich <yuri.benditovich@daynix.com>
2017-04-12 15:49:22 +01:00
Frediano Ziglio
39f5106b30 Use C++ style for allocations for m_ModeNumbers field
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Yuri Benditovich <yuri.benditovich@daynix.com>
2017-04-12 15:49:21 +01:00
Frediano Ziglio
8fda115197 Make clear a QXLReleaseInfo structure is used
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Yuri Benditovich <yuri.benditovich@daynix.com>
2017-04-12 15:49:19 +01:00
Frediano Ziglio
076c9f2085 Fix indentation
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Yuri Benditovich <yuri.benditovich@daynix.com>
2017-04-12 15:49:17 +01:00
Frediano Ziglio
f013c0c5fc Remove unused UpdateArea method
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Yuri Benditovich <yuri.benditovich@daynix.com>
2017-04-12 15:49:15 +01:00
Frediano Ziglio
72d2105c92 Remove generation field from MemSlot
Not used beside during initialization of MemSlot itself

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Pavel Grunt <pgrunt@redhat.com>
2017-04-12 15:49:13 +01:00
Frediano Ziglio
06ef003435 Remove unused EmptyReleaseRing method
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Yuri Benditovich <yuri.benditovich@daynix.com>
2017-04-12 15:49:11 +01:00
Frediano Ziglio
9aaae88e4a Make DebugPrintFuncSerial static
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Yuri Benditovich <yuri.benditovich@daynix.com>
2017-04-12 15:49:09 +01:00
Frediano Ziglio
d86f38f89c Remove unused DebugPrintFunc function
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Yuri Benditovich <yuri.benditovich@daynix.com>
2017-04-12 15:49:02 +01:00
Frediano Ziglio
68e422f3b8 Do not check for NULL before calling delete
The check is done already by C++.
The assignment was removed as was just assigning a local variable.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Pavel Grunt <pgrunt@redhat.com>
2017-04-12 15:49:01 +01:00
Yuri Benditovich
decf2c9035 Avoid assert printout upon fallback of memory allocation
If the memory was requested from VRAM area but finally allocated
from DEVRAM, set memory space variable for correct verification
of allocated pointer

Signed-off-by: Yuri Benditovich <yuri.benditovich@daynix.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2017-04-12 14:53:01 +01:00
Frediano Ziglio
54a719e14f Use DEVRAM if no more space is available in VRAM
Previous Windows drivers use mainly DEVRAM so in some environments
(like RHEV-M 4.0) VRAM is really limited.
This patch use DEVRAM as a fallback to avoid getting out of memory
conditions too earlier in such environments.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Yuri Benditovich <yuri.benditovich@daynix.com>
2017-04-12 11:07:06 +01:00
Frediano Ziglio
0214d5ceda Allocate commands on Bar0
This is required by Qemu for migration

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Yuri Benditovich <yuri.benditovich@daynix.com>
2017-04-12 09:19:01 +01:00
Frediano Ziglio
94770833a4 Use inline attribute for VA and PA
Don't use the old style _inline specifier.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Yuri Benditovich <yuri.benditovich@daynix.com>
2017-04-12 09:19:01 +01:00
Frediano Ziglio
8a8c6c41c0 Compute dynamically slot_id in PA and VA functions
This make easier to change allocation of memory using different
memory Bars.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Yuri Benditovich <yuri.benditovich@daynix.com>
2017-04-12 09:18:50 +01:00
Frediano Ziglio
53fb38c92f Use normal pointer for VA addresses
As VA addresses are used as pointers there's no need to handle
them as 64-bit integer (which make the code more complicated)

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Yuri Benditovich <yuri.benditovich@daynix.com>
2017-04-12 09:17:50 +01:00
Frediano Ziglio
6ec0533a7d Allocate m_MemSlots statically inside QxlDevice
There were always 2 slots used so make no sense to allocate
always dynamically.
Also in this way m_MainMemSlot and m_SurfaceMemSlot become
constant making the code slightly smaller.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Yuri Benditovich <yuri.benditovich@daynix.com>
2017-04-12 09:17:47 +01:00
Frediano Ziglio
7e0642c3f2 Remove m_NumMemSlots member
Only used once

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Yuri Benditovich <yuri.benditovich@daynix.com>
2017-04-12 09:17:46 +01:00
Frediano Ziglio
1b674d86e2 Compute automatically memory space in FreeMem
This make easier to change allocation of memory using different
memory Bars.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Yuri Benditovich <yuri.benditovich@daynix.com>
2017-04-12 09:17:39 +01:00
yuri.benditovich@daynix.com
8fb1b0a23e qxl-wddm-dod: Non-forced memory allocations with VSync
In case of VSync is active (for the driver this means it shall take
in account watchdog policy and ensure fast execution of PresentDisplayOnly
callback) allocate bitmaps for drawable objects using non-forced requests.
If immediate allocation is not possible, place entire bitmap into memory
chunk allocated from the OS.
If bitmap is allocated from device memory, but one of later
chunks can't be allocated, allocate this and further chunks from
OS memory. All these 'delayed' allocations placed into linked list
which root entry is part of QXLOutput structure.
>From separate thread, before sending drawable objects down, review
the list of delayed chunks and allocate device memory (forced) to
all of them.
The cost of solution is 2 pointers added to each drawable or cursor
object.
Cursor commands currently do not use them; in future we have an option
to offload also cursor commands.

Signed-off-by: Yuri Benditovich <yuri.benditovich@daynix.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2017-04-12 08:21:01 +01:00
yuri.benditovich@daynix.com
043f4f275a qxl-wddm-dod: Implement non-forced bitmap allocation
Preparation for non-forced allocations.
Update bitmap creation procedure to allocate device memory forced
or non-forced.
In forced case it works as before.
In non-forced case, if allocation fails, the procedure allocates
memory from OS pool for entire bitmap and copies source data to it.
Later, before sending command, memory will be allocated from device
memory and copied from intermediate location to new one.

Signed-off-by: Yuri Benditovich <yuri.benditovich@daynix.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2017-04-12 08:21:01 +01:00
yuri.benditovich@daynix.com
5c4f4adc7a qxl-wddm-dod: Dedicated procedure for bitmap creation
Move bitmap creation to dedicated procedure. Currently it
uses only forced allocations, as before. Later it will
be used from different flows, forced and non-forced.

Signed-off-by: Yuri Benditovich <yuri.benditovich@daynix.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2017-04-12 08:21:01 +01:00
yuri.benditovich@daynix.com
06a4f7a846 qxl-wddm-dod: Optimize allocation of memory chunks
Increased size of allocation to reduce number of allocation per
bitmap. Before change the procedure ignored 'alloc_size' parameter
and always allocated memory chunk according to 'size' parameter.
As a result, first chunk could be up to 64K and all following are
limited by line size. For example, for bitmap 1280x1024 there was
more than 1008 chunks allocated, for bitmap 128x1024 - 897 chunks.
We change the procedure to use chunk size up to 64K (similar to first
chunk). This reduces in described examples number of allocation from
1008 to 64 and from 897 to 8 respectively.

Signed-off-by: Yuri Benditovich <yuri.benditovich@daynix.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2017-04-12 08:21:01 +01:00
yuri.benditovich@daynix.com
9721a48dc9 qxl-wddm-dod: PutBytesAlign supports non-forced allocation
Preparation for offload of allocations from device's memory
to separate thread. Procedure PutBytesAlign is called to
allocate memory chunk from device memory and copy data to it.
With current commit the procedure (if called with non-NULL
linked list root entry parameter) can use non-forced allocation.
If such allocation fails, it allocates 'delayed' chunk from
OS memory and copies data to it. Later before sending drawable command
this chunk shall be processed, storage allocated from device memory
(forced) and data copied to it.

Signed-off-by: Yuri Benditovich <yuri.benditovich@daynix.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2017-04-12 08:20:58 +01:00
yuri.benditovich@daynix.com
6a01308788 qxl-wddm-dod: Prepare for failure to allocate memory
Preparation for further scenarios when memory allocation failure
can happen and we'll need to use fallback when possible.
Memory allocation can fail in following cases:
- when non-forced memory allocation used and the attempt to allocate
  the memory must be as fast as possible, without waits
- when forced memory allocation used, but the driver already received
  stop command and waits for thread termination. Note that in case
  the VSync control is enabled stop command may happen even after the video
  subsystem executes switch to VGA mode. In such case QEMU will not return
  previously allocated objects (assuming the QXL driver already disabled
  and ignoring callbacks from Spice server in VGA mode).

In case of forced memory allocation the allocation routine waits
unpredictable time until the request is satisfied. In current commit
we do not acquire m_MemLock mutex for all this time, but release it
when entering long wait to allow another caller to try allocating memory.

Signed-off-by: Yuri Benditovich <yuri.benditovich@daynix.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2017-04-12 08:20:54 +01:00
Frediano Ziglio
3437f04cea Pass 0 to level argument of KeInitializeMutex
As documented by Microsoft this reserved argument should be set
to 0.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Yuri Benditovich <yuri.benditovich@daynix.com>
2017-04-11 17:21:55 +01:00
yuri.benditovich@daynix.com
9460db8760 qxl-wddm-dod: Set VSync indication period to 200ms
Default indication period (13-17ms) from the driver to OS
increases total CPU consumption during presentation operations.
Reducing indication frequency to 200 ms reduces cost of this
feature. Till now we do not see any negative impact of this.

Signed-off-by: Yuri Benditovich <yuri.benditovich@daynix.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2017-04-03 10:15:44 +01:00
yuri.benditovich@daynix.com
074cc3ef58 qxl-wddm-dod: Registry-based control over VSync
Registry override of default behavior (disabling when enabled
by default) provided for support and troubleshooting only in case
this feature affects specific user.

Signed-off-by: Yuri Benditovich <yuri.benditovich@daynix.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2017-04-03 10:14:40 +01:00