[Spice-devel] [PATCH] qxl-wddm-dod: Load best know defaults for video mode at driver's start
Christophe Fergeau
cfergeau at redhat.com
Mon Jan 28 12:27:16 UTC 2019
Hey,
On Fri, Jan 25, 2019 at 09:48:52AM +0200, Yuri Benditovich wrote:
> 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.
I'm not sure I understand the problem you are trying to describe here.
"Then the driver can prevent black screen on uninstall/disable" -> is
this saying on non-UEFI system, we still have a black screen issue with
the driver in git master?
"also when it was installed on UEFI machine after the production driver
0.18 which did not report valid video mode." -> I assume this part is
related to the commit "Fix for black screen on driver uninstall on ovmf
platform"? If yes, isn't the issue that you describe already fixed by
that commit?
>
> Signed-off-by: Yuri Benditovich <yuri.benditovich at daynix.com>
> ---
> qxldod/QxlDod.cpp | 37 ++++++++++++++++++++++++++++++++-----
> 1 file changed, 32 insertions(+), 5 deletions(-)
>
> diff --git a/qxldod/QxlDod.cpp b/qxldod/QxlDod.cpp
> index dea78e2..525cdc3 100755
> --- a/qxldod/QxlDod.cpp
> +++ b/qxldod/QxlDod.cpp
> @@ -5169,6 +5169,37 @@ UINT SpiceFromPixelFormat(D3DDDIFORMAT Format)
> }
> }
>
> +// Width and Height values for initial video mode are populated by
> +// display class driver upon switch from boot display to operational one.
> +// This is not documented and can be changed in future, but
> +// present under the same key in Win8.1/Win10/2016/2019
> +static void RetrieveDisplayDefaults(DXGK_DISPLAY_INFORMATION& DispInfo)
> +{
> + PAGED_CODE();
> + RTL_QUERY_REGISTRY_TABLE QueryTable[3] = {};
> + QueryTable[0].Flags = QueryTable[1].Flags = RTL_QUERY_REGISTRY_DIRECT | RTL_QUERY_REGISTRY_TYPECHECK | RTL_QUERY_REGISTRY_REQUIRED;
> + QueryTable[0].DefaultType = QueryTable[1].DefaultType = REG_DWORD << 24;
> + QueryTable[0].Name = L"Height";
> + QueryTable[0].EntryContext = &DispInfo.Height;
> + QueryTable[1].Name = L"Width";
> + QueryTable[1].EntryContext = &DispInfo.Width;
> +
> + NTSTATUS status = RtlQueryRegistryValues(RTL_REGISTRY_CONTROL, L"BGFX", QueryTable, NULL, NULL);
> + if (NT_SUCCESS(status))
> + {
> + DbgPrint(TRACE_LEVEL_INFORMATION, ("%s: %dx%d\n", __FUNCTION__, DispInfo.Width, DispInfo.Height));
> + }
> + else
> + {
> + DbgPrint(TRACE_LEVEL_INFORMATION, ("%s: status = %X\n", __FUNCTION__, status));
> + DispInfo.Width = INITIAL_WIDTH;
> + DispInfo.Height = INITIAL_HEIGHT;
> + }
> + DispInfo.ColorFormat = D3DDDIFMT_X8R8G8B8;
By any chance, is this stored in the registry as well?
Apart from this, looks good to me.
Christophe
> + DispInfo.Pitch = DispInfo.Width * BPPFromPixelFormat(DispInfo.ColorFormat) / BITS_PER_BYTE;
> + DispInfo.TargetId = DispInfo.AcpiId = 0;
> +}
> +
> NTSTATUS HwDeviceInterface::AcquireDisplayInfo(DXGK_DISPLAY_INFORMATION& DispInfo)
> {
> PAGED_CODE();
> @@ -5188,11 +5219,7 @@ NTSTATUS HwDeviceInterface::AcquireDisplayInfo(DXGK_DISPLAY_INFORMATION& DispInf
> if (DispInfo.Width == 0)
> {
> DbgPrint(TRACE_LEVEL_WARNING, ("QxlDod::AcquireDisplayInfo has zero width!\n"));
> - DispInfo.ColorFormat = D3DDDIFMT_A8R8G8B8;
> - DispInfo.Width = INITIAL_WIDTH;
> - DispInfo.Height = INITIAL_HEIGHT;
> - DispInfo.Pitch = DispInfo.Width * BPPFromPixelFormat(DispInfo.ColorFormat) / BITS_PER_BYTE;
> - DispInfo.TargetId = 0;
> + RetrieveDisplayDefaults(DispInfo);
> }
> return Status;
> }
> --
> 2.16.1.windows.4
>
> _______________________________________________
> Spice-devel mailing list
> Spice-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/spice-devel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/spice-devel/attachments/20190128/2491e7f6/attachment-0001.sig>
More information about the Spice-devel
mailing list