Skip to content

Commit 728c15b

Browse files
Kwiboommind
authored andcommitted
drm/fourcc: Add NV20 and NV30 YUV formats
DRM_FORMAT_NV20 and DRM_FORMAT_NV30 formats is the 2x1 and non-subsampled variant of NV15, a 10-bit 2-plane YUV format that has no padding between components. Instead, luminance and chrominance samples are grouped into 4s so that each group is packed into an integer number of bytes: YYYY = UVUV = 4 * 10 bits = 40 bits = 5 bytes The '20' and '30' suffix refers to the optimum effective bits per pixel which is achieved when the total number of luminance samples is a multiple of 4. V2: Added NV30 format Signed-off-by: Jonas Karlman <[email protected]> Reviewed-by: Sandy Huang <[email protected]> Reviewed-by: Christopher Obbard <[email protected]> Tested-by: Christopher Obbard <[email protected]> Signed-off-by: Heiko Stuebner <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent 215737e commit 728c15b

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

drivers/gpu/drm/drm_fourcc.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -299,6 +299,14 @@ const struct drm_format_info *__drm_format_info(u32 format)
299299
.num_planes = 2, .char_per_block = { 5, 5, 0 },
300300
.block_w = { 4, 2, 0 }, .block_h = { 1, 1, 0 }, .hsub = 2,
301301
.vsub = 2, .is_yuv = true },
302+
{ .format = DRM_FORMAT_NV20, .depth = 0,
303+
.num_planes = 2, .char_per_block = { 5, 5, 0 },
304+
.block_w = { 4, 2, 0 }, .block_h = { 1, 1, 0 }, .hsub = 2,
305+
.vsub = 1, .is_yuv = true },
306+
{ .format = DRM_FORMAT_NV30, .depth = 0,
307+
.num_planes = 2, .char_per_block = { 5, 5, 0 },
308+
.block_w = { 4, 2, 0 }, .block_h = { 1, 1, 0 }, .hsub = 1,
309+
.vsub = 1, .is_yuv = true },
302310
{ .format = DRM_FORMAT_Q410, .depth = 0,
303311
.num_planes = 3, .char_per_block = { 2, 2, 2 },
304312
.block_w = { 1, 1, 1 }, .block_h = { 1, 1, 1 }, .hsub = 1,

include/uapi/drm/drm_fourcc.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,8 @@ extern "C" {
323323
* index 1 = Cr:Cb plane, [39:0] Cr1:Cb1:Cr0:Cb0 little endian
324324
*/
325325
#define DRM_FORMAT_NV15 fourcc_code('N', 'V', '1', '5') /* 2x2 subsampled Cr:Cb plane */
326+
#define DRM_FORMAT_NV20 fourcc_code('N', 'V', '2', '0') /* 2x1 subsampled Cr:Cb plane */
327+
#define DRM_FORMAT_NV30 fourcc_code('N', 'V', '3', '0') /* non-subsampled Cr:Cb plane */
326328

327329
/*
328330
* 2 plane YCbCr MSB aligned

0 commit comments

Comments
 (0)