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
This commit is contained in:
Родитель
042bf75384
Коммит
697b6b8504
|
@ -225,6 +225,18 @@ const struct drm_format_info *__drm_format_info(u32 format)
|
||||||
{ .format = DRM_FORMAT_UYVY, .depth = 0, .num_planes = 1, .cpp = { 2, 0, 0 }, .hsub = 2, .vsub = 1, .is_yuv = true },
|
{ .format = DRM_FORMAT_UYVY, .depth = 0, .num_planes = 1, .cpp = { 2, 0, 0 }, .hsub = 2, .vsub = 1, .is_yuv = true },
|
||||||
{ .format = DRM_FORMAT_VYUY, .depth = 0, .num_planes = 1, .cpp = { 2, 0, 0 }, .hsub = 2, .vsub = 1, .is_yuv = true },
|
{ .format = DRM_FORMAT_VYUY, .depth = 0, .num_planes = 1, .cpp = { 2, 0, 0 }, .hsub = 2, .vsub = 1, .is_yuv = true },
|
||||||
{ .format = DRM_FORMAT_AYUV, .depth = 0, .num_planes = 1, .cpp = { 4, 0, 0 }, .hsub = 1, .vsub = 1, .has_alpha = true, .is_yuv = true },
|
{ .format = DRM_FORMAT_AYUV, .depth = 0, .num_planes = 1, .cpp = { 4, 0, 0 }, .hsub = 1, .vsub = 1, .has_alpha = true, .is_yuv = true },
|
||||||
|
{ .format = DRM_FORMAT_Y0L0, .depth = 0, .num_planes = 1,
|
||||||
|
.char_per_block = { 8, 0, 0 }, .block_w = { 2, 0, 0 }, .block_h = { 2, 0, 0 },
|
||||||
|
.hsub = 2, .vsub = 2, .has_alpha = true, .is_yuv = true },
|
||||||
|
{ .format = DRM_FORMAT_X0L0, .depth = 0, .num_planes = 1,
|
||||||
|
.char_per_block = { 8, 0, 0 }, .block_w = { 2, 0, 0 }, .block_h = { 2, 0, 0 },
|
||||||
|
.hsub = 2, .vsub = 2, .is_yuv = true },
|
||||||
|
{ .format = DRM_FORMAT_Y0L2, .depth = 0, .num_planes = 1,
|
||||||
|
.char_per_block = { 8, 0, 0 }, .block_w = { 2, 0, 0 }, .block_h = { 2, 0, 0 },
|
||||||
|
.hsub = 2, .vsub = 2, .has_alpha = true, .is_yuv = true },
|
||||||
|
{ .format = DRM_FORMAT_X0L2, .depth = 0, .num_planes = 1,
|
||||||
|
.char_per_block = { 8, 0, 0 }, .block_w = { 2, 0, 0 }, .block_h = { 2, 0, 0 },
|
||||||
|
.hsub = 2, .vsub = 2, .is_yuv = true },
|
||||||
};
|
};
|
||||||
|
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
|
|
|
@ -152,6 +152,20 @@ extern "C" {
|
||||||
|
|
||||||
#define DRM_FORMAT_AYUV fourcc_code('A', 'Y', 'U', 'V') /* [31:0] A:Y:Cb:Cr 8:8:8:8 little endian */
|
#define DRM_FORMAT_AYUV fourcc_code('A', 'Y', 'U', 'V') /* [31:0] A:Y:Cb:Cr 8:8:8:8 little endian */
|
||||||
|
|
||||||
|
/*
|
||||||
|
* packed YCbCr420 2x2 tiled formats
|
||||||
|
* first 64 bits will contain Y,Cb,Cr components for a 2x2 tile
|
||||||
|
*/
|
||||||
|
/* [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 */
|
||||||
|
#define DRM_FORMAT_Y0L0 fourcc_code('Y', '0', 'L', '0')
|
||||||
|
/* [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 */
|
||||||
|
#define DRM_FORMAT_X0L0 fourcc_code('X', '0', 'L', '0')
|
||||||
|
|
||||||
|
/* [63:0] A3:A2:Y3:Cr0:Y2:A1:A0:Y1:Cb0:Y0 1:1:10:10:10:1:1:10:10:10 little endian */
|
||||||
|
#define DRM_FORMAT_Y0L2 fourcc_code('Y', '0', 'L', '2')
|
||||||
|
/* [63:0] X3:X2:Y3:Cr0:Y2:X1:X0:Y1:Cb0:Y0 1:1:10:10:10:1:1:10:10:10 little endian */
|
||||||
|
#define DRM_FORMAT_X0L2 fourcc_code('X', '0', 'L', '2')
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* 2 plane RGB + A
|
* 2 plane RGB + A
|
||||||
* index 0 = RGB plane, same format as the corresponding non _A8 format has
|
* index 0 = RGB plane, same format as the corresponding non _A8 format has
|
||||||
|
|
Загрузка…
Ссылка в новой задаче