summaryrefslogtreecommitdiff
path: root/exa/exa_unaccel.c
diff options
context:
space:
mode:
authorIan Romanick <idr@us.ibm.com>2007-08-23 18:19:17 -0700
committerIan Romanick <idr@us.ibm.com>2007-08-23 18:19:17 -0700
commit8b6b40b7271acd81a9548f502c18f46f3b640640 (patch)
tree1462cb63501a8bdd8845d7c62e038b6a86b78fd5 /exa/exa_unaccel.c
parentab7a6d860d4a275a810a64b1ba7b13726ed10575 (diff)
parent3305d17195e3a0a5555300555bd7703312fa489f (diff)
Merge branch 'master' of git+ssh://git.freedesktop.org/git/xorg/xserver into pci-reworkpci-rework
Conflicts: hw/xfree86/common/xf86.h hw/xfree86/common/xf86Init.c hw/xfree86/common/xf86pciBus.c hw/xfree86/int10/generic.c hw/xfree86/int10/helper_exec.c hw/xfree86/loader/xf86sym.c hw/xfree86/os-support/bus/Pci.c hw/xfree86/os-support/bus/Pci.h hw/xfree86/os-support/bus/linuxPci.c hw/xfree86/os-support/linux/int10/linux.c
Diffstat (limited to 'exa/exa_unaccel.c')
-rw-r--r--exa/exa_unaccel.c35
1 files changed, 26 insertions, 9 deletions
diff --git a/exa/exa_unaccel.c b/exa/exa_unaccel.c
index 708d1eac6..a94648b47 100644
--- a/exa/exa_unaccel.c
+++ b/exa/exa_unaccel.c
@@ -369,31 +369,48 @@ ExaCheckComposite (CARD8 op,
/**
* Gets the 0,0 pixel of a pixmap. Used for doing solid fills of tiled pixmaps
* that happen to be 1x1. Pixmap must be at least 8bpp.
+ *
+ * XXX This really belongs in fb, so it can be aware of tiling and etc.
*/
CARD32
exaGetPixmapFirstPixel (PixmapPtr pPixmap)
{
CARD32 pixel;
+ void *fb;
+ Bool need_finish = FALSE;
+ BoxRec box;
ExaMigrationRec pixmaps[1];
+ ExaPixmapPriv (pPixmap);
- pixmaps[0].as_dst = FALSE;
- pixmaps[0].as_src = TRUE;
- pixmaps[0].pPix = pPixmap;
- exaDoMigration (pixmaps, 1, FALSE);
+ fb = pExaPixmap->sys_ptr;
+
+ /* Try to avoid framebuffer readbacks */
+ if (exaPixmapIsOffscreen(pPixmap) &&
+ miPointInRegion(DamageRegion(pExaPixmap->pDamage), 0, 0, &box))
+ {
+ need_finish = TRUE;
+ pixmaps[0].as_dst = FALSE;
+ pixmaps[0].as_src = TRUE;
+ pixmaps[0].pPix = pPixmap;
+ exaDoMigration (pixmaps, 1, FALSE);
+ exaPrepareAccess(&pPixmap->drawable, EXA_PREPARE_SRC);
+ fb = pPixmap->devPrivate.ptr;
+ }
- exaPrepareAccess(&pPixmap->drawable, EXA_PREPARE_SRC);
switch (pPixmap->drawable.bitsPerPixel) {
case 32:
- pixel = *(CARD32 *)(pPixmap->devPrivate.ptr);
+ pixel = *(CARD32 *)fb;
break;
case 16:
- pixel = *(CARD16 *)(pPixmap->devPrivate.ptr);
+ pixel = *(CARD16 *)fb;
break;
default:
- pixel = *(CARD8 *)(pPixmap->devPrivate.ptr);
+ pixel = *(CARD8 *)fb;
break;
}
- exaFinishAccess(&pPixmap->drawable, EXA_PREPARE_SRC);
+
+ if (need_finish)
+ exaFinishAccess(&pPixmap->drawable, EXA_PREPARE_SRC);
return pixel;
}