drivers: meida: pisp_be: Rename format align field

Rename the align field in the format structure to opt_align to indicate
the optimal alignment for the format.

There is no functional change in this commit.

Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
This commit is contained in:
Naushir Patuck
2025-08-04 09:02:19 +01:00
committed by Dom Cobley
parent aa97e07d3b
commit 3fd80ed556
2 changed files with 52 additions and 52 deletions

View File

@@ -1076,7 +1076,7 @@ static void pispbe_set_plane_params(struct v4l2_format *f,
unsigned int bpl, plane_size;
bpl = (f->fmt.pix_mp.width * fmt->bit_depth) >> 3;
bpl = ALIGN(max(p->bytesperline, bpl), fmt->align);
bpl = ALIGN(max(p->bytesperline, bpl), fmt->opt_align);
plane_size = bpl * f->fmt.pix_mp.height *
(nplanes > 1 ? fmt->plane_factor[i] : total_plane_factor);

View File

@@ -16,7 +16,7 @@
struct pisp_be_format {
unsigned int fourcc;
unsigned int align;
unsigned int opt_align;
unsigned int bit_depth;
/* 0P3 factor for plane sizing */
unsigned int plane_factor[PISPBE_MAX_PLANES];
@@ -58,7 +58,7 @@ static const struct pisp_be_format supported_formats[] = {
{
.fourcc = V4L2_PIX_FMT_YUV420,
/* 128 alignment to ensure U/V planes are 64 byte aligned. */
.align = 128,
.opt_align = 128,
.bit_depth = 8,
.plane_factor = { P3(1), P3(0.25), P3(0.25) },
.num_planes = 1,
@@ -68,7 +68,7 @@ static const struct pisp_be_format supported_formats[] = {
{
.fourcc = V4L2_PIX_FMT_YVU420,
/* 128 alignment to ensure U/V planes are 64 byte aligned. */
.align = 128,
.opt_align = 128,
.bit_depth = 8,
.plane_factor = { P3(1), P3(0.25), P3(0.25) },
.num_planes = 1,
@@ -77,7 +77,7 @@ static const struct pisp_be_format supported_formats[] = {
},
{
.fourcc = V4L2_PIX_FMT_NV12,
.align = 32,
.opt_align = 32,
.bit_depth = 8,
.plane_factor = { P3(1), P3(0.5) },
.num_planes = 1,
@@ -86,7 +86,7 @@ static const struct pisp_be_format supported_formats[] = {
},
{
.fourcc = V4L2_PIX_FMT_NV21,
.align = 32,
.opt_align = 32,
.bit_depth = 8,
.plane_factor = { P3(1), P3(0.5) },
.num_planes = 1,
@@ -95,7 +95,7 @@ static const struct pisp_be_format supported_formats[] = {
},
{
.fourcc = V4L2_PIX_FMT_YUYV,
.align = 64,
.opt_align = 64,
.bit_depth = 16,
.plane_factor = { P3(1) },
.num_planes = 1,
@@ -104,7 +104,7 @@ static const struct pisp_be_format supported_formats[] = {
},
{
.fourcc = V4L2_PIX_FMT_UYVY,
.align = 64,
.opt_align = 64,
.bit_depth = 16,
.plane_factor = { P3(1) },
.num_planes = 1,
@@ -113,7 +113,7 @@ static const struct pisp_be_format supported_formats[] = {
},
{
.fourcc = V4L2_PIX_FMT_YVYU,
.align = 64,
.opt_align = 64,
.bit_depth = 16,
.plane_factor = { P3(1) },
.num_planes = 1,
@@ -122,7 +122,7 @@ static const struct pisp_be_format supported_formats[] = {
},
{
.fourcc = V4L2_PIX_FMT_VYUY,
.align = 64,
.opt_align = 64,
.bit_depth = 16,
.plane_factor = { P3(1) },
.num_planes = 1,
@@ -132,7 +132,7 @@ static const struct pisp_be_format supported_formats[] = {
{
.fourcc = V4L2_PIX_FMT_YUV422P,
/* 128 alignment to ensure U/V planes are 64 byte aligned. */
.align = 128,
.opt_align = 128,
.bit_depth = 8,
.plane_factor = { P3(1), P3(0.5), P3(0.5) },
.num_planes = 1,
@@ -142,7 +142,7 @@ static const struct pisp_be_format supported_formats[] = {
/* Multiplane YUV formats */
{
.fourcc = V4L2_PIX_FMT_YUV420M,
.align = 64,
.opt_align = 64,
.bit_depth = 8,
.plane_factor = { P3(1), P3(0.25), P3(0.25) },
.num_planes = 3,
@@ -151,7 +151,7 @@ static const struct pisp_be_format supported_formats[] = {
},
{
.fourcc = V4L2_PIX_FMT_NV12M,
.align = 32,
.opt_align = 32,
.bit_depth = 8,
.plane_factor = { P3(1), P3(0.5) },
.num_planes = 2,
@@ -160,7 +160,7 @@ static const struct pisp_be_format supported_formats[] = {
},
{
.fourcc = V4L2_PIX_FMT_NV21M,
.align = 32,
.opt_align = 32,
.bit_depth = 8,
.plane_factor = { P3(1), P3(0.5) },
.num_planes = 2,
@@ -169,7 +169,7 @@ static const struct pisp_be_format supported_formats[] = {
},
{
.fourcc = V4L2_PIX_FMT_YVU420M,
.align = 64,
.opt_align = 64,
.bit_depth = 8,
.plane_factor = { P3(1), P3(0.25), P3(0.25) },
.num_planes = 3,
@@ -178,7 +178,7 @@ static const struct pisp_be_format supported_formats[] = {
},
{
.fourcc = V4L2_PIX_FMT_YUV422M,
.align = 64,
.opt_align = 64,
.bit_depth = 8,
.plane_factor = { P3(1), P3(0.5), P3(0.5) },
.num_planes = 3,
@@ -187,7 +187,7 @@ static const struct pisp_be_format supported_formats[] = {
},
{
.fourcc = V4L2_PIX_FMT_YVU422M,
.align = 64,
.opt_align = 64,
.bit_depth = 8,
.plane_factor = { P3(1), P3(0.5), P3(0.5) },
.num_planes = 3,
@@ -196,7 +196,7 @@ static const struct pisp_be_format supported_formats[] = {
},
{
.fourcc = V4L2_PIX_FMT_YUV444M,
.align = 64,
.opt_align = 64,
.bit_depth = 8,
.plane_factor = { P3(1), P3(1), P3(1) },
.num_planes = 3,
@@ -205,7 +205,7 @@ static const struct pisp_be_format supported_formats[] = {
},
{
.fourcc = V4L2_PIX_FMT_YVU444M,
.align = 64,
.opt_align = 64,
.bit_depth = 8,
.plane_factor = { P3(1), P3(1), P3(1) },
.num_planes = 3,
@@ -215,7 +215,7 @@ static const struct pisp_be_format supported_formats[] = {
/* RGB formats */
{
.fourcc = V4L2_PIX_FMT_RGB24,
.align = 32,
.opt_align = 32,
.bit_depth = 24,
.plane_factor = { P3(1.0) },
.num_planes = 1,
@@ -224,7 +224,7 @@ static const struct pisp_be_format supported_formats[] = {
},
{
.fourcc = V4L2_PIX_FMT_BGR24,
.align = 32,
.opt_align = 32,
.bit_depth = 24,
.plane_factor = { P3(1.0) },
.num_planes = 1,
@@ -233,7 +233,7 @@ static const struct pisp_be_format supported_formats[] = {
},
{
.fourcc = V4L2_PIX_FMT_XBGR32,
.align = 64,
.opt_align = 64,
.bit_depth = 32,
.plane_factor = { P3(1.0) },
.num_planes = 1,
@@ -242,7 +242,7 @@ static const struct pisp_be_format supported_formats[] = {
},
{
.fourcc = V4L2_PIX_FMT_RGBX32,
.align = 64,
.opt_align = 64,
.bit_depth = 32,
.plane_factor = { P3(1.0) },
.num_planes = 1,
@@ -251,7 +251,7 @@ static const struct pisp_be_format supported_formats[] = {
},
{
.fourcc = V4L2_PIX_FMT_RGB48,
.align = 64,
.opt_align = 64,
.bit_depth = 48,
.plane_factor = { P3(1.0) },
.num_planes = 1,
@@ -260,7 +260,7 @@ static const struct pisp_be_format supported_formats[] = {
},
{
.fourcc = V4L2_PIX_FMT_BGR48,
.align = 64,
.opt_align = 64,
.bit_depth = 48,
.plane_factor = { P3(1.0) },
.num_planes = 1,
@@ -271,7 +271,7 @@ static const struct pisp_be_format supported_formats[] = {
{
.fourcc = V4L2_PIX_FMT_SRGGB8,
.bit_depth = 8,
.align = 32,
.opt_align = 32,
.plane_factor = { P3(1.0) },
.num_planes = 1,
.colorspace_mask = V4L2_COLORSPACE_MASK_RAW,
@@ -280,7 +280,7 @@ static const struct pisp_be_format supported_formats[] = {
{
.fourcc = V4L2_PIX_FMT_SBGGR8,
.bit_depth = 8,
.align = 32,
.opt_align = 32,
.plane_factor = { P3(1.0) },
.num_planes = 1,
.colorspace_mask = V4L2_COLORSPACE_MASK_RAW,
@@ -289,7 +289,7 @@ static const struct pisp_be_format supported_formats[] = {
{
.fourcc = V4L2_PIX_FMT_SGRBG8,
.bit_depth = 8,
.align = 32,
.opt_align = 32,
.plane_factor = { P3(1.0) },
.num_planes = 1,
.colorspace_mask = V4L2_COLORSPACE_MASK_RAW,
@@ -298,7 +298,7 @@ static const struct pisp_be_format supported_formats[] = {
{
.fourcc = V4L2_PIX_FMT_SGBRG8,
.bit_depth = 8,
.align = 32,
.opt_align = 32,
.plane_factor = { P3(1.0) },
.num_planes = 1,
.colorspace_mask = V4L2_COLORSPACE_MASK_RAW,
@@ -308,7 +308,7 @@ static const struct pisp_be_format supported_formats[] = {
{
.fourcc = V4L2_PIX_FMT_SRGGB16,
.bit_depth = 16,
.align = 32,
.opt_align = 32,
.plane_factor = { P3(1.0) },
.num_planes = 1,
.colorspace_mask = V4L2_COLORSPACE_MASK_RAW,
@@ -317,7 +317,7 @@ static const struct pisp_be_format supported_formats[] = {
{
.fourcc = V4L2_PIX_FMT_SBGGR16,
.bit_depth = 16,
.align = 32,
.opt_align = 32,
.plane_factor = { P3(1.0) },
.num_planes = 1,
.colorspace_mask = V4L2_COLORSPACE_MASK_RAW,
@@ -326,7 +326,7 @@ static const struct pisp_be_format supported_formats[] = {
{
.fourcc = V4L2_PIX_FMT_SGRBG16,
.bit_depth = 16,
.align = 32,
.opt_align = 32,
.plane_factor = { P3(1.0) },
.num_planes = 1,
.colorspace_mask = V4L2_COLORSPACE_MASK_RAW,
@@ -335,7 +335,7 @@ static const struct pisp_be_format supported_formats[] = {
{
.fourcc = V4L2_PIX_FMT_SGBRG16,
.bit_depth = 16,
.align = 32,
.opt_align = 32,
.plane_factor = { P3(1.0) },
.num_planes = 1,
.colorspace_mask = V4L2_COLORSPACE_MASK_RAW,
@@ -346,7 +346,7 @@ static const struct pisp_be_format supported_formats[] = {
/* 10 bit */
.fourcc = V4L2_PIX_FMT_SRGGB10,
.bit_depth = 16,
.align = 32,
.opt_align = 32,
.plane_factor = { P3(1.0) },
.num_planes = 1,
.colorspace_mask = V4L2_COLORSPACE_MASK_RAW,
@@ -355,7 +355,7 @@ static const struct pisp_be_format supported_formats[] = {
{
.fourcc = V4L2_PIX_FMT_SBGGR10,
.bit_depth = 16,
.align = 32,
.opt_align = 32,
.plane_factor = { P3(1.0) },
.num_planes = 1,
.colorspace_mask = V4L2_COLORSPACE_MASK_RAW,
@@ -364,7 +364,7 @@ static const struct pisp_be_format supported_formats[] = {
{
.fourcc = V4L2_PIX_FMT_SGRBG10,
.bit_depth = 16,
.align = 32,
.opt_align = 32,
.plane_factor = { P3(1.0) },
.num_planes = 1,
.colorspace_mask = V4L2_COLORSPACE_MASK_RAW,
@@ -373,7 +373,7 @@ static const struct pisp_be_format supported_formats[] = {
{
.fourcc = V4L2_PIX_FMT_SGBRG10,
.bit_depth = 16,
.align = 32,
.opt_align = 32,
.plane_factor = { P3(1.0) },
.num_planes = 1,
.colorspace_mask = V4L2_COLORSPACE_MASK_RAW,
@@ -383,7 +383,7 @@ static const struct pisp_be_format supported_formats[] = {
/* 12 bit */
.fourcc = V4L2_PIX_FMT_SRGGB12,
.bit_depth = 16,
.align = 32,
.opt_align = 32,
.plane_factor = { P3(1.0) },
.num_planes = 1,
.colorspace_mask = V4L2_COLORSPACE_MASK_RAW,
@@ -392,7 +392,7 @@ static const struct pisp_be_format supported_formats[] = {
{
.fourcc = V4L2_PIX_FMT_SBGGR12,
.bit_depth = 16,
.align = 32,
.opt_align = 32,
.plane_factor = { P3(1.0) },
.num_planes = 1,
.colorspace_mask = V4L2_COLORSPACE_MASK_RAW,
@@ -401,7 +401,7 @@ static const struct pisp_be_format supported_formats[] = {
{
.fourcc = V4L2_PIX_FMT_SGRBG12,
.bit_depth = 16,
.align = 32,
.opt_align = 32,
.plane_factor = { P3(1.0) },
.num_planes = 1,
.colorspace_mask = V4L2_COLORSPACE_MASK_RAW,
@@ -410,7 +410,7 @@ static const struct pisp_be_format supported_formats[] = {
{
.fourcc = V4L2_PIX_FMT_SGBRG12,
.bit_depth = 16,
.align = 32,
.opt_align = 32,
.plane_factor = { P3(1.0) },
.num_planes = 1,
.colorspace_mask = V4L2_COLORSPACE_MASK_RAW,
@@ -420,7 +420,7 @@ static const struct pisp_be_format supported_formats[] = {
/* 14 bit */
.fourcc = V4L2_PIX_FMT_SRGGB14,
.bit_depth = 16,
.align = 32,
.opt_align = 32,
.plane_factor = { P3(1.0) },
.num_planes = 1,
.colorspace_mask = V4L2_COLORSPACE_MASK_RAW,
@@ -429,7 +429,7 @@ static const struct pisp_be_format supported_formats[] = {
{
.fourcc = V4L2_PIX_FMT_SBGGR14,
.bit_depth = 16,
.align = 32,
.opt_align = 32,
.plane_factor = { P3(1.0) },
.num_planes = 1,
.colorspace_mask = V4L2_COLORSPACE_MASK_RAW,
@@ -438,7 +438,7 @@ static const struct pisp_be_format supported_formats[] = {
{
.fourcc = V4L2_PIX_FMT_SGRBG14,
.bit_depth = 16,
.align = 32,
.opt_align = 32,
.plane_factor = { P3(1.0) },
.num_planes = 1,
.colorspace_mask = V4L2_COLORSPACE_MASK_RAW,
@@ -447,7 +447,7 @@ static const struct pisp_be_format supported_formats[] = {
{
.fourcc = V4L2_PIX_FMT_SGBRG14,
.bit_depth = 16,
.align = 32,
.opt_align = 32,
.plane_factor = { P3(1.0) },
.num_planes = 1,
.colorspace_mask = V4L2_COLORSPACE_MASK_RAW,
@@ -457,7 +457,7 @@ static const struct pisp_be_format supported_formats[] = {
{
.fourcc = V4L2_PIX_FMT_PISP_COMP1_BGGR,
.bit_depth = 8,
.align = 32,
.opt_align = 32,
.plane_factor = { P3(1.0) },
.num_planes = 1,
.colorspace_mask = V4L2_COLORSPACE_MASK_RAW,
@@ -466,7 +466,7 @@ static const struct pisp_be_format supported_formats[] = {
{
.fourcc = V4L2_PIX_FMT_PISP_COMP1_RGGB,
.bit_depth = 8,
.align = 32,
.opt_align = 32,
.plane_factor = { P3(1.0) },
.num_planes = 1,
.colorspace_mask = V4L2_COLORSPACE_MASK_RAW,
@@ -475,7 +475,7 @@ static const struct pisp_be_format supported_formats[] = {
{
.fourcc = V4L2_PIX_FMT_PISP_COMP1_GRBG,
.bit_depth = 8,
.align = 32,
.opt_align = 32,
.plane_factor = { P3(1.0) },
.num_planes = 1,
.colorspace_mask = V4L2_COLORSPACE_MASK_RAW,
@@ -484,7 +484,7 @@ static const struct pisp_be_format supported_formats[] = {
{
.fourcc = V4L2_PIX_FMT_PISP_COMP1_GBRG,
.bit_depth = 8,
.align = 32,
.opt_align = 32,
.plane_factor = { P3(1.0) },
.num_planes = 1,
.colorspace_mask = V4L2_COLORSPACE_MASK_RAW,
@@ -494,7 +494,7 @@ static const struct pisp_be_format supported_formats[] = {
{
.fourcc = V4L2_PIX_FMT_GREY,
.bit_depth = 8,
.align = 32,
.opt_align = 32,
.num_planes = 1,
.colorspace_mask = V4L2_COLORSPACE_MASK_RAW,
.colorspace_default = V4L2_COLORSPACE_RAW,
@@ -502,7 +502,7 @@ static const struct pisp_be_format supported_formats[] = {
{
.fourcc = V4L2_PIX_FMT_Y16,
.bit_depth = 16,
.align = 32,
.opt_align = 32,
.plane_factor = { P3(1.0) },
.num_planes = 1,
.colorspace_mask = V4L2_COLORSPACE_MASK_RAW,
@@ -511,7 +511,7 @@ static const struct pisp_be_format supported_formats[] = {
{
.fourcc = V4L2_PIX_FMT_PISP_COMP1_MONO,
.bit_depth = 8,
.align = 32,
.opt_align = 32,
.plane_factor = { P3(1.0) },
.num_planes = 1,
.colorspace_mask = V4L2_COLORSPACE_MASK_RAW,