MLK-18809: drm: imx: dcss: fix cropping check for linear buffers
authorLaurentiu Palcu <laurentiu.palcu@nxp.com>
Tue, 10 Jul 2018 10:11:40 +0000 (13:11 +0300)
committerLeonard Crestez <leonard.crestez@nxp.com>
Wed, 17 Apr 2019 23:51:34 +0000 (02:51 +0300)
Currently, DCSS driver does not support cropping for linear buffers,
only tiled ones. Current checks return an error only if the submitted
buffer has no modifiers present. However, Weston uses modifiers even for
linear buffers and we need to check for that.

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@nxp.com>
drivers/gpu/drm/imx/dcss/dcss-plane.c

index 0a9fafb..d9c9721 100644 (file)
@@ -221,7 +221,9 @@ static int dcss_plane_atomic_check(struct drm_plane *plane,
            state->crtc_y + state->crtc_h > vdisplay) {
                if (plane->type == DRM_PLANE_TYPE_PRIMARY)
                        return -EINVAL;
-               else if (!(fb->flags & DRM_MODE_FB_MODIFIERS))
+               else if (!(fb->flags & DRM_MODE_FB_MODIFIERS) ||
+                        (fb->flags & DRM_MODE_FB_MODIFIERS &&
+                         fb->modifier == DRM_FORMAT_MOD_LINEAR))
                        return -EINVAL;
        }