etnaviv: fix tile status interaction with write mappings
authorLucas Stach <l.stach@pengutronix.de>
Fri, 18 Nov 2022 11:24:58 +0000 (12:24 +0100)
committerEric Engestrom <eric@engestrom.ch>
Wed, 23 Nov 2022 19:12:00 +0000 (19:12 +0000)
commit2946c2b3b333944e4ded4df1537a3d61eaa34839
treec5cc533981788932d6a170d63d76a7a00c135c12
parentb92f135377cc1615c4d0878d54e15efa3118dd08
etnaviv: fix tile status interaction with write mappings

This fixes a longstanding bug in the interaction between TS and a write
mapping. The write does not update TS regardless of the way the update
is done. Update via etna_copy_resource would just set the target ts_valid
to false without actually writing back any dirty TS to the resource.
Writes via the CPU would update the resource, but keep ts_valid at true
even if the tile status may now not match the actually written tiles of
the resource anymore.

Fix this by writing back a dirty TS to the target resource if needed
before updating the level with the write data. Always invalidate TS,
even when the update is done by the CPU.

Cc: mesa-stable
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19846>
(cherry picked from commit 0fb813526e3b3be6cf8a866b084db044ccd0e103)
.pick_status.json
src/gallium/drivers/etnaviv/etnaviv_clear_blit.c
src/gallium/drivers/etnaviv/etnaviv_transfer.c