Skip to content

Commit 03723b9

Browse files
committed
media: atomisp: report the visible resolution
The atomisp sensors and logic adds an extra pad lines/columns, called "dvs envelope". It also uses an extra 12 lines/columns at the sensor for BYT. As those are not visible to userspace, the V4L2 API should decrement such values when reporting the current resolution. Signed-off-by: Mauro Carvalho Chehab <[email protected]>
1 parent 5380c4c commit 03723b9

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

drivers/staging/media/atomisp/pci/atomisp_ioctl.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -876,6 +876,20 @@ static int atomisp_g_fmt_cap(struct file *file, void *fh,
876876
v4l2_fill_pix_format(&f->fmt.pix, &fmt.format);
877877

878878
f->fmt.pix.pixelformat = fmtdesc.pixelformat;
879+
880+
/*
881+
* HACK: The atomisp does something different here, as it
882+
* seems to set the sensor to a slightly higher resolution than
883+
* the visible ones. That seems to be needed by atomisp's ISP
884+
* in order to properly handle the frames. So, s_fmt adds 16
885+
* extra columns/lines. See atomisp_subdev_set_selection().
886+
*
887+
* Yet, the V4L2 userspace API doesn't expect those, so it
888+
* needs to be decremented when reporting the visible
889+
* resolution to userspace.
890+
*/
891+
f->fmt.pix.width -= pad_w;
892+
f->fmt.pix.height -= pad_h;
879893
}
880894

881895
depth = atomisp_get_pixel_depth(f->fmt.pix.pixelformat);

0 commit comments

Comments
 (0)