Re: [win32-qxl]Do not allow duplicate IDs in video mode info buffer.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



It compiles and and is functionally the same as the prior versions, but cleaner.
-S

On 9/22/2015 5:08 AM, Christophe Fergeau wrote:
> 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@xxxxxxxxxx>
> 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;
>  }

_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/spice-devel




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]