st/dri: assume external consumers of back buffers can write to the buffers
authorMarek Olšák <marek.olsak@amd.com>
Thu, 17 Oct 2019 20:46:06 +0000 (16:46 -0400)
committerMarek Olšák <marek.olsak@amd.com>
Fri, 25 Oct 2019 23:59:04 +0000 (19:59 -0400)
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Reviewed-By: Tapani Pälli <tapani.palli@intel.com>
src/gallium/state_trackers/dri/dri2.c

index 960065ffa23fa7222ed4c4d119613458a705102b..d4f96947c1de990c27e6e5f6b7c68e7dbe243d9c 100644 (file)
@@ -1108,10 +1108,10 @@ dri2_query_image_by_resource_handle(__DRIimage *image, int attrib, int *value)
       return false;
    }
 
+   usage = PIPE_HANDLE_USAGE_FRAMEBUFFER_WRITE;
+
    if (image->use & __DRI_IMAGE_USE_BACKBUFFER)
-      usage = PIPE_HANDLE_USAGE_EXPLICIT_FLUSH;
-   else
-      usage = PIPE_HANDLE_USAGE_FRAMEBUFFER_WRITE;
+      usage |= PIPE_HANDLE_USAGE_EXPLICIT_FLUSH;
 
    if (!pscreen->resource_get_handle(pscreen, NULL, image->texture,
                                      &whandle, usage))
@@ -1194,10 +1194,10 @@ dri2_query_image_by_resource_param(__DRIimage *image, int attrib, int *value)
       return false;
    }
 
+   handle_usage = PIPE_HANDLE_USAGE_FRAMEBUFFER_WRITE;
+
    if (image->use & __DRI_IMAGE_USE_BACKBUFFER)
-      handle_usage = PIPE_HANDLE_USAGE_EXPLICIT_FLUSH;
-   else
-      handle_usage = PIPE_HANDLE_USAGE_FRAMEBUFFER_WRITE;
+      handle_usage |= PIPE_HANDLE_USAGE_EXPLICIT_FLUSH;
 
    if (!dri2_resource_get_param(image, param, handle_usage, &res_param))
       return false;