Module: Mesa
Branch: main
Commit: aa35e86cc8aee67d95d2d925a7d9485906ab9d13
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=aa35e86cc8aee67d95d2d925a7d9485906ab9d13

Author: Lucas Stach <[email protected]>
Date:   Tue Oct 25 18:38:12 2022 +0200

etnaviv: warn when imported TS buffer is the same as color buffer

Color and TS buffers are allocated separately for each etnaviv resource, so
getting the same base and TS buffer at import time is unexpected and a strong
hint at the application doing something wrong, like passing in the same GEM
handle for all planes on a GBM import. Print a warning to give the user some
feedback.

Signed-off-by: Lucas Stach <[email protected]>
Reviewed-by: Christian Gmeiner <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9780>

---

 src/gallium/drivers/etnaviv/etnaviv_resource.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/gallium/drivers/etnaviv/etnaviv_resource.c 
b/src/gallium/drivers/etnaviv/etnaviv_resource.c
index 7e730a35e41..cd688af1f5a 100644
--- a/src/gallium/drivers/etnaviv/etnaviv_resource.c
+++ b/src/gallium/drivers/etnaviv/etnaviv_resource.c
@@ -601,6 +601,10 @@ static void etna_resource_finish_ts_import(struct 
etna_screen *screen,
    uint64_t ts_modifier = rsc->modifier & VIVANTE_MOD_TS_MASK;
    uint8_t ts_mode = 0;
 
+   if (ts_rsc->bo == rsc->bo)
+      fprintf(stderr, "etnaviv: application bug: importing shared TS resource "
+              "with TS BO matching color BO, expect rendering corruption!\n");
+
    if (ts_modifier == VIVANTE_MOD_TS_256_4)
       ts_mode = TS_MODE_256B;
 

Reply via email to