[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20250407155035.3804-1-tumic@gpxsee.org>
Date: Mon, 7 Apr 2025 17:50:35 +0200
From: tumic@...see.org
To: Mauro Carvalho Chehab <mchehab@...nel.org>,
Hans Verkuil <hverkuil@...all.nl>
Cc: linux-media@...r.kernel.org,
linux-kernel@...r.kernel.org,
Martin Tůma <martin.tuma@...iteqautomotive.com>
Subject: [PATCH] media: mgb4: Fix resolution change events triggering
From: Martin Tůma <martin.tuma@...iteqautomotive.com>
Always generate the resolution change event when the HW reports it and only
discard the streaming termination in case the new resolution is the same as
the old one. The old logic prevented events on
"no signal" -> "valid resolution" transitions as VIDIOC_QUERY_DV_TIMINGS
never updates the timings when there is no signal present.
Signed-off-by: Martin Tůma <martin.tuma@...iteqautomotive.com>
---
drivers/media/pci/mgb4/mgb4_vin.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/drivers/media/pci/mgb4/mgb4_vin.c b/drivers/media/pci/mgb4/mgb4_vin.c
index 434eaf0440e2..6e806e075837 100644
--- a/drivers/media/pci/mgb4/mgb4_vin.c
+++ b/drivers/media/pci/mgb4/mgb4_vin.c
@@ -749,14 +749,14 @@ static void signal_change(struct work_struct *work)
u32 width = resolution >> 16;
u32 height = resolution & 0xFFFF;
- if (timings->width != width || timings->height != height) {
- static const struct v4l2_event ev = {
- .type = V4L2_EVENT_SOURCE_CHANGE,
- .u.src_change.changes = V4L2_EVENT_SRC_CH_RESOLUTION,
- };
+ static const struct v4l2_event ev = {
+ .type = V4L2_EVENT_SOURCE_CHANGE,
+ .u.src_change.changes = V4L2_EVENT_SRC_CH_RESOLUTION,
+ };
- v4l2_event_queue(&vindev->vdev, &ev);
+ v4l2_event_queue(&vindev->vdev, &ev);
+ if (timings->width != width || timings->height != height) {
if (vb2_is_streaming(&vindev->queue))
vb2_queue_error(&vindev->queue);
}
base-commit: 0af2f6be1b4281385b618cb86ad946eded089ac8
--
2.48.1
Powered by blists - more mailing lists