<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Jan 28, 2019 at 2:27 PM Christophe Fergeau <<a href="mailto:cfergeau@redhat.com">cfergeau@redhat.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hey,<br>
<br>
On Fri, Jan 25, 2019 at 09:48:52AM +0200, Yuri Benditovich wrote:<br>
> Even if initial display resolution is not available at driver start, try<br>
> to find it in the registry.<br>
<br>
> Then the driver can prevent black screen<br>
> on uninstall/disable also when it was installed on UEFI machine after<br>
> the production driver 0.18 which did not report valid video mode.<br>
<br>
I'm not sure I understand the problem you are trying to describe here.<br>
"Then the driver can prevent black screen on uninstall/disable" -> is<br>
this saying on non-UEFI system, we still have a black screen issue with<br>
the driver in git master?<br>
<br>
"also when it was installed on UEFI machine after the production driver<br>
0.18 which did not report valid video mode." -> I assume this part is<br>
related to the commit "Fix for black screen on driver uninstall on ovmf<br>
platform"? If yes, isn't the issue that you describe already fixed by<br>
that commit?<br>
<br></blockquote><div><br></div><div>All the scenarious below are related to ovmf platform</div><div><br></div><div>Flow 1: the driver from current master branch installed on the machine where no qxl-wddm-dod driver installed</div><div>(or previous one uninstalled and reboot done)</div><div>The driver can be uninstalled without problem (this what was fixed by previous commit).</div><div><br></div><div><div>Flow 2: there is current production driver (0.18) installed. Driver update 0.18->current master works OK.</div><div>(the driver does not know video mode on startup but it can live without it)</div><div>Uninstalling the driver still causes black screen (or broken screen), as the driver does not know which mode to report on exit.</div><div>If it even reports some default, it might be wrong due to various reasons (will cause broken screen, which is not better than black).</div><div>This is what current commit fixes.</div><div> <br></div></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
> <br>
> Signed-off-by: Yuri Benditovich <<a href="mailto:yuri.benditovich@daynix.com" target="_blank">yuri.benditovich@daynix.com</a>><br>
> ---<br>
> qxldod/QxlDod.cpp | 37 ++++++++++++++++++++++++++++++++-----<br>
> 1 file changed, 32 insertions(+), 5 deletions(-)<br>
> <br>
> diff --git a/qxldod/QxlDod.cpp b/qxldod/QxlDod.cpp<br>
> index dea78e2..525cdc3 100755<br>
> --- a/qxldod/QxlDod.cpp<br>
> +++ b/qxldod/QxlDod.cpp<br>
> @@ -5169,6 +5169,37 @@ UINT SpiceFromPixelFormat(D3DDDIFORMAT Format)<br>
> }<br>
> }<br>
> <br>
> +// Width and Height values for initial video mode are populated by<br>
> +// display class driver upon switch from boot display to operational one.<br>
> +// This is not documented and can be changed in future, but<br>
> +// present under the same key in Win8.1/Win10/2016/2019<br>
> +static void RetrieveDisplayDefaults(DXGK_DISPLAY_INFORMATION& DispInfo)<br>
> +{<br>
> + PAGED_CODE();<br>
> + RTL_QUERY_REGISTRY_TABLE QueryTable[3] = {};<br>
> + QueryTable[0].Flags = QueryTable[1].Flags = RTL_QUERY_REGISTRY_DIRECT | RTL_QUERY_REGISTRY_TYPECHECK | RTL_QUERY_REGISTRY_REQUIRED;<br>
> + QueryTable[0].DefaultType = QueryTable[1].DefaultType = REG_DWORD << 24;<br>
> + QueryTable[0].Name = L"Height";<br>
> + QueryTable[0].EntryContext = &DispInfo.Height;<br>
> + QueryTable[1].Name = L"Width";<br>
> + QueryTable[1].EntryContext = &DispInfo.Width;<br>
> +<br>
> + NTSTATUS status = RtlQueryRegistryValues(RTL_REGISTRY_CONTROL, L"BGFX", QueryTable, NULL, NULL);<br>
> + if (NT_SUCCESS(status))<br>
> + {<br>
> + DbgPrint(TRACE_LEVEL_INFORMATION, ("%s: %dx%d\n", __FUNCTION__, DispInfo.Width, DispInfo.Height));<br>
> + }<br>
> + else<br>
> + {<br>
> + DbgPrint(TRACE_LEVEL_INFORMATION, ("%s: status = %X\n", __FUNCTION__, status));<br>
> + DispInfo.Width = INITIAL_WIDTH;<br>
> + DispInfo.Height = INITIAL_HEIGHT;<br>
> + }<br>
> + DispInfo.ColorFormat = D3DDDIFMT_X8R8G8B8;<br>
<br>
By any chance, is this stored in the registry as well?<br></blockquote><div><br></div><div>Proper video mode is stored in the registry by the OS. Undocumented, however.</div><div>This does not help to store it again, the point is to query _proper_ video mode.</div><div> <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
Apart from this, looks good to me.<br>
<br>
Christophe<br>
<br>
> + DispInfo.Pitch = DispInfo.Width * BPPFromPixelFormat(DispInfo.ColorFormat) / BITS_PER_BYTE;<br>
> + DispInfo.TargetId = DispInfo.AcpiId = 0;<br>
> +}<br>
> +<br>
> NTSTATUS HwDeviceInterface::AcquireDisplayInfo(DXGK_DISPLAY_INFORMATION& DispInfo)<br>
> {<br>
> PAGED_CODE();<br>
> @@ -5188,11 +5219,7 @@ NTSTATUS HwDeviceInterface::AcquireDisplayInfo(DXGK_DISPLAY_INFORMATION& DispInf<br>
> if (DispInfo.Width == 0)<br>
> {<br>
> DbgPrint(TRACE_LEVEL_WARNING, ("QxlDod::AcquireDisplayInfo has zero width!\n"));<br>
> - DispInfo.ColorFormat = D3DDDIFMT_A8R8G8B8;<br>
> - DispInfo.Width = INITIAL_WIDTH;<br>
> - DispInfo.Height = INITIAL_HEIGHT;<br>
> - DispInfo.Pitch = DispInfo.Width * BPPFromPixelFormat(DispInfo.ColorFormat) / BITS_PER_BYTE;<br>
> - DispInfo.TargetId = 0;<br>
> + RetrieveDisplayDefaults(DispInfo);<br>
> }<br>
> return Status;<br>
> }<br>
> -- <br>
> 2.16.1.windows.4<br>
> <br>
> _______________________________________________<br>
> Spice-devel mailing list<br>
> <a href="mailto:Spice-devel@lists.freedesktop.org" target="_blank">Spice-devel@lists.freedesktop.org</a><br>
> <a href="https://lists.freedesktop.org/mailman/listinfo/spice-devel" rel="noreferrer" target="_blank">https://lists.freedesktop.org/mailman/listinfo/spice-devel</a><br>
</blockquote></div></div>