From a11807b795ac8ea7bff335e0a2e5d12d591f7599 Mon Sep 17 00:00:00 2001 From: Boris Brezillon Date: Wed, 7 Apr 2021 16:00:26 +0200 Subject: [PATCH] panfrost: Always pass a non-NULL screen to set_damage_region() We will soon have a different handling for Bifrost, and we need to know which GPU we're targeting to choose the right path. Signed-off-by: Boris Brezillon Reviewed-by: Alyssa Rosenzweig Part-of: --- src/gallium/drivers/panfrost/pan_job.c | 5 +++-- src/gallium/drivers/panfrost/pan_resource.c | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/gallium/drivers/panfrost/pan_job.c b/src/gallium/drivers/panfrost/pan_job.c index e37d49e11e2..ca58fb343f1 100644 --- a/src/gallium/drivers/panfrost/pan_job.c +++ b/src/gallium/drivers/panfrost/pan_job.c @@ -1158,8 +1158,9 @@ panfrost_batch_submit(struct panfrost_batch *batch, if (!batch->key.cbufs[i]) continue; - panfrost_resource_set_damage_region(NULL, - batch->key.cbufs[i]->texture, 0, NULL); + panfrost_resource_set_damage_region(batch->ctx->base.screen, + batch->key.cbufs[i]->texture, + 0, NULL); } out: diff --git a/src/gallium/drivers/panfrost/pan_resource.c b/src/gallium/drivers/panfrost/pan_resource.c index 0f0dc87e763..0cfb975369e 100644 --- a/src/gallium/drivers/panfrost/pan_resource.c +++ b/src/gallium/drivers/panfrost/pan_resource.c @@ -109,7 +109,7 @@ panfrost_resource_from_handle(struct pipe_screen *pscreen, rsc->modifier_constant = true; rsc->state.slices[0].data_valid = true; - panfrost_resource_set_damage_region(NULL, &rsc->base, 0, NULL); + panfrost_resource_set_damage_region(pscreen, &rsc->base, 0, NULL); /* If we import an AFBC resource, it should be in a format that's * supported, otherwise we don't know if the fixup is expected to be @@ -601,7 +601,7 @@ panfrost_resource_create_with_modifier(struct pipe_screen *screen, if (drm_is_afbc(so->image.layout.modifier)) panfrost_resource_init_afbc_headers(so); - panfrost_resource_set_damage_region(NULL, &so->base, 0, NULL); + panfrost_resource_set_damage_region(screen, &so->base, 0, NULL); if (template->bind & PIPE_BIND_INDEX_BUFFER) so->index_cache = rzalloc(so, struct panfrost_minmax_cache);