[Spice-devel] [win32-qxl]Do not allow duplicate IDs in video mode info buffer.
Christophe Fergeau
cfergeau at redhat.com
Tue Sep 22 02:08:49 PDT 2015
I see this has been pushed now, but I'd still go with this follow-up
patch (not even compile tested :-(
From c148234cb8eb0b64dcff27c3c16df4f27cf79ba9 Mon Sep 17 00:00:00 2001
From: Christophe Fergeau <cfergeau at redhat.com>
Date: Tue, 22 Sep 2015 11:03:11 +0200
Subject: [PATCH] xddm: Remove unneeded FillVidModeInfo 'index' argument
After commit 7ee27e89c, the 'index' argument to FillVideModeInfo is
unneeded as it's only used to set pMode->ModeIndex, and in the only call
to FillVideModeInfo, we are passing that same value as the 'index'
parameter.
This commit removes this argument, and while at it, makes the function
static.
---
xddm/miniport/qxl.c | 12 +++++-------
1 file changed, 5 insertions(+), 7 deletions(-)
diff --git a/xddm/miniport/qxl.c b/xddm/miniport/qxl.c
index 22537e2..2cf28b3 100644
--- a/xddm/miniport/qxl.c
+++ b/xddm/miniport/qxl.c
@@ -467,11 +467,11 @@ void FillVidModeBPP(VIDEO_MODE_INFORMATION *pMode, ULONG bitsR, ULONG bitsG, ULO
}
#if defined(ALLOC_PRAGMA)
-VP_STATUS FillVidModeInfo(VIDEO_MODE_INFORMATION *pMode, ULONG xres, ULONG yres, ULONG bpp, ULONG index);
+VP_STATUS FillVidModeInfo(VIDEO_MODE_INFORMATION *pMode, ULONG xres, ULONG yres, ULONG bpp);
#pragma alloc_text(PAGE, FillVidModeInfo)
#endif
/* Fills given video mode structure */
-VP_STATUS FillVidModeInfo(VIDEO_MODE_INFORMATION *pMode, ULONG xres, ULONG yres, ULONG bpp, ULONG index)
+VP_STATUS FillVidModeInfo(VIDEO_MODE_INFORMATION *pMode, ULONG xres, ULONG yres, ULONG bpp)
{
unsigned bytes_pp = (bpp + 7) / 8;
@@ -482,7 +482,6 @@ VP_STATUS FillVidModeInfo(VIDEO_MODE_INFORMATION *pMode, ULONG xres, ULONG yres,
/*Common entries*/
pMode->Length = sizeof(VIDEO_MODE_INFORMATION);
- pMode->ModeIndex = index;
pMode->VisScreenWidth = xres;
pMode->VisScreenHeight = yres;
pMode->ScreenStride = (xres * bytes_pp + 3) & ~0x3; /* Pixman requirement */
@@ -514,11 +513,11 @@ VP_STATUS FillVidModeInfo(VIDEO_MODE_INFORMATION *pMode, ULONG xres, ULONG yres,
}
#if defined(ALLOC_PRAGMA)
-VP_STATUS SetVideoModeInfo(QXLExtension *dev, PVIDEO_MODE_INFORMATION video_mode, QXLMode *qxl_mode);
+static VP_STATUS SetVideoModeInfo(QXLExtension *dev, PVIDEO_MODE_INFORMATION video_mode, QXLMode *qxl_mode);
#pragma alloc_text(PAGE, SetVideoModeInfo)
#endif
-VP_STATUS SetVideoModeInfo(QXLExtension *dev, PVIDEO_MODE_INFORMATION video_mode, QXLMode *qxl_mode)
+static VP_STATUS SetVideoModeInfo(QXLExtension *dev, PVIDEO_MODE_INFORMATION video_mode, QXLMode *qxl_mode)
{
ULONG color_bits;
PAGED_CODE();
@@ -1024,8 +1023,7 @@ static VP_STATUS SetCustomDisplay(QXLExtension *dev_ext, QXLEscapeSetCustomDispl
pMode = &dev_ext->modes[dev_ext->custom_mode];
ret = FillVidModeInfo(pMode,
custom_display->xres, custom_display->yres,
- custom_display->bpp,
- pMode->ModeIndex);
+ custom_display->bpp);
DEBUG_PRINT((dev_ext, 0, "%s: Returning %d\n", __FUNCTION__, ret));
return ret;
}
--
2.4.3
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/spice-devel/attachments/20150922/766cbd8e/attachment.sig>
More information about the Spice-devel
mailing list