| From 5048683b3eccf890f74f60e4be0e5889f0d63e2a Mon Sep 17 00:00:00 2001 |
| From: Sasha Levin <sashal@kernel.org> |
| Date: Wed, 30 Apr 2025 09:21:53 +0200 |
| Subject: media: omap3isp: set initial format |
| |
| From: Hans Verkuil <hverkuil+cisco@kernel.org> |
| |
| [ Upstream commit 7575b8dfa91f82fcb34ffd5568ff415ac4685794 ] |
| |
| Initialize the v4l2_format to a default. Empty formats are |
| not allowed in V4L2, so this fixes v4l2-compliance issues: |
| |
| fail: v4l2-test-formats.cpp(514): !pix.width || !pix.height |
| test VIDIOC_G_FMT: FAIL |
| |
| Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org> |
| Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com> |
| Signed-off-by: Sasha Levin <sashal@kernel.org> |
| --- |
| drivers/media/platform/omap3isp/ispvideo.c | 8 ++++++++ |
| 1 file changed, 8 insertions(+) |
| |
| diff --git a/drivers/media/platform/omap3isp/ispvideo.c b/drivers/media/platform/omap3isp/ispvideo.c |
| index f7e1ef11cdc4a..3304457716450 100644 |
| --- a/drivers/media/platform/omap3isp/ispvideo.c |
| +++ b/drivers/media/platform/omap3isp/ispvideo.c |
| @@ -1293,6 +1293,7 @@ static const struct v4l2_ioctl_ops isp_video_ioctl_ops = { |
| static int isp_video_open(struct file *file) |
| { |
| struct isp_video *video = video_drvdata(file); |
| + struct v4l2_mbus_framefmt fmt; |
| struct isp_video_fh *handle; |
| struct vb2_queue *queue; |
| int ret = 0; |
| @@ -1334,6 +1335,13 @@ static int isp_video_open(struct file *file) |
| |
| memset(&handle->format, 0, sizeof(handle->format)); |
| handle->format.type = video->type; |
| + handle->format.fmt.pix.width = 720; |
| + handle->format.fmt.pix.height = 480; |
| + handle->format.fmt.pix.pixelformat = V4L2_PIX_FMT_UYVY; |
| + handle->format.fmt.pix.field = V4L2_FIELD_NONE; |
| + handle->format.fmt.pix.colorspace = V4L2_COLORSPACE_SRGB; |
| + isp_video_pix_to_mbus(&handle->format.fmt.pix, &fmt); |
| + isp_video_mbus_to_pix(video, &fmt, &handle->format.fmt.pix); |
| handle->timeperframe.denominator = 1; |
| |
| handle->video = video; |
| -- |
| 2.51.0 |
| |