freedreno: Disable UBWC for frontbuffer rendering

Note that glamor would still need to set this new
GBM_BO_USE_FRONT_RENDERING flag.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6865
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17799>
This commit is contained in:
Rob Clark 2022-07-28 14:27:56 -07:00 committed by Marge Bot
parent 0c6d4cf9a2
commit 35dc99924a

View file

@ -1187,6 +1187,13 @@ get_best_layout(struct fd_screen *screen, struct pipe_resource *prsc,
if (FD_DBG(NOUBWC))
ubwc_ok = false;
/* Disallow UBWC for front-buffer rendering. The GPU does not atomically
* write pixel and header data, nor does the display atomically read it.
* The result can be visual corruption (ie. moreso than normal tearing).
*/
if (tmpl->bind & PIPE_BIND_USE_FRONT_RENDERING)
ubwc_ok = false;
if (ubwc_ok && !implicit_modifiers &&
!drm_find_modifier(DRM_FORMAT_MOD_QCOM_COMPRESSED, modifiers, count)) {
perf_debug("%" PRSC_FMT