Skip to content

Commit

Permalink
drivers: staging: bcm2835-isp: Respect caller's stride value
Browse files Browse the repository at this point in the history
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 <david.plowman@raspberrypi.com>
  • Loading branch information
davidplowman authored and popcornmix committed May 21, 2024
1 parent d4a37d7 commit 55faf2e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions drivers/staging/vc04_services/bcm2835-isp/bcm2835-v4l2-isp.c
Original file line number Diff line number Diff line change
Expand Up @@ -1050,8 +1050,10 @@ static int bcm2835_isp_node_try_fmt(struct file *file, void *priv,
f->fmt.pix.quantization = V4L2_MAP_QUANTIZATION_DEFAULT(is_rgb, f->fmt.pix.colorspace,
f->fmt.pix.ycbcr_enc);

f->fmt.pix.bytesperline = get_bytesperline(f->fmt.pix.width,
fmt);
/* Respect any stride value (suitably aligned) that was requested. */
f->fmt.pix.bytesperline = max(get_bytesperline(f->fmt.pix.width, fmt),
ALIGN(f->fmt.pix.bytesperline,
fmt->bytesperline_align));
f->fmt.pix.field = V4L2_FIELD_NONE;
f->fmt.pix.sizeimage =
get_sizeimage(f->fmt.pix.bytesperline, f->fmt.pix.width,
Expand Down

1 comment on commit 55faf2e

@2konrad
Copy link

@2konrad 2konrad commented on 55faf2e Jun 2, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this update is causing an issue in libcamera buffer allocation.

Please sign in to comment.