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>
(cherry picked from commit 67238f95b5)
This commit is contained in:
Rob Clark 2020-10-25 14:13:38 -07:00 committed by Dylan Baker
parent 5afe855fde
commit bfa8ac8c67
2 changed files with 6 additions and 2 deletions

View file

@ -40,7 +40,7 @@
"description": "freedreno: Disallow tiled if SHARED and not QCOM_COMPRESSED",
"nominated": true,
"nomination_type": 0,
"resolution": 0,
"resolution": 1,
"master_sha": null,
"because_sha": null
},

View file

@ -933,8 +933,12 @@ fd_resource_create_with_modifiers(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);