lkml.org 
[lkml]   [2014]   [Jan]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 3/4] drm/i915: prepare intel_lvds_get_edid() for multiple calls
Date
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


\
 
 \ /
  Last update: 2014-01-07 11:41    [W:0.072 / U:0.236 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site