From: Icecream95 Date: Thu, 10 Sep 2020 09:08:25 +0000 (+1200) Subject: panfrost: Set modifier_constant to true for exported resources X-Git-Tag: upstream/21.0.0~5291 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7acf364131f59e201eddcc46492401ae0424b081;p=platform%2Fupstream%2Fmesa.git panfrost: Set modifier_constant to true for exported resources Not actually seen in the wild but could theoretically be a problem for applications that explicitly import/export resources. v2: Set it on exporting as well as importing (Daniel Stone) Reviewed-by: Alyssa Rosenzweig Part-of: --- diff --git a/src/gallium/drivers/panfrost/pan_resource.c b/src/gallium/drivers/panfrost/pan_resource.c index f39ac1c..54802ef 100644 --- a/src/gallium/drivers/panfrost/pan_resource.c +++ b/src/gallium/drivers/panfrost/pan_resource.c @@ -79,6 +79,7 @@ panfrost_resource_from_handle(struct pipe_screen *pscreen, rsc->internal_format = templat->format; rsc->modifier = (whandle->modifier == DRM_FORMAT_MOD_INVALID) ? DRM_FORMAT_MOD_LINEAR : whandle->modifier; + rsc->modifier_constant = true; rsc->slices[0].stride = whandle->stride; rsc->slices[0].offset = whandle->offset; rsc->slices[0].initialized = true; @@ -118,6 +119,7 @@ panfrost_resource_get_handle(struct pipe_screen *pscreen, struct renderonly_scanout *scanout = rsrc->scanout; handle->modifier = rsrc->modifier; + rsrc->modifier_constant = true; if (handle->type == WINSYS_HANDLE_TYPE_SHARED) { return false;