]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
drm/msm/mdp4: Fix modifier support enabling
authorDaniel Vetter <daniel.vetter@ffwll.ch>
Tue, 27 Apr 2021 09:20:15 +0000 (11:20 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 20 Jul 2021 14:16:04 +0000 (16:16 +0200)
commit 35cbb8c91e9cf310277d3dfb4d046df8edf2df33 upstream.

Setting the cap without the modifier list is very confusing to
userspace. Fix that by listing the ones we support explicitly.

Stable backport so that userspace can rely on this working in a
reasonable way, i.e. that the cap set implies IN_FORMATS is available.

Acked-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
Cc: stable@vger.kernel.org
Cc: Pekka Paalanen <pekka.paalanen@collabora.com>
Cc: Rob Clark <robdclark@chromium.org>
Cc: Jordan Crouse <jordan@cosmicpenguin.net>
Cc: Emil Velikov <emil.velikov@collabora.com>
Cc: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20210427092018.832258-5-daniel.vetter@ffwll.ch
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/gpu/drm/msm/disp/mdp4/mdp4_kms.c
drivers/gpu/drm/msm/disp/mdp4/mdp4_plane.c

index 44d1cda56974d7f6c106329ae0fac034fe4d38c6..9b2b8fa76f94f64b1b7dc37ca13df6b376870115 100644 (file)
@@ -96,8 +96,6 @@ static int mdp4_hw_init(struct msm_kms *kms)
        if (mdp4_kms->rev > 1)
                mdp4_write(mdp4_kms, REG_MDP4_RESET_STATUS, 1);
 
-       dev->mode_config.allow_fb_modifiers = true;
-
 out:
        pm_runtime_put_sync(dev->dev);
 
index 79ff653d8081e63d4aff0c57aa04037c24b7f58b..f4dacd3b4311126358e7ba119ae16de1bdb55f40 100644 (file)
@@ -356,6 +356,12 @@ enum mdp4_pipe mdp4_plane_pipe(struct drm_plane *plane)
        return mdp4_plane->pipe;
 }
 
+static const uint64_t supported_format_modifiers[] = {
+       DRM_FORMAT_MOD_SAMSUNG_64_32_TILE,
+       DRM_FORMAT_MOD_LINEAR,
+       DRM_FORMAT_MOD_INVALID
+};
+
 /* initialize plane */
 struct drm_plane *mdp4_plane_init(struct drm_device *dev,
                enum mdp4_pipe pipe_id, bool private_plane)
@@ -384,7 +390,7 @@ struct drm_plane *mdp4_plane_init(struct drm_device *dev,
        type = private_plane ? DRM_PLANE_TYPE_PRIMARY : DRM_PLANE_TYPE_OVERLAY;
        ret = drm_universal_plane_init(dev, plane, 0xff, &mdp4_plane_funcs,
                                 mdp4_plane->formats, mdp4_plane->nformats,
-                                NULL, type, NULL);
+                                supported_format_modifiers, type, NULL);
        if (ret)
                goto fail;