freedreno: Fix modifier determination

Now that we have TILED2 and TILED3 modifiers, we should handle those
cases.

Fixes assert that modifier != INVALID in
spec@ext_image_dma_buf_import@ext_image_dma_buf_import-modifiers

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25995>
This commit is contained in:
Rob Clark
2023-11-01 09:46:04 -07:00
committed by Marge Bot
parent 6ac133c646
commit a95ea2b6d6

View File

@@ -1082,14 +1082,15 @@ fd_resource_destroy(struct pipe_screen *pscreen, struct pipe_resource *prsc)
static uint64_t
fd_resource_modifier(struct fd_resource *rsc)
{
if (!rsc->layout.tile_mode)
return DRM_FORMAT_MOD_LINEAR;
if (rsc->layout.ubwc_layer_size)
return DRM_FORMAT_MOD_QCOM_COMPRESSED;
/* TODO invent a modifier for tiled but not UBWC buffers: */
return DRM_FORMAT_MOD_INVALID;
switch (rsc->layout.tile_mode) {
case 3: return DRM_FORMAT_MOD_QCOM_TILED3;
case 2: return DRM_FORMAT_MOD_QCOM_TILED2;
case 0: return DRM_FORMAT_MOD_LINEAR;
default: return DRM_FORMAT_MOD_INVALID;
}
}
static bool