summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZhigang Gong <zhigang.gong@linux.intel.com>2011-12-27 17:09:17 +0800
committerChris Wilson <chris@chris-wilson.co.uk>2012-01-03 21:35:04 +0000
commitf4ea732d7181d4ef7f97fb2585e87cdcaef99d46 (patch)
tree717815340e292b727e586173051b9c661c70520d
parente8aa9cedbfca09e22d46ec8882b9bebb3eb83022 (diff)
uxa/glamor: Let glamor do the GC validation
If we are using GLAMOR, then a tile pixmap or stipple pixmap may be pure glamor pixmap and thus UXA will not know how to render to them, and we need to let glamor do the validation. Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--uxa/uxa-glamor.h4
-rw-r--r--uxa/uxa.c12
2 files changed, 15 insertions, 1 deletions
diff --git a/uxa/uxa-glamor.h b/uxa/uxa-glamor.h
index 71a9c292..950a8781 100644
--- a/uxa/uxa-glamor.h
+++ b/uxa/uxa-glamor.h
@@ -45,12 +45,14 @@
#define glamor_set_spans_nf(...) FALSE
#define glamor_get_image_nf(...) FALSE
#define glamor_glyphs_nf(...) FALSE
-#define glamor_glyph_unrealize(...) ;
+#define glamor_glyph_unrealize(...) do { } while(0)
#define glamor_composite_nf(...) FALSE
#define glamor_composite_rects_nf(...) FALSE
#define glamor_trapezoids_nf(...) FALSE
#define glamor_triangles_nf(...) FALSE
#define glamor_add_traps_nf(...) FALSE
+#define glamor_create_gc(...) FALSE
+#define glamor_validate_gc(...) do { } while(0)
#endif
#endif /* UXA_GLAMOR_H */
diff --git a/uxa/uxa.c b/uxa/uxa.c
index d912b033..eb2ae03e 100644
--- a/uxa/uxa.c
+++ b/uxa/uxa.c
@@ -38,6 +38,7 @@
#include <X11/fonts/fontstruct.h>
#include "dixfontstr.h"
#include "uxa.h"
+#include "uxa-glamor.h"
#if HAS_DEVPRIVATEKEYREC
DevPrivateKeyRec uxa_screen_index;
@@ -183,11 +184,21 @@ void uxa_finish_access(DrawablePtr pDrawable, uxa_access_t access)
static void
uxa_validate_gc(GCPtr pGC, unsigned long changes, DrawablePtr pDrawable)
{
+ uxa_screen_t *uxa_screen = uxa_get_screen(pGC->pScreen);
/* fbValidateGC will do direct access to pixmaps if the tiling has
* changed.
* Preempt fbValidateGC by doing its work and masking the change out, so
* that we can do the Prepare/finish_access.
*/
+
+ /* If we are using GLAMOR, then the tile or stipple pixmap
+ * may be pure GLAMOR pixmap, then we should let the glamor
+ * to do the validation.
+ */
+ if (uxa_screen->info->flags & UXA_USE_GLAMOR) {
+ glamor_validate_gc(pGC, changes, pDrawable);
+ goto set_ops;
+ }
#ifdef FB_24_32BIT
if ((changes & GCTile) && fbGetRotatedPixmap(pGC)) {
(*pGC->pScreen->DestroyPixmap) (fbGetRotatedPixmap(pGC));
@@ -256,6 +267,7 @@ uxa_validate_gc(GCPtr pGC, unsigned long changes, DrawablePtr pDrawable)
fbValidateGC(pGC, changes, pDrawable);
}
+set_ops:
pGC->ops = (GCOps *) & uxa_ops;
}