[PATCH 2/2] dri2: Pass out_count by value to update_dri2_drawable_buffers()

Ian Romanick idr at freedesktop.org
Tue Apr 12 16:20:11 PDT 2011


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 04/12/2011 07:37 AM, ville.syrjala at nokia.com wrote:
> From: Ville Syrjälä <ville.syrjala at nokia.com>
> 
> update_dri2_drawable_buffers() doesn't modify out_count, so pass it
> by value.
> 
> Signed-off-by: Ville Syrjälä <ville.syrjala at nokia.com>

Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>

> ---
>  hw/xfree86/dri2/dri2.c |    8 ++++----
>  1 files changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/hw/xfree86/dri2/dri2.c b/hw/xfree86/dri2/dri2.c
> index 23b6594..5c42a51 100644
> --- a/hw/xfree86/dri2/dri2.c
> +++ b/hw/xfree86/dri2/dri2.c
> @@ -358,7 +358,7 @@ allocate_or_reuse_buffer(DrawablePtr pDraw, DRI2ScreenPtr ds,
>  
>  static void
>  update_dri2_drawable_buffers(DRI2DrawablePtr pPriv, DrawablePtr pDraw,
> -			     DRI2BufferPtr *buffers, int *out_count, int *width, int *height)
> +			     DRI2BufferPtr *buffers, int out_count, int *width, int *height)
>  {
>      DRI2ScreenPtr   ds = DRI2GetScreen(pDraw->pScreen);
>      int i;
> @@ -374,7 +374,7 @@ update_dri2_drawable_buffers(DRI2DrawablePtr pPriv, DrawablePtr pDraw,
>      }
>  
>      pPriv->buffers = buffers;
> -    pPriv->bufferCount = *out_count;
> +    pPriv->bufferCount = out_count;
>      pPriv->width = pDraw->width;
>      pPriv->height = pDraw->height;
>      *width = pPriv->width;
> @@ -477,7 +477,7 @@ do_get_buffers(DrawablePtr pDraw, int *width, int *height,
>  
>      *out_count = i;
>  
> -    update_dri2_drawable_buffers(pPriv, pDraw, buffers, out_count, width, height);
> +    update_dri2_drawable_buffers(pPriv, pDraw, buffers, *out_count, width, height);
>  
>      /* If the client is getting a fake front-buffer, pre-fill it with the
>       * contents of the real front-buffer.  This ensures correct operation of
> @@ -513,7 +513,7 @@ err_out:
>  	buffers = NULL;
>      }
>  
> -    update_dri2_drawable_buffers(pPriv, pDraw, buffers, out_count, width, height);
> +    update_dri2_drawable_buffers(pPriv, pDraw, buffers, *out_count, width, height);
>  
>      return buffers;
>  }

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/

iEYEARECAAYFAk2k3isACgkQX1gOwKyEAw9iRQCbBbAk02jKVU7SuE8CNua5rSY6
6HsAnj9N6FW/WLxBaX8UiWJMd/hx1zyA
=2ONE
-----END PGP SIGNATURE-----


More information about the xorg-devel mailing list