[PATCH 1/6] exa: simplify exaPixmapIsOffscreen

Michel Dänzer michel at daenzer.net
Sun Mar 1 02:17:10 PST 2009


On Son, 2009-03-01 at 01:36 +0100, Maarten Maathuis wrote:
> - This includes properly handling the framebuffer.
> ---
>  exa/exa.c |   19 ++++++++-----------
>  1 files changed, 8 insertions(+), 11 deletions(-)
> 
> diff --git a/exa/exa.c b/exa/exa.c
> index 994a67a..b0a26e9 100644
> --- a/exa/exa.c
> +++ b/exa/exa.c
> @@ -424,6 +424,13 @@ exaModifyPixmapHeader(PixmapPtr pPixmap, int width, int height, int depth,
>          if (devKind > 0)
>              pExaPixmap->sys_pitch = devKind;
>  
> +	/* Is this the framebuffer (for classic exa)? */
> +	if (pPixData && pPixData == pExaScr->info->memoryBase) {
> +	    pExaPixmap->fb_ptr = pPixData;
> +	    pExaPixmap->fb_pitch = devKind;
> +	    pExaPixmap->offscreen = TRUE;
> +	}
> +

This part looks okay.


> @@ -471,22 +478,12 @@ exaPixmapIsOffscreen(PixmapPtr p)
>      ScreenPtr	pScreen = p->drawable.pScreen;
>      ExaScreenPriv(pScreen);
>      ExaPixmapPriv(p);
> -    void *save_ptr;
>      Bool ret;
>  
> -    save_ptr = p->devPrivate.ptr;
> -
> -    if (!save_ptr && pExaPixmap && !(pExaScr->info->flags & EXA_HANDLES_PIXMAPS))
> -	p->devPrivate.ptr = ExaGetPixmapAddress(p);
> -
>      if (pExaScr->info->PixmapIsOffscreen)
>  	ret = pExaScr->info->PixmapIsOffscreen(p);
>      else
> -       ret = ((unsigned long) ((CARD8 *) p->devPrivate.ptr -
> -			       (CARD8 *) pExaScr->info->memoryBase) <
> -	      pExaScr->info->memorySize);
> -
> -    p->devPrivate.ptr = save_ptr;
> +	ret = (pExaPixmap->offscreen && pExaPixmap->fb_ptr);
>  
>      return ret;
>  }

I think this breaks driver PixmapIsOffscreen hooks which rely on
devPrivate.ptr.


-- 
Earthling Michel Dänzer           |                http://www.vmware.com
Libre software enthusiast         |          Debian, X and DRI developer


More information about the xorg-devel mailing list