On Don, 2009-02-26 at 23:24 +0100, Maarten Maathuis wrote:
> - Do the right thing based on prepare access.

[...]

> diff --git a/exa/exa_migration.c b/exa/exa_migration.c
> index 9d0eda0..b6f192b 100644
> --- a/exa/exa_migration.c
> +++ b/exa/exa_migration.c
> @@ -566,7 +566,9 @@ exaAssertNotDirty (PixmapPtr pPixmap)
>      src_pitch = pExaPixmap->fb_pitch;
>      cpp = pPixmap->drawable.bitsPerPixel / 8;
>  
> -    ExaDoPrepareAccess(&pPixmap->drawable, EXA_PREPARE_SRC);
> +    if (!ExaDoPrepareAccess(&pPixmap->drawable, EXA_PREPARE_SRC))
> +     goto skip;
> +
>      while (nbox--) {
>           int rowbytes;
>  
> @@ -579,7 +581,7 @@ exaAssertNotDirty (PixmapPtr pPixmap)
>               continue;
>  
>           rowbytes = (pBox->x2 - pBox->x1) * cpp;
> -         src = pExaPixmap->fb_ptr + pBox->y1 * src_pitch + pBox->x1 * cpp;
> +         src = (CARD8 *) pPixmap->devPrivate.ptr + pBox->y1 * src_pitch + 
> pBox->x1 * cpp;
>           dst = pExaPixmap->sys_ptr + pBox->y1 * dst_pitch + pBox->x1 * cpp;
>  
>           for (y = pBox->y1; y < pBox->y2;
> @@ -592,6 +594,8 @@ exaAssertNotDirty (PixmapPtr pPixmap)
>               }
>           }
>      }
> +
> +skip:
>      exaFinishAccess(&pPixmap->drawable, EXA_PREPARE_SRC);

You should probably also use the same trick as exaCopyDirty to make the
pixmap temporarily considered offscreen: set pExaPixmap->offscreen =
TRUE before PrepareAccess and restore it after FinishAccess. Without
that, pixmaps are never checked while they're not offscreen.


-- 
Earthling Michel Dänzer           |                http://www.vmware.com
Libre software enthusiast         |          Debian, X and DRI developer
_______________________________________________
xorg-devel mailing list
[email protected]
http://lists.x.org/mailman/listinfo/xorg-devel

Reply via email to