st/egl: Add support for EGL_DRM_BUFFER_USE_CURSOR_MESA
authorBenjamin Franzke <benjaminfranzke@googlemail.com>
Fri, 13 May 2011 11:03:13 +0000 (13:03 +0200)
committerBenjamin Franzke <benjaminfranzke@googlemail.com>
Fri, 20 May 2011 17:10:22 +0000 (19:10 +0200)
src/gallium/state_trackers/egl/common/egl_g3d_image.c

index 210b8c2ee821e9abd70c039af1de70f2436eca8c..ce72e27c3d53e9670ef76c13d2b6062b83b70cdd 100644 (file)
@@ -97,7 +97,8 @@ egl_g3d_create_drm_buffer(_EGLDisplay *dpy, _EGLImage *img,
    }
 
    valid_use = EGL_DRM_BUFFER_USE_SCANOUT_MESA |
-               EGL_DRM_BUFFER_USE_SHARE_MESA;
+               EGL_DRM_BUFFER_USE_SHARE_MESA |
+               EGL_DRM_BUFFER_USE_CURSOR_MESA;
    if (attrs.DRMBufferUseMESA & ~valid_use) {
       _eglLog(_EGL_DEBUG, "bad image use bit 0x%04x",
             attrs.DRMBufferUseMESA);
@@ -122,6 +123,11 @@ egl_g3d_create_drm_buffer(_EGLDisplay *dpy, _EGLImage *img,
       templ.bind |= PIPE_BIND_SCANOUT;
    if (attrs.DRMBufferUseMESA & EGL_DRM_BUFFER_USE_SHARE_MESA)
       templ.bind |= PIPE_BIND_SHARED;
+   if (attrs.DRMBufferUseMESA & EGL_DRM_BUFFER_USE_CURSOR_MESA) {
+      if (attrs.Width != 64 || attrs.Height != 64)
+         return NULL;
+      templ.bind |= PIPE_BIND_CURSOR;
+   }
 
    return screen->resource_create(screen, &templ);
 }