summaryrefslogtreecommitdiff
path: root/src/intel_uxa.c
diff options
context:
space:
mode:
authorZhigang Gong <zhigang.gong@linux.intel.com>2012-01-12 15:30:15 +0800
committerChris Wilson <chris@chris-wilson.co.uk>2012-01-16 10:49:21 +0000
commit2f09363a6e2c77fb23bf0e4c12c4507521fa631b (patch)
treeb882395d24ffc77cf932742705ffe956fdb19bc0 /src/intel_uxa.c
parentfd4c139a3959df90c7f078817fc6e2f3db715bf8 (diff)
uxa/glamor: Create glamor pixmap by default.
When creating native glamor pixmaps we will get much better performance than using the textured-drm pixmap, this commit is to make that the default behaviour when configured to use glamor. Another advantage of this commit is that we reduce the risk of encountering the "incompatible region exists for this name" and the associated render corruption. And since we now never intentionally allocate a reusable pixmap we could just make all (intel_glamor) allocations non-reusable without incurring too great an overhead. A side effect is that those glamor pixmaps do not have a valid BO attached to them and thus it fails to get a DRI drawable. This commit also fixes that problem by adjusting the fixup_shadow mechanism to recreate a textured-drm pixmap from the native glamor pixmap. I tested this with mutter, and it works fine. The performance gain to apply this patch is about 10% to 20% with different workload. Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/intel_uxa.c')
-rw-r--r--src/intel_uxa.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/intel_uxa.c b/src/intel_uxa.c
index 9d745540..f04a2efd 100644
--- a/src/intel_uxa.c
+++ b/src/intel_uxa.c
@@ -1026,6 +1026,12 @@ intel_uxa_create_pixmap(ScreenPtr screen, int w, int h, int depth,
struct intel_pixmap *priv;
PixmapPtr pixmap, new_pixmap = NULL;
+ if (!(usage & INTEL_CREATE_PIXMAP_DRI2)) {
+ pixmap = intel_glamor_create_pixmap(screen, w, h, depth, usage);
+ if (pixmap)
+ return pixmap;
+ }
+
if (w > 32767 || h > 32767)
return NullPixmap;