panfrost: give afbc-packing its own flag

There's no point in querying this over and over again for each
resource, especially not when this test is about to become more
complicated. So let's give this its own flag.

Acked-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27916>
This commit is contained in:
Erik Faye-Lund 2024-01-18 12:17:43 +01:00 committed by Marge Bot
parent 7487ac2046
commit d861bd1563
3 changed files with 4 additions and 1 deletions

View file

@ -1618,7 +1618,7 @@ panfrost_ptr_unmap(struct pipe_context *pctx, struct pipe_transfer *transfer)
ctx, pan_resource(trans->staging.rsrc),
"AFBC write staging blit");
if (dev->debug & PAN_DBG_FORCE_PACK) {
if (pan_screen(pctx->screen)->force_afbc_packing) {
if (panfrost_should_pack_afbc(dev, prsrc))
panfrost_pack_afbc(ctx, prsrc);
}

View file

@ -852,6 +852,8 @@ panfrost_create_screen(int fd, const struct pipe_screen_config *config,
return NULL;
}
screen->force_afbc_packing = dev->debug & PAN_DBG_FORCE_PACK;
dev->ro = ro;
screen->base.destroy = panfrost_destroy_screen;

View file

@ -117,6 +117,7 @@ struct panfrost_screen {
struct panfrost_vtable vtbl;
struct disk_cache *disk_cache;
unsigned max_afbc_packing_ratio;
bool force_afbc_packing;
};
static inline struct panfrost_screen *