summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKristian Høgsberg <[email protected]>2011-05-06 10:31:18 -0400
committerKristian Høgsberg <[email protected]>2011-05-06 10:33:50 -0400
commite5169e9615e8391ea369415b356168717b8f7be0 (patch)
tree6f2486f3155d9ceb780098380372132755a907e1 /src
parent834b84149d99526e4e7a3cfa6ba9fe81e5fb9eda (diff)
egl: Add a cursor use bit to MESA_drm_image
Diffstat (limited to 'src')
-rw-r--r--src/egl/drivers/dri2/egl_dri2.c5
-rw-r--r--src/mesa/drivers/dri/intel/intel_screen.c10
2 files changed, 13 insertions, 2 deletions
diff --git a/src/egl/drivers/dri2/egl_dri2.c b/src/egl/drivers/dri2/egl_dri2.c
index b03ffc3cf9b..afab679bff6 100644
--- a/src/egl/drivers/dri2/egl_dri2.c
+++ b/src/egl/drivers/dri2/egl_dri2.c
@@ -1054,7 +1054,8 @@ dri2_create_drm_image_mesa(_EGLDriver *drv, _EGLDisplay *disp,
valid_mask =
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_mask) {
_eglLog(_EGL_WARNING, "bad image use bit 0x%04x",
attrs.DRMBufferUseMESA & ~valid_mask);
@@ -1066,6 +1067,8 @@ dri2_create_drm_image_mesa(_EGLDriver *drv, _EGLDisplay *disp,
dri_use |= __DRI_IMAGE_USE_SHARE;
if (attrs.DRMBufferUseMESA & EGL_DRM_BUFFER_USE_SCANOUT_MESA)
dri_use |= __DRI_IMAGE_USE_SCANOUT;
+ if (attrs.DRMBufferUseMESA & EGL_DRM_BUFFER_USE_CURSOR_MESA)
+ dri_use |= __DRI_IMAGE_USE_CURSOR;
dri2_img->dri_image =
dri2_dpy->image->createImage(dri2_dpy->dri_screen,
diff --git a/src/mesa/drivers/dri/intel/intel_screen.c b/src/mesa/drivers/dri/intel/intel_screen.c
index 7de0d12beba..5dacbb06633 100644
--- a/src/mesa/drivers/dri/intel/intel_screen.c
+++ b/src/mesa/drivers/dri/intel/intel_screen.c
@@ -216,8 +216,16 @@ intel_create_image(__DRIscreen *screen,
{
__DRIimage *image;
struct intel_screen *intelScreen = screen->private;
+ uint32_t tiling;
int cpp;
+ tiling = I915_TILING_X;
+ if (use & __DRI_IMAGE_USE_CURSOR) {
+ if (width != 64 || height != 64)
+ return NULL;
+ tiling = I915_TILING_NONE;
+ }
+
image = CALLOC(sizeof *image);
if (image == NULL)
return NULL;
@@ -247,7 +255,7 @@ intel_create_image(__DRIscreen *screen,
cpp = _mesa_get_format_bytes(image->format);
image->region =
- intel_region_alloc(intelScreen, I915_TILING_X,
+ intel_region_alloc(intelScreen, tiling,
cpp, width, height, GL_TRUE);
if (image->region == NULL) {
FREE(image);