[Spice-devel] [PATCH 2/3] Shift the uxa function initialization to a separate function.

Christophe Fergeau cfergeau at redhat.com
Fri Sep 28 11:01:07 PDT 2012


Fairly mechanical, ACK.

Christophe

On Sat, Sep 15, 2012 at 11:09:23AM -0500, Jeremy White wrote:
> ---
>  src/qxl_driver.c |   48 +++++++++++++++++++++++++++---------------------
>  1 file changed, 27 insertions(+), 21 deletions(-)
> 
> diff --git a/src/qxl_driver.c b/src/qxl_driver.c
> index 1c79060..c43cbde 100644
> --- a/src/qxl_driver.c
> +++ b/src/qxl_driver.c
> @@ -1616,28 +1616,9 @@ qxl_destroy_pixmap (PixmapPtr pixmap)
>      return TRUE;
>  }
>  
> -static Bool
> -setup_uxa (qxl_screen_t *qxl, ScreenPtr screen)
> +static void
> +set_uxa_functions(qxl_screen_t *qxl, ScreenPtr screen)
>  {
> -    ScrnInfoPtr scrn = xf86ScreenToScrn (screen);
> -    
> -#if HAS_DIXREGISTERPRIVATEKEY
> -    if (!dixRegisterPrivateKey (&uxa_pixmap_index, PRIVATE_PIXMAP, 0))
> -	return FALSE;
> -#else
> -    if (!dixRequestPrivate (&uxa_pixmap_index, 0))
> -	return FALSE;
> -#endif
> -    
> -    qxl->uxa = uxa_driver_alloc ();
> -    if (qxl->uxa == NULL)
> -	return FALSE;
> -    
> -    memset (qxl->uxa, 0, sizeof (*qxl->uxa));
> -    
> -    qxl->uxa->uxa_major = 1;
> -    qxl->uxa->uxa_minor = 0;
> -    
>      /* Solid fill */
>      qxl->uxa->check_solid = qxl_check_solid;
>      qxl->uxa->prepare_solid = qxl_prepare_solid;
> @@ -1670,7 +1651,32 @@ setup_uxa (qxl_screen_t *qxl, ScreenPtr screen)
>      screen->SetScreenPixmap = qxl_set_screen_pixmap;
>      screen->CreatePixmap = qxl_create_pixmap;
>      screen->DestroyPixmap = qxl_destroy_pixmap;
> +}
> +
> +static Bool
> +setup_uxa (qxl_screen_t *qxl, ScreenPtr screen)
> +{
> +    ScrnInfoPtr scrn = xf86ScreenToScrn (screen);
>      
> +#if HAS_DIXREGISTERPRIVATEKEY
> +    if (!dixRegisterPrivateKey (&uxa_pixmap_index, PRIVATE_PIXMAP, 0))
> +	return FALSE;
> +#else
> +    if (!dixRequestPrivate (&uxa_pixmap_index, 0))
> +	return FALSE;
> +#endif
> +
> +    qxl->uxa = uxa_driver_alloc ();
> +    if (qxl->uxa == NULL)
> +        return FALSE;
> +
> +    memset (qxl->uxa, 0, sizeof (*qxl->uxa));
> +
> +    qxl->uxa->uxa_major = 1;
> +    qxl->uxa->uxa_minor = 0;
> +
> +    set_uxa_functions(qxl, screen);
> +
>      if (!uxa_driver_init (screen, qxl->uxa))
>      {
>  	xf86DrvMsg (scrn->scrnIndex, X_ERROR,
> -- 
> 1.7.9.5
> 
> 
> 
> _______________________________________________
> Spice-devel mailing list
> Spice-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/spice-devel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/spice-devel/attachments/20120928/3948bd83/attachment.pgp>


More information about the Spice-devel mailing list