media: omap3isp: set initial format

[ Upstream commit 7575b8dfa9 ]

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>
This commit is contained in:
Hans Verkuil
2025-04-30 09:21:53 +02:00
committed by Sasha Levin
parent b78de03a56
commit 39a624a65c
@@ -1288,6 +1288,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;
@@ -1329,6 +1330,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;