MLK-17473-3 drm/imx: dcss: remove 'dcss_plane_mod_supported()'
authorFancy Fang <chen.fang@nxp.com>
Mon, 22 Jan 2018 08:44:45 +0000 (16:44 +0800)
committerLeonard Crestez <leonard.crestez@nxp.com>
Wed, 17 Apr 2019 23:51:34 +0000 (02:51 +0300)
The 'dcss_plane_mod_supported()' function is duplicated with
another function 'dcss_plane_format_mod_supported()'. So remove
it and use 'dcss_plane_format_mod_supported()' to replace its
calling.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
drivers/gpu/drm/imx/dcss/dcss-plane.c

index c019f12..ae45217 100644 (file)
@@ -170,16 +170,6 @@ static const struct drm_plane_funcs dcss_plane_funcs = {
        .format_mod_supported = dcss_plane_format_mod_supported,
 };
 
-static bool dcss_plane_mod_supported(int type, uint64_t mod)
-{
-       if (type == DRM_PLANE_TYPE_OVERLAY)
-               return mod == DRM_FORMAT_MOD_VSI_G1_TILED ||
-                      mod == DRM_FORMAT_MOD_VSI_G2_TILED ||
-                      mod == DRM_FORMAT_MOD_VSI_G2_TILED_COMPRESSED;
-
-       return false;
-}
-
 static int dcss_plane_atomic_check(struct drm_plane *plane,
                                   struct drm_plane_state *state)
 {
@@ -218,8 +208,10 @@ static int dcss_plane_atomic_check(struct drm_plane *plane,
        }
 
        if ((fb->flags & DRM_MODE_FB_MODIFIERS) &&
-           !dcss_plane_mod_supported(plane->type, fb->modifier)) {
-               DRM_DEBUG_KMS("Invalid modifier: %llx", fb->modifier);
+           !plane->funcs->format_mod_supported(plane,
+                               fb->format->format,
+                               fb->modifier)) {
+               DRM_INFO("Invalid modifier: %llx", fb->modifier);
                return -EINVAL;
        }