Skip to content

Commit 55faf2e

Browse files
davidplowmanpopcornmix
authored andcommitted
drivers: staging: bcm2835-isp: Respect caller's stride value
The stride value reported for output image buffers should be at least as large as any value that was passed in by the caller (subject to correct alignment for the pixel format). If the value is zero (meaning no value was passed), or is too small, the minimum acceptable value will be substituted. Signed-off-by: David Plowman <[email protected]>
1 parent d4a37d7 commit 55faf2e

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

drivers/staging/vc04_services/bcm2835-isp/bcm2835-v4l2-isp.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1050,8 +1050,10 @@ static int bcm2835_isp_node_try_fmt(struct file *file, void *priv,
10501050
f->fmt.pix.quantization = V4L2_MAP_QUANTIZATION_DEFAULT(is_rgb, f->fmt.pix.colorspace,
10511051
f->fmt.pix.ycbcr_enc);
10521052

1053-
f->fmt.pix.bytesperline = get_bytesperline(f->fmt.pix.width,
1054-
fmt);
1053+
/* Respect any stride value (suitably aligned) that was requested. */
1054+
f->fmt.pix.bytesperline = max(get_bytesperline(f->fmt.pix.width, fmt),
1055+
ALIGN(f->fmt.pix.bytesperline,
1056+
fmt->bytesperline_align));
10551057
f->fmt.pix.field = V4L2_FIELD_NONE;
10561058
f->fmt.pix.sizeimage =
10571059
get_sizeimage(f->fmt.pix.bytesperline, f->fmt.pix.width,

0 commit comments

Comments
 (0)