[Spice-devel,5/7] qxl-wddm-dod: Fix video modes enumeration

Submitted by Yuri Benditovich on Feb. 12, 2017, 1:09 p.m.

Details

Message ID 1486904994-169784-6-git-send-email-yuri.benditovich@daynix.com
State New
Headers show
Series "Changes for Win10 HLK test" ( rev: 1 ) in Spice

Not browsing as part of any series.

Commit Message

Yuri Benditovich Feb. 12, 2017, 1:09 p.m.
When the video mode is changed and then the driver disabled and
enabled, it did not enumerate available video modes with lower
resolution than current one. All modes starting from 1024x768
should be available regardless what is current resolution
on driver startup

Signed-off-by: Yuri Benditovich <yuri.benditovich@daynix.com>
---
 qxldod/QxlDod.cpp | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Patch hide | download patch | download mbox

diff --git a/qxldod/QxlDod.cpp b/qxldod/QxlDod.cpp
index 78d4340..b3e0938 100755
--- a/qxldod/QxlDod.cpp
+++ b/qxldod/QxlDod.cpp
@@ -2512,8 +2512,8 @@  NTSTATUS VgaDevice::GetModeList(DXGK_DISPLAY_INFORMATION* pDispInfo)
 
         DbgPrint(TRACE_LEVEL_INFORMATION, ("ModeTemp = 0x%X %dx%d@%d\n", ModeTemp, tmpModeInfo.XResolution, tmpModeInfo.YResolution, tmpModeInfo.BitsPerPixel));
 
-        if (tmpModeInfo.XResolution >= Width &&
-            tmpModeInfo.YResolution >= Height &&
+        if (tmpModeInfo.XResolution >= MIN_WIDTH_SIZE &&
+            tmpModeInfo.YResolution >= MIN_HEIGHT_SIZE &&
             tmpModeInfo.BitsPerPixel == BitsPerPixel &&
             tmpModeInfo.PhysBasePtr != 0)
         {
@@ -3138,8 +3138,8 @@  NTSTATUS QxlDevice::GetModeList(DXGK_DISPLAY_INFORMATION* pDispInfo)
 
         DbgPrint(TRACE_LEVEL_INFORMATION, ("%s: modes[%d] x_res = %d, y_res = %d, bits = %d BitsPerPixel = %d\n", __FUNCTION__, CurrentMode, tmpModeInfo->x_res, tmpModeInfo->y_res, tmpModeInfo->bits, BitsPerPixel));
 
-        if (tmpModeInfo->x_res >= Width &&
-            tmpModeInfo->y_res >= Height &&
+        if (tmpModeInfo->x_res >= MIN_WIDTH_SIZE &&
+            tmpModeInfo->y_res >= MIN_HEIGHT_SIZE &&
             tmpModeInfo->bits == QXL_BPP)
         {
             m_ModeNumbers[SuitableModeCount] = SuitableModeCount;

Comments

> 
> When the video mode is changed and then the driver disabled and
> enabled, it did not enumerate available video modes with lower
> resolution than current one. All modes starting from 1024x768
> should be available regardless what is current resolution
> on driver startup
> 
> Signed-off-by: Yuri Benditovich <yuri.benditovich@daynix.com>

Looks like this patch is a bit OT in this series
and can be applied even independently without
waiting for other patches.

Acked-by: Frediano Ziglio <fziglio@redhat.com>

> ---
>  qxldod/QxlDod.cpp | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/qxldod/QxlDod.cpp b/qxldod/QxlDod.cpp
> index 78d4340..b3e0938 100755
> --- a/qxldod/QxlDod.cpp
> +++ b/qxldod/QxlDod.cpp
> @@ -2512,8 +2512,8 @@ NTSTATUS
> VgaDevice::GetModeList(DXGK_DISPLAY_INFORMATION* pDispInfo)
>  
>          DbgPrint(TRACE_LEVEL_INFORMATION, ("ModeTemp = 0x%X %dx%d@%d\n",
>          ModeTemp, tmpModeInfo.XResolution, tmpModeInfo.YResolution,
>          tmpModeInfo.BitsPerPixel));
>  
> -        if (tmpModeInfo.XResolution >= Width &&
> -            tmpModeInfo.YResolution >= Height &&
> +        if (tmpModeInfo.XResolution >= MIN_WIDTH_SIZE &&
> +            tmpModeInfo.YResolution >= MIN_HEIGHT_SIZE &&
>              tmpModeInfo.BitsPerPixel == BitsPerPixel &&
>              tmpModeInfo.PhysBasePtr != 0)
>          {
> @@ -3138,8 +3138,8 @@ NTSTATUS
> QxlDevice::GetModeList(DXGK_DISPLAY_INFORMATION* pDispInfo)
>  
>          DbgPrint(TRACE_LEVEL_INFORMATION, ("%s: modes[%d] x_res = %d, y_res
>          = %d, bits = %d BitsPerPixel = %d\n", __FUNCTION__, CurrentMode,
>          tmpModeInfo->x_res, tmpModeInfo->y_res, tmpModeInfo->bits,
>          BitsPerPixel));
>  
> -        if (tmpModeInfo->x_res >= Width &&
> -            tmpModeInfo->y_res >= Height &&
> +        if (tmpModeInfo->x_res >= MIN_WIDTH_SIZE &&
> +            tmpModeInfo->y_res >= MIN_HEIGHT_SIZE &&
>              tmpModeInfo->bits == QXL_BPP)
>          {
>              m_ModeNumbers[SuitableModeCount] = SuitableModeCount;

Frediano
Depending on the order of tests, this also can cause some tests to fail, if
they verify (explicitly or implicitly) presence of 1024x768.


On Mon, Feb 13, 2017 at 11:17 AM, Frediano Ziglio <fziglio@redhat.com>
wrote:

> >
> > When the video mode is changed and then the driver disabled and
> > enabled, it did not enumerate available video modes with lower
> > resolution than current one. All modes starting from 1024x768
> > should be available regardless what is current resolution
> > on driver startup
> >
> > Signed-off-by: Yuri Benditovich <yuri.benditovich@daynix.com>
>
> Looks like this patch is a bit OT in this series
> and can be applied even independently without
> waiting for other patches.
>
> Acked-by: Frediano Ziglio <fziglio@redhat.com>
>
> > ---
> >  qxldod/QxlDod.cpp | 8 ++++----
> >  1 file changed, 4 insertions(+), 4 deletions(-)
> >
> > diff --git a/qxldod/QxlDod.cpp b/qxldod/QxlDod.cpp
> > index 78d4340..b3e0938 100755
> > --- a/qxldod/QxlDod.cpp
> > +++ b/qxldod/QxlDod.cpp
> > @@ -2512,8 +2512,8 @@ NTSTATUS
> > VgaDevice::GetModeList(DXGK_DISPLAY_INFORMATION* pDispInfo)
> >
> >          DbgPrint(TRACE_LEVEL_INFORMATION, ("ModeTemp = 0x%X %dx%d@
> %d\n",
> >          ModeTemp, tmpModeInfo.XResolution, tmpModeInfo.YResolution,
> >          tmpModeInfo.BitsPerPixel));
> >
> > -        if (tmpModeInfo.XResolution >= Width &&
> > -            tmpModeInfo.YResolution >= Height &&
> > +        if (tmpModeInfo.XResolution >= MIN_WIDTH_SIZE &&
> > +            tmpModeInfo.YResolution >= MIN_HEIGHT_SIZE &&
> >              tmpModeInfo.BitsPerPixel == BitsPerPixel &&
> >              tmpModeInfo.PhysBasePtr != 0)
> >          {
> > @@ -3138,8 +3138,8 @@ NTSTATUS
> > QxlDevice::GetModeList(DXGK_DISPLAY_INFORMATION* pDispInfo)
> >
> >          DbgPrint(TRACE_LEVEL_INFORMATION, ("%s: modes[%d] x_res = %d,
> y_res
> >          = %d, bits = %d BitsPerPixel = %d\n", __FUNCTION__, CurrentMode,
> >          tmpModeInfo->x_res, tmpModeInfo->y_res, tmpModeInfo->bits,
> >          BitsPerPixel));
> >
> > -        if (tmpModeInfo->x_res >= Width &&
> > -            tmpModeInfo->y_res >= Height &&
> > +        if (tmpModeInfo->x_res >= MIN_WIDTH_SIZE &&
> > +            tmpModeInfo->y_res >= MIN_HEIGHT_SIZE &&
> >              tmpModeInfo->bits == QXL_BPP)
> >          {
> >              m_ModeNumbers[SuitableModeCount] = SuitableModeCount;
>
> Frediano
>