public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Ramkumar Ramachandra <artagnon@gmail.com>
To: LKML <linux-kernel@vger.kernel.org>
Cc: Andreas Heider <andreas@meetr.de>,
	Seth Forshee <seth.forshee@canonical.com>
Subject: [PATCH 3/4] drm/i915: prepare intel_lvds_get_edid() for multiple calls
Date: Tue,  7 Jan 2014 15:28:42 +0530	[thread overview]
Message-ID: <1389088723-30959-4-git-send-email-artagnon@gmail.com> (raw)
In-Reply-To: <1389088723-30959-1-git-send-email-artagnon@gmail.com>

intel_lvds_get_edid() needs to be called when switching GPUs, but it
currently assumes that it will only be called once and that there's
always an LVDS connector present when it's called. Fix this assumptions.

Cc: Andreas Heider <andreas@meetr.de>
Cc: Seth Forshee <seth.forshee@canonical.com>
Original-patch-by: Seth Forshee <seth.forshee@canonical.com>
Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
---
 drivers/gpu/drm/i915/intel_lvds.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/intel_lvds.c b/drivers/gpu/drm/i915/intel_lvds.c
index 6c09617..8275551 100644
--- a/drivers/gpu/drm/i915/intel_lvds.c
+++ b/drivers/gpu/drm/i915/intel_lvds.c
@@ -927,10 +927,18 @@ static bool intel_lvds_get_edid(struct drm_device *dev)
 	struct edid *edid;
 	struct drm_i915_private *dev_priv = dev->dev_private;
 	struct drm_connector *connector = dev_priv->int_lvds_connector;
-	struct intel_lvds_connector *lvds_connector = to_lvds_connector(connector);
+	struct intel_lvds_connector *lvds_connector;
 	struct drm_display_mode *scan; /* *modes, *bios_mode; */
 	struct drm_display_mode *fixed_mode = NULL;
 
+	if (!connector)
+		return false;
+	lvds_connector = to_lvds_connector(connector);
+
+	/* If we already have an EDID, no need to check again */
+	if (lvds_connector->base.edid)
+		return true;
+
 	/*
 	 * Attempt to get the fixed panel mode from DDC.  Assume that the
 	 * preferred mode is the right one.
-- 
1.8.5.2.229.g4448466


  parent reply	other threads:[~2014-01-07  9:58 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-07  9:58 [PATCH 0/4] Get EDID late for VGA switcheroo Ramkumar Ramachandra
2014-01-07  9:58 ` [PATCH 1/4] drm/i915: add support for vga_switcheroo reprobe Ramkumar Ramachandra
2014-01-07 10:43   ` Chris Wilson
2014-01-07 10:53     ` Ramkumar Ramachandra
2014-01-07  9:58 ` [PATCH 2/4] drm/i915: factor out intel_lvds_get_edid() Ramkumar Ramachandra
2014-01-07  9:58 ` Ramkumar Ramachandra [this message]
2014-01-07  9:58 ` [PATCH 4/4] drm/i915: check LVDS for EDID on GPU switches Ramkumar Ramachandra
2014-01-07 10:45   ` Chris Wilson
2014-01-07 11:12     ` Ramkumar Ramachandra
2014-01-07 11:48       ` Chris Wilson
2014-01-07 13:05         ` Ramkumar Ramachandra
2014-01-07 13:14           ` Chris Wilson
2014-01-07 13:54 ` [PATCH 0/4] Get EDID late for VGA switcheroo Seth Forshee
2014-01-07 14:30   ` Ramkumar Ramachandra
2014-01-07 14:42     ` andreas
2014-01-07 14:58       ` Ramkumar Ramachandra

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=1389088723-30959-4-git-send-email-artagnon@gmail.com \
    --to=artagnon@gmail.com \
    --cc=andreas@meetr.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=seth.forshee@canonical.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