38b12e049fc6c5835df4272ffa909e5cc6cf4ddb
[openwrt/staging/mkresin.git] /
1 From aa6061c2db8adbe0e75890cfc6f56b800b9995df Mon Sep 17 00:00:00 2001
2 From: Dave Stevenson <dave.stevenson@raspberrypi.org>
3 Date: Wed, 12 Jun 2019 17:13:21 +0100
4 Subject: [PATCH] drm/vc4: In FKMS look at the modifiers correctly for
5 SAND
6
7 Incorrect masking was used in the switch for the modifier,
8 therefore for SAND (which puts the column pitch in the
9 modifier) it didn't match.
10
11 Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
12 ---
13 drivers/gpu/drm/vc4/vc4_firmware_kms.c | 5 ++++-
14 1 file changed, 4 insertions(+), 1 deletion(-)
15
16 --- a/drivers/gpu/drm/vc4/vc4_firmware_kms.c
17 +++ b/drivers/gpu/drm/vc4/vc4_firmware_kms.c
18 @@ -462,7 +462,7 @@ static void vc4_plane_atomic_update(stru
19 }
20 mb->plane.planes[3] = 0;
21
22 - switch (fb->modifier) {
23 + switch (fourcc_mod_broadcom_mod(fb->modifier)) {
24 case DRM_FORMAT_MOD_BROADCOM_VC4_T_TILED:
25 switch (mb->plane.vc_image_type) {
26 case VC_IMAGE_XRGB8888:
27 @@ -478,6 +478,9 @@ static void vc4_plane_atomic_update(stru
28 break;
29 case DRM_FORMAT_MOD_BROADCOM_SAND128:
30 mb->plane.vc_image_type = VC_IMAGE_YUV_UV;
31 + /* Note that the column pitch is passed across in lines, not
32 + * bytes.
33 + */
34 mb->plane.pitch = fourcc_mod_broadcom_param(fb->modifier);
35 break;
36 }