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 <l.stach@pengutronix.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7603>
This commit is contained in:
Lucas Stach 2020-11-13 14:59:52 +01:00 committed by Marge Bot
parent 40eb8b7830
commit 3824429da0
1 changed files with 3 additions and 3 deletions

View File

@ -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;