All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ville Syrjala <ville.syrjala@linux.intel.com>
To: dri-devel@lists.freedesktop.org
Cc: intel-gfx@lists.freedesktop.org, Jean Delvare <jdelvare@suse.de>
Subject: [PATCH 1/2] drm/edid: Don't look for CEA data blocks in CEA ext block rev < 3
Date: Mon,  2 Sep 2019 16:15:45 +0300	[thread overview]
Message-ID: <20190902131546.4691-1-ville.syrjala@linux.intel.com> (raw)

From: Ville Syrjälä <ville.syrjala@linux.intel.com>

CEA ext block revisions 1 and 2 do not contain the data block
collection. Instead that section of the extension block is
marked as reserved for 8 byte timing descriptors. Revision 3
changed it to contain the CEA data block collection instead.

Most places that iterate the data blocks already check for
revision >= 3, but drm_detect_hdmi_monitor() and
drm_detect_monitor_audio() do not. So in theory when encountering
rev 1 or 2 CEA extension block they could end up misinterpreting
whatever data is in the reserved section as CEA data blocks.

Let's have cea_db_offsets() do the revision check so that the
callers don't even have worry about it.

Cc: Jean Delvare <jdelvare@suse.de>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 drivers/gpu/drm/drm_edid.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
index 82a4ceed3fcf..7b3072fc550b 100644
--- a/drivers/gpu/drm/drm_edid.c
+++ b/drivers/gpu/drm/drm_edid.c
@@ -3690,6 +3690,9 @@ cea_revision(const u8 *cea)
 static int
 cea_db_offsets(const u8 *cea, int *start, int *end)
 {
+	if (cea_revision(cea) < 3)
+		return -ENOTSUPP;
+
 	/* DisplayID CTA extension blocks and top-level CEA EDID
 	 * block header definitions differ in the following bytes:
 	 *   1) Byte 2 of the header specifies length differently,
-- 
2.21.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

             reply	other threads:[~2019-09-02 13:15 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-02 13:15 Ville Syrjala [this message]
2019-09-02 13:15 ` [PATCH 2/2] drm/edid: Have cea_db_offsets() zero start/end when the data block collection isn't found Ville Syrjala
2019-09-10  9:46   ` Jean Delvare
2019-09-10  9:48     ` Ville Syrjälä
2019-09-10 10:08       ` Jean Delvare
2019-09-02 14:42 ` ✓ Fi.CI.BAT: success for series starting with [1/2] drm/edid: Don't look for CEA data blocks in CEA ext block rev < 3 Patchwork
2019-09-02 16:02 ` ✓ Fi.CI.IGT: " Patchwork
2019-09-10  9:40 ` [PATCH 1/2] " Jean Delvare

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=20190902131546.4691-1-ville.syrjala@linux.intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=jdelvare@suse.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.