Skip to content

Commit ea6a92e

Browse files
committed
media: pisp_be: Add support for the NV12MT_10_COL128 format
The 10bit column format from the HEVC codec is supported by the PISP BE, so add the configuration. It requires some additional handling as it packs 3 10bit samples into 32 bits, with 2 bits of padding. Alignment and calculating strides is therefore not quite as straightforward. Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
1 parent 6990e25 commit ea6a92e

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

drivers/media/platform/raspberrypi/pisp_be/pisp_be.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1103,8 +1103,9 @@ static void pispbe_set_plane_params(struct v4l2_format *f,
11031103
*/
11041104
const unsigned int align =
11051105
p->bytesperline ? fmt->min_align : fmt->opt_align;
1106+
unsigned int pixel_grouping = fmt->pixel_grouping ?: 1;
11061107

1107-
bpl = (f->fmt.pix_mp.width * fmt->bit_depth) >> 3;
1108+
bpl = ((f->fmt.pix_mp.width / pixel_grouping) * fmt->bit_depth) >> 3;
11081109
bpl = ALIGN(max(p->bytesperline, bpl), align);
11091110

11101111
plane_size = bpl * f->fmt.pix_mp.height *

drivers/media/platform/raspberrypi/pisp_be/pisp_be_formats.h

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ struct pisp_be_format {
1919
unsigned int opt_align;
2020
unsigned int min_align;
2121
unsigned int bit_depth;
22+
unsigned int pixel_grouping;
2223
/* 0P3 factor for plane sizing */
2324
unsigned int plane_factor[PISPBE_MAX_PLANES];
2425
unsigned int num_planes;
@@ -240,6 +241,18 @@ static const struct pisp_be_format supported_formats[] = {
240241
.colorspace_mask = V4L2_COLORSPACE_MASK_ALL_SRGB,
241242
.colorspace_default = V4L2_COLORSPACE_SMPTE170M,
242243
},
244+
{
245+
.fourcc = V4L2_PIX_FMT_NV12MT_10_COL128,
246+
.opt_align = 128,
247+
.min_align = 128,
248+
/* 3 pixels packed into 32bits */
249+
.bit_depth = 32,
250+
.pixel_grouping = 3,
251+
.plane_factor = { P3(1), P3(0.5) },
252+
.num_planes = 2,
253+
.colorspace_mask = V4L2_COLORSPACE_MASK_ALL_SRGB,
254+
.colorspace_default = V4L2_COLORSPACE_SMPTE170M,
255+
},
243256
/* RGB formats */
244257
{
245258
.fourcc = V4L2_PIX_FMT_RGB24,

0 commit comments

Comments
 (0)