intel-gfx.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Marius Vlad <marius.c.vlad@intel.com>
To: dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org
Subject: [PATCH] drm: Add support for EDID injection.
Date: Wed, 23 Mar 2016 19:06:37 +0200	[thread overview]
Message-ID: <1458752797-18746-1-git-send-email-marius.c.vlad@intel.com> (raw)

Allow the possibility to return an copy of the injected EDID when the connector
has been forced and an EDID has been specified over the debugfs interface.

Signed-off-by: Marius Vlad <marius.c.vlad@intel.com>
---
 drivers/gpu/drm/drm_edid.c | 23 ++++++++++++++++++++---
 1 file changed, 20 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
index 414d7f6..239f9b1 100644
--- a/drivers/gpu/drm/drm_edid.c
+++ b/drivers/gpu/drm/drm_edid.c
@@ -1075,6 +1075,19 @@ static bool drm_edid_is_zero(const u8 *in_edid, int length)
 	return true;
 }
 
+static struct edid *
+drm_do_get_override_edid(struct drm_connector *connector)
+{
+	struct edid *edid = NULL;
+
+	if (connector->override_edid && connector->edid_blob_ptr->data) {
+		edid = kmemdup(connector->edid_blob_ptr->data,
+			       connector->edid_blob_ptr->length, GFP_KERNEL);
+	}
+
+	return edid;
+}
+
 /**
  * drm_edid_block_valid - Sanity check the EDID block (base or extension)
  * @raw_edid: pointer to raw EDID block
@@ -1385,10 +1398,14 @@ struct edid *drm_get_edid(struct drm_connector *connector,
 {
 	struct edid *edid;
 
-	if (!drm_probe_ddc(adapter))
-		return NULL;
+	if (!connector->override_edid) {
+		if (!drm_probe_ddc(adapter))
+			return NULL;
+		edid = drm_do_get_edid(connector, drm_do_probe_ddc_edid, adapter);
+	} else {
+		edid = drm_do_get_override_edid(connector);
+	}
 
-	edid = drm_do_get_edid(connector, drm_do_probe_ddc_edid, adapter);
 	if (edid)
 		drm_get_displayid(connector, edid);
 	return edid;
-- 
2.5.0

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

             reply	other threads:[~2016-03-23 17:06 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-23 17:06 Marius Vlad [this message]
2016-03-24  8:02 ` ✗ Fi.CI.BAT: warning for drm: Add support for EDID injection Patchwork

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=1458752797-18746-1-git-send-email-marius.c.vlad@intel.com \
    --to=marius.c.vlad@intel.com \
    --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;
as well as URLs for NNTP newsgroup(s).