Skip to content

Commit cb88d82

Browse files
Niklas Söderlundmchehab
authored andcommitted
media: rcar-vin: Fix NV12 size alignment
When doing format validation for NV12 the width and height should be aligned to 32 pixels. Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
1 parent 879c5a4 commit cb88d82

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

drivers/media/platform/renesas/rcar-vin/rcar-dma.c

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1320,9 +1320,15 @@ static int rvin_mc_validate_format(struct rvin_dev *vin, struct v4l2_subdev *sd,
13201320
if (!vin->scaler)
13211321
return -EPIPE;
13221322
} else {
1323-
if (fmt.format.width != vin->format.width ||
1324-
fmt.format.height != vin->format.height)
1325-
return -EPIPE;
1323+
if (vin->format.pixelformat == V4L2_PIX_FMT_NV12) {
1324+
if (ALIGN(fmt.format.width, 32) != vin->format.width ||
1325+
ALIGN(fmt.format.height, 32) != vin->format.height)
1326+
return -EPIPE;
1327+
} else {
1328+
if (fmt.format.width != vin->format.width ||
1329+
fmt.format.height != vin->format.height)
1330+
return -EPIPE;
1331+
}
13261332
}
13271333

13281334
if (fmt.format.code != vin->mbus_code)

0 commit comments

Comments
 (0)