]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
media: omap3isp: set initial format
authorHans Verkuil <hverkuil+cisco@kernel.org>
Wed, 30 Apr 2025 07:21:53 +0000 (09:21 +0200)
committerHans Verkuil <hverkuil+cisco@kernel.org>
Tue, 6 Jan 2026 07:22:46 +0000 (08:22 +0100)
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>
drivers/media/platform/ti/omap3isp/ispvideo.c

index 5ce8736ca5bd09f2b7a922c3f3c2a46dd86c6371..c52312b395985228db117c61b84b8dd02fedd30b 100644 (file)
@@ -1319,6 +1319,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;
@@ -1361,6 +1362,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;