panfrost: Legalize resource when attaching to a batch
authorLouis-Francis Ratté-Boulianne <lfrb@collabora.com>
Fri, 1 Sep 2023 15:22:05 +0000 (11:22 -0400)
committerMarge Bot <emma+marge@anholt.net>
Wed, 25 Oct 2023 14:25:31 +0000 (14:25 +0000)
commite9d523bb92a59336f69e92e51e8fe004f04cd629
treeecbdcd0d4a424f83f6d18aaef431741f14d27a26
parentbc55d150a915d5b2e91cd6ee11af4992d18fcf4f
panfrost: Legalize resource when attaching to a batch

Make sure we don't convert the texture for nothing by only
legalizing when creating a batch instead of on surface creation.
Also, to avoid recursive blit, we need to legalize the destination
resource before blitting.

Finally, make sure the resource has a sparse memory layout if
AFBC compressed. The GPU doesn't support rendering to a AFBC-packed
texture.

Signed-off-by: Louis-Francis Ratté-Boulianne <lfrb@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25012>
src/gallium/drivers/panfrost/pan_blit.c
src/gallium/drivers/panfrost/pan_cmdstream.c
src/gallium/drivers/panfrost/pan_job.c
src/gallium/drivers/panfrost/pan_resource.c
src/gallium/drivers/panfrost/pan_resource.h