[PATCH] EXA: ModifyPixmapHeader_mixed fixes.
Maarten Maathuis
madman2003 at gmail.com
Fri Dec 4 11:28:57 PST 2009
2009/12/4 Michel Dänzer <michel at daenzer.net>:
> From: Michel Dänzer <daenzer at vmware.com>
>
> * Better detection of dimension changes.
> * Make sure to re-create the system memory copy when the pixmap dimensions
> change (e.g. the screen pixmap on screen resize).
> * Clear the valid regions.
>
> Signed-off-by: Michel Dänzer <daenzer at vmware.com>
> ---
> exa/exa_mixed.c | 45 ++++++++++++++++++++++++++++++++++++++++++---
> 1 files changed, 42 insertions(+), 3 deletions(-)
>
> diff --git a/exa/exa_mixed.c b/exa/exa_mixed.c
> index 7dc426f..e707a61 100644
> --- a/exa/exa_mixed.c
> +++ b/exa/exa_mixed.c
> @@ -135,14 +135,51 @@ exaModifyPixmapHeader_mixed(PixmapPtr pPixmap, int width, int height, int depth,
> pExaPixmap->score = EXA_PIXMAP_SCORE_PINNED;
> }
>
> - if (pExaPixmap->driverPriv) {
> - if (width > 0 && height > 0 && bitsPerPixel > 0) {
> + if (width <= 0)
> + width = pPixmap->drawable.width;
> +
> + if (height <= 0)
> + height = pPixmap->drawable.height;
> +
> + if (bitsPerPixel <= 0) {
> + if (depth <= 0)
> + bitsPerPixel = pPixmap->drawable.bitsPerPixel;
> + else
> + bitsPerPixel = BitsPerPixel(depth);
> + }
> +
> + if (depth <= 0)
> + depth = pPixmap->drawable.depth;
> +
> + if (width != pPixmap->drawable.width ||
> + height != pPixmap->drawable.height ||
> + depth != pPixmap->drawable.depth ||
> + bitsPerPixel != pPixmap->drawable.bitsPerPixel) {
> + if (pExaPixmap->driverPriv) {
> exaSetFbPitch(pExaScr, pExaPixmap,
> width, height, bitsPerPixel);
>
> exaSetAccelBlock(pExaScr, pExaPixmap,
> width, height, bitsPerPixel);
> }
> +
> + /* Need to re-create system copy if there's also a GPU copy */
These criteria can also be true for a pixmap without gpu copy.
> + if (pExaPixmap->pDamage && pExaPixmap->sys_ptr) {
> + free(pExaPixmap->sys_ptr);
> + pExaPixmap->sys_ptr = NULL;
> + DamageUnregister(&pPixmap->drawable, pExaPixmap->pDamage);
> + DamageDestroy(pExaPixmap->pDamage);
> + pExaPixmap->pDamage = NULL;
> + REGION_EMPTY(pScreen, &pExaPixmap->validSys);
> +
> + swap(pExaScr, pScreen, ModifyPixmapHeader);
> + pScreen->ModifyPixmapHeader(pPixmap, width, height, depth,
> + bitsPerPixel, devKind, pPixData);
> + swap(pExaScr, pScreen, ModifyPixmapHeader);
> +
How is this helping, considering it's done twice (the original MPH
still exists)?
> + pExaPixmap->sys_ptr = pPixmap->devPrivate.ptr;
> + pExaPixmap->sys_pitch = pPixmap->devKind;
> + }
> }
>
> has_gpu_copy = exaPixmapHasGpuCopy(pPixmap);
> @@ -158,8 +195,10 @@ exaModifyPixmapHeader_mixed(PixmapPtr pPixmap, int width, int height, int depth,
> if (pExaScr->info->ModifyPixmapHeader && pExaPixmap->driverPriv) {
> ret = pExaScr->info->ModifyPixmapHeader(pPixmap, width, height, depth,
> bitsPerPixel, devKind, pPixData);
> - if (ret == TRUE)
> + if (ret == TRUE) {
> + REGION_EMPTY(pScreen, &pExaPixmap->validFB);
> goto out;
> + }
> }
Why not for ret == FALSE?
>
> swap(pExaScr, pScreen, ModifyPixmapHeader);
> --
> 1.6.4.3
>
> _______________________________________________
> xorg-devel mailing list
> xorg-devel at lists.x.org
> http://lists.x.org/mailman/listinfo/xorg-devel
>
More information about the xorg-devel
mailing list