drm/vc4: In FKMS look at the modifiers correctly for SAND
authorDave Stevenson <dave.stevenson@raspberrypi.org>
Wed, 12 Jun 2019 16:13:21 +0000 (17:13 +0100)
committerpopcornmix <popcornmix@gmail.com>
Wed, 1 Jul 2020 15:33:00 +0000 (16:33 +0100)
Incorrect masking was used in the switch for the modifier,
therefore for SAND (which puts the column pitch in the
modifier) it didn't match.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
drivers/gpu/drm/vc4/vc4_firmware_kms.c

index 8ca9cb2..4fd2629 100644 (file)
@@ -462,7 +462,7 @@ static void vc4_plane_atomic_update(struct drm_plane *plane,
        }
        mb->plane.planes[3] = 0;
 
-       switch (fb->modifier) {
+       switch (fourcc_mod_broadcom_mod(fb->modifier)) {
        case DRM_FORMAT_MOD_BROADCOM_VC4_T_TILED:
                switch (mb->plane.vc_image_type) {
                case VC_IMAGE_XRGB8888:
@@ -478,6 +478,9 @@ static void vc4_plane_atomic_update(struct drm_plane *plane,
                break;
        case DRM_FORMAT_MOD_BROADCOM_SAND128:
                mb->plane.vc_image_type = VC_IMAGE_YUV_UV;
+               /* Note that the column pitch is passed across in lines, not
+                * bytes.
+                */
                mb->plane.pitch = fourcc_mod_broadcom_param(fb->modifier);
                break;
        }