Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/fourcc: Add fourcc for Mali linear tiled formats

Mali-DP implements a number of tiled yuv formats which are not
currently described in drm_fourcc.h.
This adds those definitions and describes their memory layout by
using the newly added char_per_block, block_w, block_h.

Reviewed-by: Brian Starkey <brian.starkey@arm.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Alexandru Gheorghe <alexandru-cosmin.gheorghe@arm.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20181101151051.1509-3-alexandru-cosmin.gheorghe@arm.com

+26
+12
drivers/gpu/drm/drm_fourcc.c
··· 225 225 { .format = DRM_FORMAT_UYVY, .depth = 0, .num_planes = 1, .cpp = { 2, 0, 0 }, .hsub = 2, .vsub = 1, .is_yuv = true }, 226 226 { .format = DRM_FORMAT_VYUY, .depth = 0, .num_planes = 1, .cpp = { 2, 0, 0 }, .hsub = 2, .vsub = 1, .is_yuv = true }, 227 227 { .format = DRM_FORMAT_AYUV, .depth = 0, .num_planes = 1, .cpp = { 4, 0, 0 }, .hsub = 1, .vsub = 1, .has_alpha = true, .is_yuv = true }, 228 + { .format = DRM_FORMAT_Y0L0, .depth = 0, .num_planes = 1, 229 + .char_per_block = { 8, 0, 0 }, .block_w = { 2, 0, 0 }, .block_h = { 2, 0, 0 }, 230 + .hsub = 2, .vsub = 2, .has_alpha = true, .is_yuv = true }, 231 + { .format = DRM_FORMAT_X0L0, .depth = 0, .num_planes = 1, 232 + .char_per_block = { 8, 0, 0 }, .block_w = { 2, 0, 0 }, .block_h = { 2, 0, 0 }, 233 + .hsub = 2, .vsub = 2, .is_yuv = true }, 234 + { .format = DRM_FORMAT_Y0L2, .depth = 0, .num_planes = 1, 235 + .char_per_block = { 8, 0, 0 }, .block_w = { 2, 0, 0 }, .block_h = { 2, 0, 0 }, 236 + .hsub = 2, .vsub = 2, .has_alpha = true, .is_yuv = true }, 237 + { .format = DRM_FORMAT_X0L2, .depth = 0, .num_planes = 1, 238 + .char_per_block = { 8, 0, 0 }, .block_w = { 2, 0, 0 }, .block_h = { 2, 0, 0 }, 239 + .hsub = 2, .vsub = 2, .is_yuv = true }, 228 240 }; 229 241 230 242 unsigned int i;
+14
include/uapi/drm/drm_fourcc.h
··· 153 153 #define DRM_FORMAT_AYUV fourcc_code('A', 'Y', 'U', 'V') /* [31:0] A:Y:Cb:Cr 8:8:8:8 little endian */ 154 154 155 155 /* 156 + * packed YCbCr420 2x2 tiled formats 157 + * first 64 bits will contain Y,Cb,Cr components for a 2x2 tile 158 + */ 159 + /* [63:0] A3:A2:Y3:0:Cr0:0:Y2:0:A1:A0:Y1:0:Cb0:0:Y0:0 1:1:8:2:8:2:8:2:1:1:8:2:8:2:8:2 little endian */ 160 + #define DRM_FORMAT_Y0L0 fourcc_code('Y', '0', 'L', '0') 161 + /* [63:0] X3:X2:Y3:0:Cr0:0:Y2:0:X1:X0:Y1:0:Cb0:0:Y0:0 1:1:8:2:8:2:8:2:1:1:8:2:8:2:8:2 little endian */ 162 + #define DRM_FORMAT_X0L0 fourcc_code('X', '0', 'L', '0') 163 + 164 + /* [63:0] A3:A2:Y3:Cr0:Y2:A1:A0:Y1:Cb0:Y0 1:1:10:10:10:1:1:10:10:10 little endian */ 165 + #define DRM_FORMAT_Y0L2 fourcc_code('Y', '0', 'L', '2') 166 + /* [63:0] X3:X2:Y3:Cr0:Y2:X1:X0:Y1:Cb0:Y0 1:1:10:10:10:1:1:10:10:10 little endian */ 167 + #define DRM_FORMAT_X0L2 fourcc_code('X', '0', 'L', '2') 168 + 169 + /* 156 170 * 2 plane RGB + A 157 171 * index 0 = RGB plane, same format as the corresponding non _A8 format has 158 172 * index 1 = A plane, [7:0] A