This will be used by the next commit.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
#define __DRI_IMAGE_USE_SCANOUT 0x0002
#define __DRI_IMAGE_USE_CURSOR 0x0004 /* Depricated */
#define __DRI_IMAGE_USE_LINEAR 0x0008
+/* The buffer will only be read by an external process after SwapBuffers,
+ * in contrary to gbm buffers, front buffers and fake front buffers, which
+ * could be read after a flush."
+ */
+#define __DRI_IMAGE_USE_BACKBUFFER 0x0010
/**
{
struct dri2_egl_display *dri2_dpy =
dri2_egl_display(dri2_surf->base.Resource.Display);
- int i;
+ int i, use_flags;
unsigned int dri_image_format;
/* currently supports three WL DRM formats,
if (dri2_surf->back == NULL)
return -1;
+ use_flags = __DRI_IMAGE_USE_SHARE | __DRI_IMAGE_USE_BACKBUFFER;
+
if (dri2_dpy->is_different_gpu &&
dri2_surf->back->linear_copy == NULL) {
dri2_surf->back->linear_copy =
dri2_surf->base.Width,
dri2_surf->base.Height,
dri_image_format,
- __DRI_IMAGE_USE_SHARE |
+ use_flags |
__DRI_IMAGE_USE_LINEAR,
NULL);
if (dri2_surf->back->linear_copy == NULL)
dri2_surf->base.Height,
dri_image_format,
dri2_dpy->is_different_gpu ?
- 0 : __DRI_IMAGE_USE_SHARE,
+ 0 : use_flags,
NULL);
dri2_surf->back->age = 0;
}
width, height,
format,
__DRI_IMAGE_USE_SHARE |
- __DRI_IMAGE_USE_SCANOUT,
+ __DRI_IMAGE_USE_SCANOUT |
+ __DRI_IMAGE_USE_BACKBUFFER,
buffer);
pixmap_buffer = buffer->image;
(draw->ext->image->createImage)(draw->dri_screen,
width, height, format,
__DRI_IMAGE_USE_SHARE |
- __DRI_IMAGE_USE_LINEAR,
+ __DRI_IMAGE_USE_LINEAR |
+ __DRI_IMAGE_USE_BACKBUFFER,
buffer);
pixmap_buffer = buffer->linear_buffer;