Revert "st/dri: assume external consumers of back buffers can write to the buffers"
authorTapani Pälli <tapani.palli@intel.com>
Tue, 12 Nov 2019 15:32:56 +0000 (17:32 +0200)
committerTapani Pälli <tapani.palli@intel.com>
Thu, 14 Nov 2019 05:46:30 +0000 (07:46 +0200)
This reverts commit 1d1b4578211dcc69cfab8879d0cdafaba1eec948.

This series caused unexpected flickering artifacts with Iris driver on
Chrome OS and EGL_EXT_image_flush_external spec has not been published
yet.

Acked-by: Eric Engestrom <eric@engestrom.ch>
Acked-by: Kristian H. Kristensen <hoegsberg@google.com>
src/gallium/state_trackers/dri/dri2.c

index 63e90bd3df066ac91fb7813b6b8f4a9923f27086..01646228c1980aada30f80970d7bc15f14bab4cd 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;
+      usage = PIPE_HANDLE_USAGE_EXPLICIT_FLUSH;
+   else
+      usage = PIPE_HANDLE_USAGE_FRAMEBUFFER_WRITE;
 
    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;
+      handle_usage = PIPE_HANDLE_USAGE_EXPLICIT_FLUSH;
+   else
+      handle_usage = PIPE_HANDLE_USAGE_FRAMEBUFFER_WRITE;
 
    if (!dri2_resource_get_param(image, param, handle_usage, &res_param))
       return false;