[Mesa-dev] [PATCH 1/3] st/dri: Support dri2 useflags in dri2_create_image

Benjamin Franzke benjaminfranzke at googlemail.com
Fri May 13 04:13:27 PDT 2011


---
 src/gallium/state_trackers/dri/drm/dri2.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/src/gallium/state_trackers/dri/drm/dri2.c b/src/gallium/state_trackers/dri/drm/dri2.c
index 30326a2..e471e8e 100644
--- a/src/gallium/state_trackers/dri/drm/dri2.c
+++ b/src/gallium/state_trackers/dri/drm/dri2.c
@@ -481,6 +481,15 @@ dri2_create_image(__DRIscreen *_screen,
    enum pipe_format pf;
 
    tex_usage = PIPE_BIND_RENDER_TARGET | PIPE_BIND_SAMPLER_VIEW;
+   if (use & __DRI_IMAGE_USE_SCANOUT)
+      tex_usage |= PIPE_BIND_SCANOUT;
+   if (use & __DRI_IMAGE_USE_SHARE)
+      tex_usage |= PIPE_BIND_SHARED;
+   if (use & __DRI_IMAGE_USE_CURSOR) {
+      if (width != 64 || height != 64)
+         return NULL;
+      tex_usage |= PIPE_BIND_CURSOR;
+   }
 
    switch (format) {
    case __DRI_IMAGE_FORMAT_RGB565:
-- 
1.7.3.4



More information about the mesa-dev mailing list