* [PATCH 0/3] media: synopsys: hdmirx: pixelclock fix and input status reporting
@ 2026-09-21 7:15 Sascha Hauer
2026-09-21 7:15 ` [PATCH 1/3] media: synopsys: hdmirx: fetch colordepth before calculating pixelclock Sascha Hauer
` (2 more replies)
0 siblings, 3 replies; 7+ messages in thread
From: Sascha Hauer @ 2026-09-21 7:15 UTC (permalink / raw)
To: Dmitry Osipenko, Mauro Carvalho Chehab, Shreeya Patel,
Hans Verkuil, Dingxian Wen
Cc: linux-media, kernel, linux-kernel, Sascha Hauer, Lucas Sinn,
stable, Gerald Loacker
Three changes to the Synopsys HDMI receiver, all found while bringing the
driver up on an RK3588 board.
The first is a fix. hdmirx_get_detected_timings() divides the TMDS clock
by a colordepth that only the format change worker ever fills in, so a
VIDIOC_QUERY_DV_TIMINGS issued in the window between the hardware
reporting lock and that worker running divides by zero and reports a
pixelclock of zero. It reads the colordepth from the hardware at the
point of use now.
The other two belong together. So far the only way for userspace to learn
the cable and lock state was the error code of VIDIOC_QUERY_DV_TIMINGS,
and both of those paths log at v4l2_err level, so an application polling
for a source fills the kernel log. Patch 2 reports the two states through
VIDIOC_ENUMINPUT, where the V4L2 API puts them, and patch 3 then drops
the prints to debug level.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
Gerald Loacker (1):
media: synopsys: hdmirx: add input status reporting to VIDIOC_ENUMINPUT
Lucas Sinn (1):
media: synopsys: hdmirx: fetch colordepth before calculating pixelclock
Sascha Hauer (1):
media: synopsys: hdmirx: stop logging a missing signal at error level
.../media/platform/synopsys/hdmirx/snps_hdmirx.c | 84 ++++++++++++----------
1 file changed, 47 insertions(+), 37 deletions(-)
---
base-commit: bc35965f6940a9bf834d54187b6088b8eb09206d
change-id: 20260904-hdmirx-fixes-edf0ce189f85
Best regards,
--
Sascha Hauer <s.hauer@pengutronix.de>
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 1/3] media: synopsys: hdmirx: fetch colordepth before calculating pixelclock
2026-09-21 7:15 [PATCH 0/3] media: synopsys: hdmirx: pixelclock fix and input status reporting Sascha Hauer
@ 2026-09-21 7:15 ` Sascha Hauer
2026-09-22 12:50 ` Dmitry Osipenko
2026-09-21 7:15 ` [PATCH 2/3] media: synopsys: hdmirx: add input status reporting to VIDIOC_ENUMINPUT Sascha Hauer
2026-09-21 7:15 ` [PATCH 3/3] media: synopsys: hdmirx: stop logging a missing signal at error level Sascha Hauer
2 siblings, 1 reply; 7+ messages in thread
From: Sascha Hauer @ 2026-09-21 7:15 UTC (permalink / raw)
To: Dmitry Osipenko, Mauro Carvalho Chehab, Shreeya Patel,
Hans Verkuil, Dingxian Wen
Cc: linux-media, kernel, linux-kernel, Sascha Hauer, Lucas Sinn, stable
From: Lucas Sinn <lucas.sinn@wolfvision.net>
hdmirx_get_detected_timings() divides the TMDS clock by
hdmirx_dev->color_depth, but nothing on its own path ever sets it. The
only producer is hdmirx_get_colordepth(), reached solely from
hdmirx_format_change() at the tail of hdmirx_wait_signal_lock().
VIDIOC_QUERY_DV_TIMINGS does not come through there. It only refuses to
proceed while signal_not_lock() is true, and that reads the lock state
straight out of the hardware, so it can already be false while the work
ending in hdmirx_format_change() has yet to run. Query the timings in
that window, on the first lock after a boot, and color_depth is still
zero from devm_kzalloc().
The division does not fault. do_div() is plain C on 64 bit and arm64
compiles it to udiv, which returns zero for a zero divisor. What comes
out is a pixelclock of zero, and a stitched output frame.
Read the colordepth where it is used instead.
Assisted-by: Claude:claude-opus-5
Signed-off-by: Lucas Sinn <lucas.sinn@wolfvision.net>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Fixes: 7b59b132ad43 ("media: platform: synopsys: Add support for HDMI input driver")
Cc: stable@vger.kernel.org
---
.../media/platform/synopsys/hdmirx/snps_hdmirx.c | 71 +++++++++++-----------
1 file changed, 36 insertions(+), 35 deletions(-)
diff --git a/drivers/media/platform/synopsys/hdmirx/snps_hdmirx.c b/drivers/media/platform/synopsys/hdmirx/snps_hdmirx.c
index 25f8ca0d6d946..24ec6138a1fb6 100644
--- a/drivers/media/platform/synopsys/hdmirx/snps_hdmirx.c
+++ b/drivers/media/platform/synopsys/hdmirx/snps_hdmirx.c
@@ -156,7 +156,6 @@ struct snps_hdmirx_dev {
int num_clks;
u32 edid_blocks_written;
u32 cur_fmt_fourcc;
- u32 color_depth;
spinlock_t rst_lock; /* to lock register access */
u8 edid[EDID_NUM_BLOCKS_MAX * EDID_BLOCK_SIZE];
};
@@ -380,6 +379,38 @@ static void hdmirx_toggle_polarity(struct snps_hdmirx_dev *hdmirx_dev)
VPROC_HSYNC_POL_OVR_EN, 0);
}
+static u32 hdmirx_get_colordepth(struct snps_hdmirx_dev *hdmirx_dev)
+{
+ struct v4l2_device *v4l2_dev = &hdmirx_dev->v4l2_dev;
+ u32 val, color_depth_reg, color_depth;
+
+ val = hdmirx_readl(hdmirx_dev, DMA_STATUS11);
+ color_depth_reg = (val & HDMIRX_COLOR_DEPTH_MASK) >> 3;
+
+ switch (color_depth_reg) {
+ case 0x4:
+ color_depth = 24;
+ break;
+ case 0x5:
+ color_depth = 30;
+ break;
+ case 0x6:
+ color_depth = 36;
+ break;
+ case 0x7:
+ color_depth = 48;
+ break;
+ default:
+ color_depth = 24;
+ break;
+ }
+
+ v4l2_dbg(1, debug, v4l2_dev, "%s: color_depth: %d, reg_val:%d\n",
+ __func__, color_depth, color_depth_reg);
+
+ return color_depth;
+}
+
/*
* When querying DV timings during preview, if the DMA's timing is stable,
* we retrieve the timings directly from the DMA. However, if the current
@@ -393,7 +424,7 @@ static int hdmirx_get_detected_timings(struct snps_hdmirx_dev *hdmirx_dev,
struct v4l2_bt_timings *bt = &timings->bt;
u32 val, tmdsqpclk_freq, pix_clk;
unsigned int num_retries = 0;
- u32 field_type, deframer_st;
+ u32 field_type, deframer_st, color_depth;
u64 tmp_data, tmds_clk;
bool is_dvi_mode;
int ret;
@@ -414,10 +445,11 @@ static int hdmirx_get_detected_timings(struct snps_hdmirx_dev *hdmirx_dev,
deframer_st = hdmirx_readl(hdmirx_dev, DEFRAMER_STATUS);
is_dvi_mode = !(deframer_st & OPMODE_STS_MASK);
+ color_depth = hdmirx_get_colordepth(hdmirx_dev);
tmdsqpclk_freq = hdmirx_readl(hdmirx_dev, CMU_TMDSQPCLK_FREQ);
tmds_clk = tmdsqpclk_freq * 4 * 1000;
tmp_data = tmds_clk * 24;
- do_div(tmp_data, hdmirx_dev->color_depth);
+ do_div(tmp_data, color_depth);
pix_clk = tmp_data;
bt->pixelclock = pix_clk;
@@ -429,7 +461,7 @@ static int hdmirx_get_detected_timings(struct snps_hdmirx_dev *hdmirx_dev,
v4l2_dbg(2, debug, v4l2_dev, "tmds_clk:%llu, pix_clk:%d\n", tmds_clk, pix_clk);
v4l2_dbg(1, debug, v4l2_dev, "interlace:%d, fmt:%d, color:%d, mode:%s\n",
bt->interlaced, hdmirx_dev->pix_fmt,
- hdmirx_dev->color_depth,
+ color_depth,
is_dvi_mode ? "dvi" : "hdmi");
v4l2_dbg(2, debug, v4l2_dev, "deframer_st:%#x\n", deframer_st);
@@ -988,36 +1020,6 @@ static void hdmirx_controller_init(struct snps_hdmirx_dev *hdmirx_dev)
VS_REMAPFILTER_EN_QST | VS_FILTER_ORDER_QST(0x3));
}
-static void hdmirx_get_colordepth(struct snps_hdmirx_dev *hdmirx_dev)
-{
- struct v4l2_device *v4l2_dev = &hdmirx_dev->v4l2_dev;
- u32 val, color_depth_reg;
-
- val = hdmirx_readl(hdmirx_dev, DMA_STATUS11);
- color_depth_reg = (val & HDMIRX_COLOR_DEPTH_MASK) >> 3;
-
- switch (color_depth_reg) {
- case 0x4:
- hdmirx_dev->color_depth = 24;
- break;
- case 0x5:
- hdmirx_dev->color_depth = 30;
- break;
- case 0x6:
- hdmirx_dev->color_depth = 36;
- break;
- case 0x7:
- hdmirx_dev->color_depth = 48;
- break;
- default:
- hdmirx_dev->color_depth = 24;
- break;
- }
-
- v4l2_dbg(1, debug, v4l2_dev, "%s: color_depth: %d, reg_val:%d\n",
- __func__, hdmirx_dev->color_depth, color_depth_reg);
-}
-
static void hdmirx_get_pix_fmt(struct snps_hdmirx_dev *hdmirx_dev)
{
struct v4l2_device *v4l2_dev = &hdmirx_dev->v4l2_dev;
@@ -1128,7 +1130,6 @@ static void hdmirx_format_change(struct snps_hdmirx_dev *hdmirx_dev)
};
hdmirx_get_pix_fmt(hdmirx_dev);
- hdmirx_get_colordepth(hdmirx_dev);
hdmirx_get_avi_infoframe(hdmirx_dev);
v4l2_dbg(1, debug, v4l2_dev, "%s: queue res_chg_event\n", __func__);
--
2.47.3
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 2/3] media: synopsys: hdmirx: add input status reporting to VIDIOC_ENUMINPUT
2026-09-21 7:15 [PATCH 0/3] media: synopsys: hdmirx: pixelclock fix and input status reporting Sascha Hauer
2026-09-21 7:15 ` [PATCH 1/3] media: synopsys: hdmirx: fetch colordepth before calculating pixelclock Sascha Hauer
@ 2026-09-21 7:15 ` Sascha Hauer
2026-09-22 12:53 ` Dmitry Osipenko
2026-09-21 7:15 ` [PATCH 3/3] media: synopsys: hdmirx: stop logging a missing signal at error level Sascha Hauer
2 siblings, 1 reply; 7+ messages in thread
From: Sascha Hauer @ 2026-09-21 7:15 UTC (permalink / raw)
To: Dmitry Osipenko, Mauro Carvalho Chehab, Shreeya Patel,
Hans Verkuil, Dingxian Wen
Cc: linux-media, kernel, linux-kernel, Sascha Hauer, Gerald Loacker
From: Gerald Loacker <gerald.loacker@wolfvision.net>
Userspace currently has to learn the cable and lock state from the error
VIDIOC_QUERY_DV_TIMINGS returns, -ENOLINK or -ENOLCK. Both of those paths
log at v4l2_err level, so waiting for a cable fills the kernel log.
Report it where it belongs instead: V4L2_IN_ST_NO_POWER while the source
is not driving the connector's +5V line, V4L2_IN_ST_NO_SIGNAL while the
receiver has not locked. Both come from the helpers
hdmirx_query_dv_timings() already uses, so the two cannot disagree.
adv76xx_g_input_status() and adv7842_g_input_status() report the same two
flags the same way.
Signed-off-by: Gerald Loacker <gerald.loacker@wolfvision.net>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
drivers/media/platform/synopsys/hdmirx/snps_hdmirx.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/drivers/media/platform/synopsys/hdmirx/snps_hdmirx.c b/drivers/media/platform/synopsys/hdmirx/snps_hdmirx.c
index 24ec6138a1fb6..75576a9366fd0 100644
--- a/drivers/media/platform/synopsys/hdmirx/snps_hdmirx.c
+++ b/drivers/media/platform/synopsys/hdmirx/snps_hdmirx.c
@@ -1199,6 +1199,9 @@ static void hdmirx_submodule_init(struct snps_hdmirx_dev *hdmirx_dev)
static int hdmirx_enum_input(struct file *file, void *priv,
struct v4l2_input *input)
{
+ struct hdmirx_stream *stream = video_drvdata(file);
+ struct snps_hdmirx_dev *hdmirx_dev = stream->hdmirx_dev;
+
if (input->index > 0)
return -EINVAL;
@@ -1207,6 +1210,12 @@ static int hdmirx_enum_input(struct file *file, void *priv,
strscpy(input->name, "HDMI IN", sizeof(input->name));
input->capabilities = V4L2_IN_CAP_DV_TIMINGS;
+ input->status = 0;
+ if (port_no_link(hdmirx_dev))
+ input->status |= V4L2_IN_ST_NO_POWER;
+ if (signal_not_lock(hdmirx_dev))
+ input->status |= V4L2_IN_ST_NO_SIGNAL;
+
return 0;
}
--
2.47.3
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 3/3] media: synopsys: hdmirx: stop logging a missing signal at error level
2026-09-21 7:15 [PATCH 0/3] media: synopsys: hdmirx: pixelclock fix and input status reporting Sascha Hauer
2026-09-21 7:15 ` [PATCH 1/3] media: synopsys: hdmirx: fetch colordepth before calculating pixelclock Sascha Hauer
2026-09-21 7:15 ` [PATCH 2/3] media: synopsys: hdmirx: add input status reporting to VIDIOC_ENUMINPUT Sascha Hauer
@ 2026-09-21 7:15 ` Sascha Hauer
2026-09-22 12:54 ` Dmitry Osipenko
2 siblings, 1 reply; 7+ messages in thread
From: Sascha Hauer @ 2026-09-21 7:15 UTC (permalink / raw)
To: Dmitry Osipenko, Mauro Carvalho Chehab, Shreeya Patel,
Hans Verkuil, Dingxian Wen
Cc: linux-media, kernel, linux-kernel, Sascha Hauer
hdmirx_query_dv_timings() refuses with -ENOLINK while the source is not
driving the connector's +5V line and with -ENOLCK while the receiver has
not locked, and prints both at v4l2_err level. Neither is a driver error.
They are the two states a receiver sits in whenever nothing is plugged
in, and the way userspace waits for a source is to poll until they clear,
so an application doing the expected thing fills the kernel log.
Both states are now reported through VIDIOC_ENUMINPUT as
V4L2_IN_ST_NO_POWER and V4L2_IN_ST_NO_SIGNAL, from the same two helpers,
so the prints no longer carry anything userspace cannot ask for. Drop
them to v4l2_dbg level 1, where the other non-error outcome of this
function, timings out of range, already is.
Assisted-by: Claude:claude-opus-5
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
drivers/media/platform/synopsys/hdmirx/snps_hdmirx.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/media/platform/synopsys/hdmirx/snps_hdmirx.c b/drivers/media/platform/synopsys/hdmirx/snps_hdmirx.c
index 75576a9366fd0..41f6112ec8123 100644
--- a/drivers/media/platform/synopsys/hdmirx/snps_hdmirx.c
+++ b/drivers/media/platform/synopsys/hdmirx/snps_hdmirx.c
@@ -502,12 +502,12 @@ static int hdmirx_query_dv_timings(struct file *file, void *priv,
int ret;
if (port_no_link(hdmirx_dev)) {
- v4l2_err(v4l2_dev, "%s: port has no link\n", __func__);
+ v4l2_dbg(1, debug, v4l2_dev, "%s: port has no link\n", __func__);
return -ENOLINK;
}
if (signal_not_lock(hdmirx_dev)) {
- v4l2_err(v4l2_dev, "%s: signal is not locked\n", __func__);
+ v4l2_dbg(1, debug, v4l2_dev, "%s: signal is not locked\n", __func__);
return -ENOLCK;
}
--
2.47.3
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 1/3] media: synopsys: hdmirx: fetch colordepth before calculating pixelclock
2026-09-21 7:15 ` [PATCH 1/3] media: synopsys: hdmirx: fetch colordepth before calculating pixelclock Sascha Hauer
@ 2026-09-22 12:50 ` Dmitry Osipenko
0 siblings, 0 replies; 7+ messages in thread
From: Dmitry Osipenko @ 2026-09-22 12:50 UTC (permalink / raw)
To: Sascha Hauer, Mauro Carvalho Chehab, Shreeya Patel, Hans Verkuil,
Dingxian Wen
Cc: linux-media, kernel, linux-kernel, Lucas Sinn, stable
On 9/21/26 10:15, Sascha Hauer wrote:
> From: Lucas Sinn <lucas.sinn@wolfvision.net>
>
> hdmirx_get_detected_timings() divides the TMDS clock by
> hdmirx_dev->color_depth, but nothing on its own path ever sets it. The
> only producer is hdmirx_get_colordepth(), reached solely from
> hdmirx_format_change() at the tail of hdmirx_wait_signal_lock().
>
> VIDIOC_QUERY_DV_TIMINGS does not come through there. It only refuses to
> proceed while signal_not_lock() is true, and that reads the lock state
> straight out of the hardware, so it can already be false while the work
> ending in hdmirx_format_change() has yet to run. Query the timings in
> that window, on the first lock after a boot, and color_depth is still
> zero from devm_kzalloc().
>
> The division does not fault. do_div() is plain C on 64 bit and arm64
> compiles it to udiv, which returns zero for a zero divisor. What comes
> out is a pixelclock of zero, and a stitched output frame.
>
> Read the colordepth where it is used instead.
>
> Assisted-by: Claude:claude-opus-5
> Signed-off-by: Lucas Sinn <lucas.sinn@wolfvision.net>
> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
> Fixes: 7b59b132ad43 ("media: platform: synopsys: Add support for HDMI input driver")
> Cc: stable@vger.kernel.org
> ---
> .../media/platform/synopsys/hdmirx/snps_hdmirx.c | 71 +++++++++++-----------
> 1 file changed, 36 insertions(+), 35 deletions(-)
>
> diff --git a/drivers/media/platform/synopsys/hdmirx/snps_hdmirx.c b/drivers/media/platform/synopsys/hdmirx/snps_hdmirx.c
> index 25f8ca0d6d946..24ec6138a1fb6 100644
> --- a/drivers/media/platform/synopsys/hdmirx/snps_hdmirx.c
> +++ b/drivers/media/platform/synopsys/hdmirx/snps_hdmirx.c
> @@ -156,7 +156,6 @@ struct snps_hdmirx_dev {
> int num_clks;
> u32 edid_blocks_written;
> u32 cur_fmt_fourcc;
> - u32 color_depth;
> spinlock_t rst_lock; /* to lock register access */
> u8 edid[EDID_NUM_BLOCKS_MAX * EDID_BLOCK_SIZE];
> };
> @@ -380,6 +379,38 @@ static void hdmirx_toggle_polarity(struct snps_hdmirx_dev *hdmirx_dev)
> VPROC_HSYNC_POL_OVR_EN, 0);
> }
>
> +static u32 hdmirx_get_colordepth(struct snps_hdmirx_dev *hdmirx_dev)
> +{
> + struct v4l2_device *v4l2_dev = &hdmirx_dev->v4l2_dev;
> + u32 val, color_depth_reg, color_depth;
> +
> + val = hdmirx_readl(hdmirx_dev, DMA_STATUS11);
> + color_depth_reg = (val & HDMIRX_COLOR_DEPTH_MASK) >> 3;
> +
> + switch (color_depth_reg) {
> + case 0x4:
> + color_depth = 24;
> + break;
> + case 0x5:
> + color_depth = 30;
> + break;
> + case 0x6:
> + color_depth = 36;
> + break;
> + case 0x7:
> + color_depth = 48;
> + break;
> + default:
> + color_depth = 24;
> + break;
> + }
> +
> + v4l2_dbg(1, debug, v4l2_dev, "%s: color_depth: %d, reg_val:%d\n",
> + __func__, color_depth, color_depth_reg);
> +
> + return color_depth;
> +}
> +
> /*
> * When querying DV timings during preview, if the DMA's timing is stable,
> * we retrieve the timings directly from the DMA. However, if the current
> @@ -393,7 +424,7 @@ static int hdmirx_get_detected_timings(struct snps_hdmirx_dev *hdmirx_dev,
> struct v4l2_bt_timings *bt = &timings->bt;
> u32 val, tmdsqpclk_freq, pix_clk;
> unsigned int num_retries = 0;
> - u32 field_type, deframer_st;
> + u32 field_type, deframer_st, color_depth;
> u64 tmp_data, tmds_clk;
> bool is_dvi_mode;
> int ret;
> @@ -414,10 +445,11 @@ static int hdmirx_get_detected_timings(struct snps_hdmirx_dev *hdmirx_dev,
> deframer_st = hdmirx_readl(hdmirx_dev, DEFRAMER_STATUS);
> is_dvi_mode = !(deframer_st & OPMODE_STS_MASK);
>
> + color_depth = hdmirx_get_colordepth(hdmirx_dev);
> tmdsqpclk_freq = hdmirx_readl(hdmirx_dev, CMU_TMDSQPCLK_FREQ);
> tmds_clk = tmdsqpclk_freq * 4 * 1000;
> tmp_data = tmds_clk * 24;
> - do_div(tmp_data, hdmirx_dev->color_depth);
> + do_div(tmp_data, color_depth);
> pix_clk = tmp_data;
> bt->pixelclock = pix_clk;
>
> @@ -429,7 +461,7 @@ static int hdmirx_get_detected_timings(struct snps_hdmirx_dev *hdmirx_dev,
> v4l2_dbg(2, debug, v4l2_dev, "tmds_clk:%llu, pix_clk:%d\n", tmds_clk, pix_clk);
> v4l2_dbg(1, debug, v4l2_dev, "interlace:%d, fmt:%d, color:%d, mode:%s\n",
> bt->interlaced, hdmirx_dev->pix_fmt,
> - hdmirx_dev->color_depth,
> + color_depth,
> is_dvi_mode ? "dvi" : "hdmi");
> v4l2_dbg(2, debug, v4l2_dev, "deframer_st:%#x\n", deframer_st);
>
> @@ -988,36 +1020,6 @@ static void hdmirx_controller_init(struct snps_hdmirx_dev *hdmirx_dev)
> VS_REMAPFILTER_EN_QST | VS_FILTER_ORDER_QST(0x3));
> }
>
> -static void hdmirx_get_colordepth(struct snps_hdmirx_dev *hdmirx_dev)
> -{
> - struct v4l2_device *v4l2_dev = &hdmirx_dev->v4l2_dev;
> - u32 val, color_depth_reg;
> -
> - val = hdmirx_readl(hdmirx_dev, DMA_STATUS11);
> - color_depth_reg = (val & HDMIRX_COLOR_DEPTH_MASK) >> 3;
> -
> - switch (color_depth_reg) {
> - case 0x4:
> - hdmirx_dev->color_depth = 24;
> - break;
> - case 0x5:
> - hdmirx_dev->color_depth = 30;
> - break;
> - case 0x6:
> - hdmirx_dev->color_depth = 36;
> - break;
> - case 0x7:
> - hdmirx_dev->color_depth = 48;
> - break;
> - default:
> - hdmirx_dev->color_depth = 24;
> - break;
> - }
> -
> - v4l2_dbg(1, debug, v4l2_dev, "%s: color_depth: %d, reg_val:%d\n",
> - __func__, hdmirx_dev->color_depth, color_depth_reg);
> -}
> -
> static void hdmirx_get_pix_fmt(struct snps_hdmirx_dev *hdmirx_dev)
> {
> struct v4l2_device *v4l2_dev = &hdmirx_dev->v4l2_dev;
> @@ -1128,7 +1130,6 @@ static void hdmirx_format_change(struct snps_hdmirx_dev *hdmirx_dev)
> };
>
> hdmirx_get_pix_fmt(hdmirx_dev);
> - hdmirx_get_colordepth(hdmirx_dev);
> hdmirx_get_avi_infoframe(hdmirx_dev);
>
> v4l2_dbg(1, debug, v4l2_dev, "%s: queue res_chg_event\n", __func__);
>
Reviewed-by: Dmitry Osipenko <dmitry.osipenko@collabora.com>
--
Best regards,
Dmitry
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 2/3] media: synopsys: hdmirx: add input status reporting to VIDIOC_ENUMINPUT
2026-09-21 7:15 ` [PATCH 2/3] media: synopsys: hdmirx: add input status reporting to VIDIOC_ENUMINPUT Sascha Hauer
@ 2026-09-22 12:53 ` Dmitry Osipenko
0 siblings, 0 replies; 7+ messages in thread
From: Dmitry Osipenko @ 2026-09-22 12:53 UTC (permalink / raw)
To: Sascha Hauer, Mauro Carvalho Chehab, Shreeya Patel, Hans Verkuil,
Dingxian Wen
Cc: linux-media, kernel, linux-kernel, Gerald Loacker
On 9/21/26 10:15, Sascha Hauer wrote:
> From: Gerald Loacker <gerald.loacker@wolfvision.net>
>
> Userspace currently has to learn the cable and lock state from the error
> VIDIOC_QUERY_DV_TIMINGS returns, -ENOLINK or -ENOLCK. Both of those paths
> log at v4l2_err level, so waiting for a cable fills the kernel log.
>
> Report it where it belongs instead: V4L2_IN_ST_NO_POWER while the source
> is not driving the connector's +5V line, V4L2_IN_ST_NO_SIGNAL while the
> receiver has not locked. Both come from the helpers
> hdmirx_query_dv_timings() already uses, so the two cannot disagree.
> adv76xx_g_input_status() and adv7842_g_input_status() report the same two
> flags the same way.
>
> Signed-off-by: Gerald Loacker <gerald.loacker@wolfvision.net>
> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
> ---
> drivers/media/platform/synopsys/hdmirx/snps_hdmirx.c | 9 +++++++++
> 1 file changed, 9 insertions(+)
>
> diff --git a/drivers/media/platform/synopsys/hdmirx/snps_hdmirx.c b/drivers/media/platform/synopsys/hdmirx/snps_hdmirx.c
> index 24ec6138a1fb6..75576a9366fd0 100644
> --- a/drivers/media/platform/synopsys/hdmirx/snps_hdmirx.c
> +++ b/drivers/media/platform/synopsys/hdmirx/snps_hdmirx.c
> @@ -1199,6 +1199,9 @@ static void hdmirx_submodule_init(struct snps_hdmirx_dev *hdmirx_dev)
> static int hdmirx_enum_input(struct file *file, void *priv,
> struct v4l2_input *input)
> {
> + struct hdmirx_stream *stream = video_drvdata(file);
> + struct snps_hdmirx_dev *hdmirx_dev = stream->hdmirx_dev;
> +
> if (input->index > 0)
> return -EINVAL;
>
> @@ -1207,6 +1210,12 @@ static int hdmirx_enum_input(struct file *file, void *priv,
> strscpy(input->name, "HDMI IN", sizeof(input->name));
> input->capabilities = V4L2_IN_CAP_DV_TIMINGS;
>
> + input->status = 0;
> + if (port_no_link(hdmirx_dev))
> + input->status |= V4L2_IN_ST_NO_POWER;
> + if (signal_not_lock(hdmirx_dev))
> + input->status |= V4L2_IN_ST_NO_SIGNAL;
> +
> return 0;
> }
>
>
Reviewed-by: Dmitry Osipenko <dmitry.osipenko@collabora.com>
--
Best regards,
Dmitry
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 3/3] media: synopsys: hdmirx: stop logging a missing signal at error level
2026-09-21 7:15 ` [PATCH 3/3] media: synopsys: hdmirx: stop logging a missing signal at error level Sascha Hauer
@ 2026-09-22 12:54 ` Dmitry Osipenko
0 siblings, 0 replies; 7+ messages in thread
From: Dmitry Osipenko @ 2026-09-22 12:54 UTC (permalink / raw)
To: Sascha Hauer, Mauro Carvalho Chehab, Shreeya Patel, Hans Verkuil,
Dingxian Wen
Cc: linux-media, kernel, linux-kernel
On 9/21/26 10:15, Sascha Hauer wrote:
> hdmirx_query_dv_timings() refuses with -ENOLINK while the source is not
> driving the connector's +5V line and with -ENOLCK while the receiver has
> not locked, and prints both at v4l2_err level. Neither is a driver error.
> They are the two states a receiver sits in whenever nothing is plugged
> in, and the way userspace waits for a source is to poll until they clear,
> so an application doing the expected thing fills the kernel log.
>
> Both states are now reported through VIDIOC_ENUMINPUT as
> V4L2_IN_ST_NO_POWER and V4L2_IN_ST_NO_SIGNAL, from the same two helpers,
> so the prints no longer carry anything userspace cannot ask for. Drop
> them to v4l2_dbg level 1, where the other non-error outcome of this
> function, timings out of range, already is.
>
> Assisted-by: Claude:claude-opus-5
> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
> ---
> drivers/media/platform/synopsys/hdmirx/snps_hdmirx.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/media/platform/synopsys/hdmirx/snps_hdmirx.c b/drivers/media/platform/synopsys/hdmirx/snps_hdmirx.c
> index 75576a9366fd0..41f6112ec8123 100644
> --- a/drivers/media/platform/synopsys/hdmirx/snps_hdmirx.c
> +++ b/drivers/media/platform/synopsys/hdmirx/snps_hdmirx.c
> @@ -502,12 +502,12 @@ static int hdmirx_query_dv_timings(struct file *file, void *priv,
> int ret;
>
> if (port_no_link(hdmirx_dev)) {
> - v4l2_err(v4l2_dev, "%s: port has no link\n", __func__);
> + v4l2_dbg(1, debug, v4l2_dev, "%s: port has no link\n", __func__);
> return -ENOLINK;
> }
>
> if (signal_not_lock(hdmirx_dev)) {
> - v4l2_err(v4l2_dev, "%s: signal is not locked\n", __func__);
> + v4l2_dbg(1, debug, v4l2_dev, "%s: signal is not locked\n", __func__);
> return -ENOLCK;
> }
>
>
Reviewed-by: Dmitry Osipenko <dmitry.osipenko@collabora.com>
--
Best regards,
Dmitry
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2026-09-22 12:54 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-21 7:15 [PATCH 0/3] media: synopsys: hdmirx: pixelclock fix and input status reporting Sascha Hauer
2026-09-21 7:15 ` [PATCH 1/3] media: synopsys: hdmirx: fetch colordepth before calculating pixelclock Sascha Hauer
2026-09-22 12:50 ` Dmitry Osipenko
2026-09-21 7:15 ` [PATCH 2/3] media: synopsys: hdmirx: add input status reporting to VIDIOC_ENUMINPUT Sascha Hauer
2026-09-22 12:53 ` Dmitry Osipenko
2026-09-21 7:15 ` [PATCH 3/3] media: synopsys: hdmirx: stop logging a missing signal at error level Sascha Hauer
2026-09-22 12:54 ` Dmitry Osipenko
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®