public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@intel.com>
To: intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org
Cc: jani.nikula@intel.com
Subject: [PATCH 1/2] drm/edid: abstract override/firmware EDID retrieval
Date: Fri,  7 Jun 2019 14:05:12 +0300	[thread overview]
Message-ID: <20190607110513.12072-1-jani.nikula@intel.com> (raw)

Abstract the debugfs override and the firmware EDID retrieval
function. We'll be needing it in the follow-up. No functional changes.

Cc: Daniel Vetter <daniel@ffwll.ch>
Cc: Harish Chegondi <harish.chegondi@intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
 drivers/gpu/drm/drm_edid.c | 25 +++++++++++++++++--------
 1 file changed, 17 insertions(+), 8 deletions(-)

diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
index c3296a72fff9..c59a1e8c5ada 100644
--- a/drivers/gpu/drm/drm_edid.c
+++ b/drivers/gpu/drm/drm_edid.c
@@ -1573,6 +1573,20 @@ static void connector_bad_edid(struct drm_connector *connector,
 	}
 }
 
+/* Get override or firmware EDID */
+static struct edid *drm_get_override_edid(struct drm_connector *connector)
+{
+	struct edid *override = NULL;
+
+	if (connector->override_edid)
+		override = drm_edid_duplicate(connector->edid_blob_ptr->data);
+
+	if (!override)
+		override = drm_load_edid_firmware(connector);
+
+	return IS_ERR(override) ? NULL : override;
+}
+
 /**
  * drm_do_get_edid - get EDID data using a custom EDID block read function
  * @connector: connector we're probing
@@ -1600,15 +1614,10 @@ struct edid *drm_do_get_edid(struct drm_connector *connector,
 {
 	int i, j = 0, valid_extensions = 0;
 	u8 *edid, *new;
-	struct edid *override = NULL;
-
-	if (connector->override_edid)
-		override = drm_edid_duplicate(connector->edid_blob_ptr->data);
-
-	if (!override)
-		override = drm_load_edid_firmware(connector);
+	struct edid *override;
 
-	if (!IS_ERR_OR_NULL(override))
+	override = drm_get_override_edid(connector);
+	if (override)
 		return override;
 
 	if ((edid = kmalloc(EDID_LENGTH, GFP_KERNEL)) == NULL)
-- 
2.20.1

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

             reply	other threads:[~2019-06-07 11:05 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-07 11:05 Jani Nikula [this message]
2019-06-07 11:05 ` [PATCH 2/2] drm: add fallback override/firmware EDID modes workaround Jani Nikula
2019-06-07 15:10   ` Daniel Vetter
2019-06-08  1:06     ` Paul Wise
2019-06-08  5:10     ` Paul Wise
2019-06-08  5:48       ` Paul Wise
2019-06-10  9:32         ` Jani Nikula
2019-06-11  8:28           ` Paul Wise
2019-06-08 15:40       ` Paul Wise
2019-06-10  9:30   ` [PATCH v2] " Jani Nikula
2019-06-11  8:27     ` Paul Wise
2019-06-12 10:53       ` Jani Nikula
2019-06-07 11:48 ` ✗ Fi.CI.CHECKPATCH: warning for series starting with [1/2] drm/edid: abstract override/firmware EDID retrieval Patchwork
2019-06-07 12:08 ` ✓ Fi.CI.BAT: success " Patchwork
2019-06-09 22:57 ` ✗ Fi.CI.IGT: failure " Patchwork
2019-06-10 12:31 ` ✗ Fi.CI.CHECKPATCH: warning for series starting with [1/2] drm/edid: abstract override/firmware EDID retrieval (rev2) Patchwork
2019-06-10 12:53 ` ✓ Fi.CI.BAT: success " Patchwork
2019-06-11  6:26 ` ✓ Fi.CI.IGT: " 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=20190607110513.12072-1-jani.nikula@intel.com \
    --to=jani.nikula@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