freedreno: allow INVALID modifier
authorRob Clark <robdclark@chromium.org>
Thu, 13 Feb 2020 18:26:08 +0000 (10:26 -0800)
committerMarge Bot <eric+marge@anholt.net>
Thu, 13 Feb 2020 19:16:17 +0000 (19:16 +0000)
Re-allow INVALID modifier in import path.  The legacy import path
(createImageFromFds()), which is used by android, uses the INVALID
modifier.  Previously we would ignore this and just setup the imported
buffer as linear.  Restore this behavior to unbreak the legacy import
path.

Fixes: 9891062642a freedreno/a6xx: Implement layout for DRM_FORMAT_MOD_QCOM_COMPRESSED
Signed-off-by: Rob Clark <robdclark@chromium.org>
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3817>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3817>

src/gallium/drivers/freedreno/a6xx/fd6_resource.c

index 2018c3afdd9686539090d1babec826606d96dc0c..30a42ea557e7bd0d47ad8c13672fe39f07793f25 100644 (file)
@@ -199,6 +199,7 @@ fd6_layout_resource_for_modifier(struct fd_resource *rsc, uint64_t modifier)
        case DRM_FORMAT_MOD_QCOM_COMPRESSED:
                return fill_ubwc_buffer_sizes(rsc);
        case DRM_FORMAT_MOD_LINEAR:
+       case DRM_FORMAT_MOD_INVALID:
                return 0;
        default:
                return -1;