From: Simon Farnsworth <simon.farnsworth@onelan.co.uk>
To: dri-devel@lists.freedesktop.org
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 03/12] drm/edid: Parse the HDMI CEA block and look for 4k modes
Date: Wed, 14 Aug 2013 10:32:51 +0100 [thread overview]
Message-ID: <3743488.ljDhOqH5Y9@f17simon> (raw)
In-Reply-To: <1376435848-14584-4-git-send-email-damien.lespiau@intel.com>
[-- Attachment #1.1: Type: text/plain, Size: 2960 bytes --]
Minor typo - feel free to ignore:
On Wednesday 14 August 2013 00:17:19 Damien Lespiau wrote:
> HDMI 1.4 adds 4 "4k x 2k" modes in the the CEA vendor specific block.
>
> With this commit, we now parse this block and expose the 4k modes that
> we find there.
>
> v2: Fix the "4096x2160" string (nice catch!), add comments about
> do_hdmi_vsdb_modes() arguments and make it clearer that offset is
> relative to the end of the required fields of the HDMI VSDB
> (Ville Syrjälä)
>
> Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
> Tested-by: Cancan Feng <cancan.feng@intel.com>
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=67030
> ---
> drivers/gpu/drm/drm_edid.c | 124 +++++++++++++++++++++++++++++++++++++++------
> 1 file changed, 109 insertions(+), 15 deletions(-)
>
> diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
> index 9e9b6ed..0faa08e 100644
> --- a/drivers/gpu/drm/drm_edid.c
> +++ b/drivers/gpu/drm/drm_edid.c
<snip>
> @@ -2465,6 +2495,68 @@ do_cea_modes(struct drm_connector *connector, const u8 *db, u8 len)
> return modes;
> }
>
> +/*
> + * do_hdmi_vsdb_modes - Parse the HDMI Vendor Specific data block
> + * @connector: connector corresponding to the HDMI sink
> + * @db: start of the CEA vendor specific block
> + * @len: length of the CEA block payload, ie. one can access up to db[len]
> + *
> + * Parses the HDMI VSDB looking for modes to add to @connector.
> + */
> +static int
> +do_hdmi_vsdb_modes(struct drm_connector *connector, const u8 *db, u8 len)
> +{
> + struct drm_device *dev = connector->dev;
> + int modes = 0, offset = 0, i;
> + u8 vic_len;
> +
> + if (len < 8)
> + goto out;
> +
> + /* no HDMI_Video_Present */
> + if (!(db[8] & (1 << 5)))
> + goto out;
> +
> + /* Latency_Fields_Present */
> + if (db[8] & (1 << 7))
> + offset += 2;
> +
> + /* I_Latency_Fields_Present */
> + if (db[8] & (1 << 6))
> + offset += 2;
> +
> + /* the declared length is not long enough for the 2 first bytes
> + * of additional video format capabilities */
> + offset += 2;
> + if (len < (8 + offset))
> + goto out;
> +
> + vic_len = db[8 + offset] >> 5;
> +
> + for (i = 0; i < vic_len && len >= (9 + offset + i); i++) {
> + struct drm_display_mode *newmode;
> + u8 vic;
> +
> + vic = db[9 + offset + i];
> +
> + vic--; /* VICs start at 1 */
> + if (vic >= ARRAY_SIZE(edid_4k_modes)) {
> + DRM_ERROR("Unknow HDMI VIC: %d\n", vic);
^^^^^^
Missing "n" - should be Unknown
> + continue;
> + }
> +
> + newmode = drm_mode_duplicate(dev, &edid_4k_modes[vic]);
> + if (!newmode)
> + continue;
> +
> + drm_mode_probed_add(connector, newmode);
> + modes++;
> + }
> +
> +out:
> + return modes;
> +}
> +
> static int
> cea_db_payload_len(const u8 *db)
> {
<snip>
--
Simon Farnsworth
Software Engineer
ONELAN Ltd
http://www.onelan.com
[-- Attachment #1.2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 490 bytes --]
[-- Attachment #2: Type: text/plain, Size: 159 bytes --]
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel
next prev parent reply other threads:[~2013-08-14 9:32 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-13 23:17 HDMI 4k support v2 Damien Lespiau
2013-08-13 23:17 ` [PATCH 01/12] drm: Don't export drm_find_cea_extension() any more Damien Lespiau
2013-08-13 23:17 ` [PATCH 02/12] drm/edid: Fix add_cea_modes() style issues Damien Lespiau
2013-08-14 10:16 ` Ville Syrjälä
2013-08-13 23:17 ` [PATCH 03/12] drm/edid: Parse the HDMI CEA block and look for 4k modes Damien Lespiau
2013-08-14 9:32 ` Simon Farnsworth [this message]
2013-08-13 23:17 ` [PATCH 04/12] drm: Add support for alternate clocks of " Damien Lespiau
2013-08-14 9:33 ` Simon Farnsworth
2013-08-14 10:18 ` [Intel-gfx] " Ville Syrjälä
2013-08-13 23:17 ` [PATCH 05/12] video/hdmi: Don't let the user of this API create invalid infoframes Damien Lespiau
2013-08-13 23:17 ` [PATCH 06/12] video/hdmi: Derive the bar data valid bit from the bar data fields Damien Lespiau
2013-08-14 10:41 ` Ville Syrjälä
2013-08-13 23:17 ` [PATCH 07/12] video/hdmi: Introduce helpers for the HDMI vendor specific infoframe Damien Lespiau
2013-08-14 10:50 ` Ville Syrjälä
2013-08-14 11:24 ` [Intel-gfx] " Ville Syrjälä
[not found] ` <1376435848-14584-1-git-send-email-damien.lespiau-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2013-08-13 23:17 ` [PATCH 08/12] gpu: host1x: Port the HDMI vendor infoframe code the common helpers Damien Lespiau
[not found] ` <1376435848-14584-9-git-send-email-damien.lespiau-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2013-08-14 11:20 ` Ville Syrjälä
2013-08-13 23:17 ` [PATCH 09/12] drm/edid: Move HDMI_IDENTIFIER to hdmi.h Damien Lespiau
2013-08-13 23:17 ` [PATCH 10/12] video/hdmi: Hook the HDMI vendor infoframe with the generic _pack() Damien Lespiau
2013-08-14 11:14 ` [Intel-gfx] " Ville Syrjälä
2013-08-13 23:17 ` [PATCH 11/12] drm: Add a helper to forge HDMI vendor infoframes Damien Lespiau
2013-08-14 9:42 ` Simon Farnsworth
2013-08-13 23:17 ` [PATCH 12/12] drm/i915/hdmi: Write HDMI vendor specific infoframes Damien Lespiau
2013-08-14 9:43 ` HDMI 4k support v2 Simon Farnsworth
2013-08-14 11:32 ` Ville Syrjälä
-- strict thread matches above, loose matches on Subject: below --
2013-08-14 17:19 HDMI 4k support v3 Damien Lespiau
2013-08-14 17:19 ` [PATCH 03/12] drm/edid: Parse the HDMI CEA block and look for 4k modes Damien Lespiau
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=3743488.ljDhOqH5Y9@f17simon \
--to=simon.farnsworth@onelan.co.uk \
--cc=dri-devel@lists.freedesktop.org \
--cc=intel-gfx@lists.freedesktop.org \
/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