st/dri: Support dri2 useflags in dri2_create_image
authorBenjamin Franzke <benjaminfranzke@googlemail.com>
Fri, 13 May 2011 09:55:15 +0000 (11:55 +0200)
committerBenjamin Franzke <benjaminfranzke@googlemail.com>
Fri, 20 May 2011 17:10:22 +0000 (19:10 +0200)
src/gallium/state_trackers/dri/drm/dri2.c

index 30326a23d6cd09747edf365e45b781a755fa9598..e471e8e5be2f2f8b8f31a8b739d6c0bd4fc48193 100644 (file)
@@ -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: