iris: force reallocate on eglCreateImage with GFX >= 20

Cc: mesa-stable
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34499>
This commit is contained in:
Tapani Pälli 2025-04-10 15:05:35 +03:00 committed by Marge Bot
parent aa73767f5e
commit c2a4657862

View file

@ -1641,12 +1641,19 @@ iris_flush_resource(struct pipe_context *ctx, struct pipe_resource *resource)
const struct isl_drm_modifier_info *mod = res->mod_info;
bool newly_external = false;
/* We need to reallocate because original texture is compressed and we
* might end up doing a resolve.
*/
bool need_reallocate =
res->aux.usage == ISL_AUX_USAGE_CCS_E &&
iris_bo_is_real(res->bo) && iris_heap_is_compressed(res->bo->real.heap);
/* flush_resource() may be used to prepare an image for sharing externally
* with other clients (e.g. via eglCreateImage). To account for this, we
* make sure to eliminate suballocation and any compression that a consumer
* wouldn't know how to handle.
*/
if (!iris_bo_is_real(res->bo)) {
if (!iris_bo_is_real(res->bo) || need_reallocate) {
assert(!(res->base.b.bind & PIPE_BIND_SHARED));
iris_reallocate_resource_inplace(ice, res, PIPE_BIND_SHARED);
assert(res->base.b.bind & PIPE_BIND_SHARED);