[PATCH 5/7] glamor: Add new GLAMOR_CREATE_PIXMAP_NO_TEXTURE pixmap create flag

Kristian Høgsberg krh at bitplanet.net
Mon Mar 31 23:53:38 PDT 2014


This flag lets a DDX allocate a glamor pixmap without allocating the
texture that backs it.  The DDX can then allocate the texture itself
and then set it later.

Signed-off-by: Kristian Høgsberg <krh at bitplanet.net>
---
 glamor/glamor.c | 10 +++++++++-
 glamor/glamor.h |  1 +
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/glamor/glamor.c b/glamor/glamor.c
index 3094432..8d24531 100644
--- a/glamor/glamor.c
+++ b/glamor/glamor.c
@@ -182,7 +182,15 @@ glamor_create_pixmap(ScreenPtr screen, int w, int h, int depth,
     pitch = (((w * pixmap->drawable.bitsPerPixel + 7) / 8) + 3) & ~3;
     screen->ModifyPixmapHeader(pixmap, w, h, 0, 0, pitch, NULL);
 
-    if (type == GLAMOR_MEMORY_MAP || usage == GLAMOR_CREATE_NO_LARGE ||
+    if (usage == GLAMOR_CREATE_PIXMAP_NO_TEXTURE) {
+        pixmap_priv->type = GLAMOR_TEXTURE_ONLY;
+        pixmap_priv->base.box.x1 = 0;
+        pixmap_priv->base.box.y1 = 0;
+        pixmap_priv->base.box.x2 = w;
+        pixmap_priv->base.box.y2 = h;
+        return pixmap;
+    }
+    else if (type == GLAMOR_MEMORY_MAP || usage == GLAMOR_CREATE_NO_LARGE ||
         glamor_check_fbo_size(glamor_priv, w, h))
     {
         pixmap_priv->type = type;
diff --git a/glamor/glamor.h b/glamor/glamor.h
index 84b6736..913bdce 100644
--- a/glamor/glamor.h
+++ b/glamor/glamor.h
@@ -149,6 +149,7 @@ extern _X_EXPORT PixmapPtr glamor_create_pixmap(ScreenPtr screen, int w, int h,
 #define GLAMOR_CREATE_FBO_NO_FBO        0x103
 #define GLAMOR_CREATE_PIXMAP_MAP        0x104
 #define GLAMOR_CREATE_NO_LARGE          0x105
+#define GLAMOR_CREATE_PIXMAP_NO_TEXTURE 0x106
 
 /* @glamor_egl_exchange_buffers: Exchange the underlying buffers(KHR image,fbo).
  *
-- 
1.9.0



More information about the xorg-devel mailing list