On 01/03/2016 22:41, Marek Olšák wrote:
From: Marek Olšák <marek.ol...@amd.com>


     buffer->base.attachment = attachment;
     buffer->base.name = whandle.handle;
@@ -539,7 +540,8 @@ dri2_allocate_textures(struct dri_context *ctx,
              whandle.type = DRM_API_HANDLE_TYPE_KMS;
           drawable->textures[statt] =
              screen->base.screen->resource_from_handle(screen->base.screen,
-                  &templ, &whandle);
+                  &templ, &whandle,
+                  PIPE_HANDLE_USAGE_EXPLICIT_FLUSH | PIPE_HANDLE_USAGE_READ);
           assert(drawable->textures[statt]);
        }
     }
@@ -756,7 +758,7 @@ dri2_create_image_from_winsys(__DRIscreen *_screen,
     whandle->stride = pitch * util_format_get_blocksize(pf);
img->texture = screen->base.screen->resource_from_handle(screen->base.screen,
-         &templ, whandle);
+         &templ, whandle, PIPE_HANDLE_USAGE_READ_WRITE);
I guess it would be better setting explicitly img->use to 0 ,
as is already the case for other img fields.
     if (!img->texture) {
        FREE(img);
        return NULL;
@@ -884,6 +886,7 @@ dri2_create_image(__DRIscreen *_screen,
     img->layer = 0;
     img->dri_format = format;
     img->dri_components = 0;
+   img->use = use;


This looks ok to me (except the minor nitpick).
You can add my Rb: Reviewed-by: Axel Davy <axel.d...@ens.fr>

For the first patch, I think it would be better to document somewhere the flag.
Basically my initial commit message was:
"

Add __DRI_IMAGE_USE_BACKBUFFER to indicate the
image is going to be used as a backbuffer.

Backbuffers are going to be attached as
__DRI_BUFFER_BACK_LEFT or
__DRI_BUFFER_BACK_RIGHT.

This flag enables the driver to assume the
buffer will only be read by an external process after
a swapbuffer, in contrary to gbm buffers,
front buffers and fake front buffers, which could be
read after a flush."

I guess the latter part could be adapted and put indri_interface.h

Axel

_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to