From 3824429da0e0e68b78534b1e0ab7e386bcb2b2e2 Mon Sep 17 00:00:00 2001 From: Lucas Stach Date: Fri, 13 Nov 2020 14:59:52 +0100 Subject: [PATCH] frontend/dri: add EXPLICIT_FLUSH hint in dri2_resource_get_param dri2_resource_get_param() is called from two different places right now. Only one of them adds the EXPLICIT_FLUSH hint to the handle usage, which may disable the optimizations provided by this hint without a reason. Make sure to always add this hint when appropriate. Signed-off-by: Lucas Stach Part-of: --- src/gallium/frontends/dri/dri2.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/gallium/frontends/dri/dri2.c b/src/gallium/frontends/dri/dri2.c index 0220513368e..8ed47c25825 100644 --- a/src/gallium/frontends/dri/dri2.c +++ b/src/gallium/frontends/dri/dri2.c @@ -1252,6 +1252,9 @@ dri2_resource_get_param(__DRIimage *image, enum pipe_resource_param param, if (!pscreen->resource_get_param) return false; + if (image->use & __DRI_IMAGE_USE_BACKBUFFER) + handle_usage |= PIPE_HANDLE_USAGE_EXPLICIT_FLUSH; + return pscreen->resource_get_param(pscreen, NULL, image->texture, image->plane, 0, 0, param, handle_usage, value); @@ -1296,9 +1299,6 @@ dri2_query_image_by_resource_param(__DRIimage *image, int attrib, int *value) handle_usage = PIPE_HANDLE_USAGE_FRAMEBUFFER_WRITE; - if (image->use & __DRI_IMAGE_USE_BACKBUFFER) - handle_usage |= PIPE_HANDLE_USAGE_EXPLICIT_FLUSH; - if (!dri2_resource_get_param(image, param, handle_usage, &res_param)) return false;