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 <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9780>
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;