From: Hans Verkuil <hverkuil+cisco@kernel.org>
To: Matthew Laux <matthew.laux@gmail.com>,
Mauro Carvalho Chehab <mchehab@kernel.org>,
Mehdi Djait <mehdi.djait@bootlin.com>
Cc: linux-kernel@vger.kernel.org, linux-media@vger.kernel.org
Subject: Re: [PATCH v7 11/12] media: Add subdevice driver for the Mstar MST3367 HDMI receiver
Date: Wed, 25 Nov 2026 14:17:21 +0100 [thread overview]
Message-ID: <7969efe4-40e0-4c1e-b36d-dbb939bb4c64@kernel.org> (raw)
In-Reply-To: <20261121035523.26764-12-matthew.laux@gmail.com>
Hi Matthew,
On 21/11/2026 04:55, Matthew Laux wrote:
> Implement a V4L2 subdevice driver for the MST3367. This was developed
> through reverse engineering the Windows driver, and capturing USB packets.
> The driver supports both HDMI and analog component inputs. YPbPr and RGB
> HDMI sources have been tested. I also added a couple custom DV timings
> for non-interlaced 240p and 288p over component, which are also tested and
> working with this chip.
>
> I tested this with a ThinkPad's video output, MacBook (10-bit deep color),
> Nintendo Switch (both full and limited range) and PS4 720p/1080i/1080p.
Nice work!
There is just one issue with InfoFrames:
>
> Signed-off-by: Matthew Laux <matthew.laux@gmail.com>
> ---
> MAINTAINERS | 7 +
> drivers/media/i2c/Kconfig | 11 +
> drivers/media/i2c/Makefile | 1 +
> drivers/media/i2c/mst3367.c | 1134 +++++++++++++++++++++++++++++++++++
> include/media/i2c/mst3367.h | 27 +
> 5 files changed, 1180 insertions(+)
> create mode 100644 drivers/media/i2c/mst3367.c
> create mode 100644 include/media/i2c/mst3367.h
>
<snip>
> diff --git a/drivers/media/i2c/mst3367.c b/drivers/media/i2c/mst3367.c
> new file mode 100644
> index 000000000000..0d71807a2a5d
> --- /dev/null
> +++ b/drivers/media/i2c/mst3367.c
<snip>
> +/*
> + * Fill @avi from the AVI InfoFrame registers. Returns -ENODATA if no
> + * InfoFrame has been received, e.g. from a DVI source.
> + */
> +static int mst3367_read_avi(struct mst3367 *mst,
> + struct hdmi_avi_infoframe *avi)
> +{
> + u8 pb[5];
> + int k, ret;
> +
> + ret = mst_bank(mst, 0x02);
> + if (ret)
> + return ret;
> +
> + ret = mst3367_read(mst, MST3367_PKT_STATUS);
> + if (ret < 0)
> + return ret;
> + if (!(ret & MST3367_PKT_STATUS_AVI))
> + return -ENODATA;
> +
> + for (k = 0; k < ARRAY_SIZE(pb); k++) {
> + ret = mst3367_read(mst, MST3367_AVI_PB1 + k);
> + if (ret < 0)
> + return ret;
> + pb[k] = ret;
> + }
> +
> + avi->colorspace = (pb[0] >> 5) & 0x3;
> + avi->colorimetry = (pb[1] >> 6) & 0x3;
> + avi->itc = !!(pb[2] & BIT(7));
> + avi->extended_colorimetry = (pb[2] >> 4) & 0x7;
> + avi->quantization_range = (pb[2] >> 2) & 0x3;
> + avi->video_code = pb[3];
> + avi->ycc_quantization_range = (pb[4] >> 6) & 0x3;
> + avi->content_type = (pb[4] >> 4) & 0x3;
> + avi->pixel_repeat = pb[4] & 0xf;
InfoFrame data must also be exported to debugfs. See v4l2_debugfs_if_alloc etc.
in v4l2-dv-timings.h.
It's implemented in most/all HDMI receivers, so you can take a look at how it is
done.
The exported InfoFrame data can be parsed by edid-decode.
> +
> + return 0;
> +}
> +
Regards,
Hans
next prev parent reply other threads:[~2026-11-25 13:17 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-21 3:55 [PATCH v7 00/12] Add driver for StarTech USB3HDCAP capture device Matthew Laux
2026-11-21 3:55 ` [PATCH v7 01/12] media: tw9900: Disable regulator on runtime resume failure Matthew Laux
2026-11-21 3:55 ` [PATCH v7 02/12] media: tw9900: release the device when stopping the stream fails Matthew Laux
2026-11-21 3:55 ` [PATCH v7 03/12] media: tw9900: accept the TW9910 chip ID Matthew Laux
2026-11-21 3:55 ` [PATCH v7 04/12] media: tw9900: add saturation, hue and sharpness controls Matthew Laux
2026-11-21 3:55 ` [PATCH v7 05/12] media: tw9900: program all mode registers in the PAL table Matthew Laux
2026-11-21 3:55 ` [PATCH v7 06/12] media: tw9900: power off the device on remove if still active Matthew Laux
2026-11-21 3:55 ` [PATCH v7 07/12] media: tw9900: power down analog blocks in runtime suspend Matthew Laux
2026-11-21 3:55 ` [PATCH v7 08/12] media: tw9900: use runtime PM autosuspend Matthew Laux
2026-11-21 3:55 ` [PATCH v7 09/12] media: tw9900: allow board-specific register tables via platform data Matthew Laux
2026-11-21 3:55 ` [PATCH v7 10/12] media: tw9900: add S-Video input and progressive source detection Matthew Laux
2026-11-21 3:55 ` [PATCH v7 11/12] media: Add subdevice driver for the Mstar MST3367 HDMI receiver Matthew Laux
2026-11-25 13:17 ` Hans Verkuil [this message]
2026-11-21 3:55 ` [PATCH v7 12/12] media: add driver for StarTech USB3HDCAP Matthew Laux
2026-11-25 13:39 ` Hans Verkuil
2026-11-25 13:41 ` [PATCH v7 00/12] Add driver for StarTech USB3HDCAP capture device Hans Verkuil
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=7969efe4-40e0-4c1e-b36d-dbb939bb4c64@kernel.org \
--to=hverkuil+cisco@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=matthew.laux@gmail.com \
--cc=mchehab@kernel.org \
--cc=mehdi.djait@bootlin.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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®