From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Hans Verkuil <hverkuil@xs4all.nl>
Cc: linux-media@vger.kernel.org, dri-devel@lists.freedesktop.org,
Daniel Vetter <daniel.vetter@ffwll.ch>,
Thierry Reding <thierry.reding@gmail.com>,
Hans Verkuil <hansverk@cisco.com>
Subject: Re: [PATCH 1/2] drivers/video/hdmi: allow for larger-than-needed vendor IF
Date: Mon, 20 Nov 2017 16:51:54 +0200 [thread overview]
Message-ID: <20171120145154.GW10981@intel.com> (raw)
In-Reply-To: <20171120134129.26161-2-hverkuil@xs4all.nl>
On Mon, Nov 20, 2017 at 02:41:28PM +0100, Hans Verkuil wrote:
> From: Hans Verkuil <hansverk@cisco.com>
>
> Some devices (Windows Intel driver!) send a Vendor InfoFrame that
> uses a payload length of 0x1b instead of the length of 5 or 6
> that the unpack code expects. The InfoFrame is padded with 0 by
> the source.
So it doesn't put any 3D_Metadata stuff in there? We don't see to
have code to parse/generate any of that.
Sadly the spec doesn't seem to forbid sending an overly long infoframe
as long it's padded with 0. Would have been nicer for extending it if
that sort of thing was forbidden. But I guess everything can be solved
with flags. Not that I expect anyone to extend it anymore now that
HDMI 2.0 has specified a totally new infoframe.
>
> The current code thinks anything other than 5 or 6 is an error,
> but larger values are allowed by the specification. So support
> that here as well.
>
> Signed-off-by: Hans Verkuil <hansverk@cisco.com>
> ---
> drivers/video/hdmi.c | 3 +--
> include/linux/hdmi.h | 1 +
> 2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/video/hdmi.c b/drivers/video/hdmi.c
> index 1cf907ecded4..61f803f75a47 100644
> --- a/drivers/video/hdmi.c
> +++ b/drivers/video/hdmi.c
> @@ -1164,8 +1164,7 @@ hdmi_vendor_any_infoframe_unpack(union hdmi_vendor_any_infoframe *frame,
> struct hdmi_vendor_infoframe *hvf = &frame->hdmi;
>
> if (ptr[0] != HDMI_INFOFRAME_TYPE_VENDOR ||
> - ptr[1] != 1 ||
> - (ptr[2] != 5 && ptr[2] != 6))
> + ptr[1] != 1 || ptr[2] < 5 || ptr[2] > HDMI_VENDOR_INFOFRAME_SIZE)
> return -EINVAL;
>
> length = ptr[2];
> diff --git a/include/linux/hdmi.h b/include/linux/hdmi.h
> index d271ff23984f..14d3531a0eda 100644
> --- a/include/linux/hdmi.h
> +++ b/include/linux/hdmi.h
> @@ -40,6 +40,7 @@ enum hdmi_infoframe_type {
> #define HDMI_AVI_INFOFRAME_SIZE 13
> #define HDMI_SPD_INFOFRAME_SIZE 25
> #define HDMI_AUDIO_INFOFRAME_SIZE 10
> +#define HDMI_VENDOR_INFOFRAME_SIZE 31
>
> #define HDMI_INFOFRAME_SIZE(type) \
> (HDMI_INFOFRAME_HEADER_SIZE + HDMI_ ## type ## _INFOFRAME_SIZE)
> --
> 2.14.1
--
Ville Syrjälä
Intel OTC
next prev parent reply other threads:[~2017-11-20 14:52 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-20 13:41 [PATCH 0/2] video/hdmi: two fixes Hans Verkuil
2017-11-20 13:41 ` [PATCH 1/2] drivers/video/hdmi: allow for larger-than-needed vendor IF Hans Verkuil
2017-11-20 14:51 ` Ville Syrjälä [this message]
2017-11-20 15:02 ` Hans Verkuil
2017-11-21 15:27 ` Ville Syrjälä
2017-11-23 11:57 ` Hans Verkuil
2017-11-20 13:41 ` [PATCH 2/2] hdmi: audio infoframe log: corrected channel count 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=20171120145154.GW10981@intel.com \
--to=ville.syrjala@linux.intel.com \
--cc=daniel.vetter@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=hansverk@cisco.com \
--cc=hverkuil@xs4all.nl \
--cc=linux-media@vger.kernel.org \
--cc=thierry.reding@gmail.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