diff options
author | Rob Clark <robdclark@chromium.org> | 2020-10-25 14:13:38 -0700 |
---|---|---|
committer | Marge Bot <eric+marge@anholt.net> | 2020-10-26 14:36:24 +0000 |
commit | 67238f95b52024b4e4b2acd0f750c15317ca3778 (patch) | |
tree | 1de7082f1f48e6e38ea4b52a434000bd5775fea0 | |
parent | 63bdbfd045de092b0cc59447cd7cfc3c45daa634 (diff) |
freedreno: Disallow tiled if SHARED and not QCOM_COMPRESSED
If the user is not aware of modifiers, and wants to allocate a shared
resource, we shouldn't leave them with tiled.
Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3678
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7308>
-rw-r--r-- | src/gallium/drivers/freedreno/freedreno_resource.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/gallium/drivers/freedreno/freedreno_resource.c b/src/gallium/drivers/freedreno/freedreno_resource.c index 142dade1050..2851f6664ca 100644 --- a/src/gallium/drivers/freedreno/freedreno_resource.c +++ b/src/gallium/drivers/freedreno/freedreno_resource.c @@ -936,8 +936,12 @@ fd_resource_allocate_and_resolve(struct pipe_screen *pscreen, * should.) */ bool allow_ubwc = drm_find_modifier(DRM_FORMAT_MOD_INVALID, modifiers, count); - if (tmpl->bind & PIPE_BIND_SHARED) + if (tmpl->bind & PIPE_BIND_SHARED) { allow_ubwc = drm_find_modifier(DRM_FORMAT_MOD_QCOM_COMPRESSED, modifiers, count); + if (!allow_ubwc) { + linear = true; + } + } allow_ubwc &= !(fd_mesa_debug & FD_DBG_NOUBWC); |