| From 92ecfb507752c4a454239057abda7a0d2737a265 Mon Sep 17 00:00:00 2001 |
| From: =?UTF-8?q?Ville=20Syrj=C3=A4l=C3=A4?= <ville.syrjala@linux.intel.com> |
| Date: Wed, 10 Feb 2016 19:59:05 +0200 |
| Subject: [PATCH 087/135] drm/i915: Fix hpd live status bits for g4x |
| MIME-Version: 1.0 |
| Content-Type: text/plain; charset=UTF-8 |
| Content-Transfer-Encoding: 8bit |
| |
| [ Upstream commit 0780cd36c7af70c55981ee624084f0f48cae9b95 ] |
| |
| Looks like g4x hpd live status bits actually agree with the spec. At |
| least they do on the machine I have, and apparently on Nick Bowler's |
| g4x as well. |
| |
| So gm45 may be the only platform where they don't agree. At least |
| that seems to be the case based on the (somewhat incomplete) |
| logs/dumps in [1], and Daniel has also tested this on his gm45 |
| sometime in the past. |
| |
| So let's change the bits to match the spec on g4x. That actually makes |
| the g4x bits identical to vlv/chv so we can just share the code |
| between those platforms, leaving gm45 as the special case. |
| |
| [1] https://bugzilla.kernel.org/show_bug.cgi?id=52361 |
| |
| Cc: Shashank Sharma <shashank.sharma@intel.com> |
| Cc: Sonika Jindal <sonika.jindal@intel.com> |
| Cc: Daniel Vetter <daniel.vetter@ffwll.ch> |
| Cc: Jani Nikula <jani.nikula@linux.intel.com> |
| Cc: Nick Bowler <nbowler@draconx.ca> |
| References: https://lists.freedesktop.org/archives/dri-devel/2016-February/100382.html |
| Reported-by: Nick Bowler <nbowler@draconx.ca> |
| Cc: stable@vger.kernel.org |
| Fixes: 237ed86c693d ("drm/i915: Check live status before reading edid") |
| Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> |
| Link: http://patchwork.freedesktop.org/patch/msgid/1455127145-20087-1-git-send-email-ville.syrjala@linux.intel.com |
| Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch> |
| Signed-off-by: Sasha Levin <alexander.levin@verizon.com> |
| Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> |
| --- |
| drivers/gpu/drm/i915/i915_reg.h | 15 ++++++++------- |
| drivers/gpu/drm/i915/intel_dp.c | 14 +++++++------- |
| 2 files changed, 15 insertions(+), 14 deletions(-) |
| |
| --- a/drivers/gpu/drm/i915/i915_reg.h |
| +++ b/drivers/gpu/drm/i915/i915_reg.h |
| @@ -3240,19 +3240,20 @@ enum skl_disp_power_wells { |
| |
| #define PORT_HOTPLUG_STAT (dev_priv->info.display_mmio_offset + 0x61114) |
| /* |
| - * HDMI/DP bits are gen4+ |
| + * HDMI/DP bits are g4x+ |
| * |
| * WARNING: Bspec for hpd status bits on gen4 seems to be completely confused. |
| * Please check the detailed lore in the commit message for for experimental |
| * evidence. |
| */ |
| -#define PORTD_HOTPLUG_LIVE_STATUS_G4X (1 << 29) |
| +/* Bspec says GM45 should match G4X/VLV/CHV, but reality disagrees */ |
| +#define PORTD_HOTPLUG_LIVE_STATUS_GM45 (1 << 29) |
| +#define PORTC_HOTPLUG_LIVE_STATUS_GM45 (1 << 28) |
| +#define PORTB_HOTPLUG_LIVE_STATUS_GM45 (1 << 27) |
| +/* G4X/VLV/CHV DP/HDMI bits again match Bspec */ |
| +#define PORTD_HOTPLUG_LIVE_STATUS_G4X (1 << 27) |
| #define PORTC_HOTPLUG_LIVE_STATUS_G4X (1 << 28) |
| -#define PORTB_HOTPLUG_LIVE_STATUS_G4X (1 << 27) |
| -/* VLV DP/HDMI bits again match Bspec */ |
| -#define PORTD_HOTPLUG_LIVE_STATUS_VLV (1 << 27) |
| -#define PORTC_HOTPLUG_LIVE_STATUS_VLV (1 << 28) |
| -#define PORTB_HOTPLUG_LIVE_STATUS_VLV (1 << 29) |
| +#define PORTB_HOTPLUG_LIVE_STATUS_G4X (1 << 29) |
| #define PORTD_HOTPLUG_INT_STATUS (3 << 21) |
| #define PORTD_HOTPLUG_INT_LONG_PULSE (2 << 21) |
| #define PORTD_HOTPLUG_INT_SHORT_PULSE (1 << 21) |
| --- a/drivers/gpu/drm/i915/intel_dp.c |
| +++ b/drivers/gpu/drm/i915/intel_dp.c |
| @@ -4592,20 +4592,20 @@ static bool g4x_digital_port_connected(s |
| return I915_READ(PORT_HOTPLUG_STAT) & bit; |
| } |
| |
| -static bool vlv_digital_port_connected(struct drm_i915_private *dev_priv, |
| - struct intel_digital_port *port) |
| +static bool gm45_digital_port_connected(struct drm_i915_private *dev_priv, |
| + struct intel_digital_port *port) |
| { |
| u32 bit; |
| |
| switch (port->port) { |
| case PORT_B: |
| - bit = PORTB_HOTPLUG_LIVE_STATUS_VLV; |
| + bit = PORTB_HOTPLUG_LIVE_STATUS_GM45; |
| break; |
| case PORT_C: |
| - bit = PORTC_HOTPLUG_LIVE_STATUS_VLV; |
| + bit = PORTC_HOTPLUG_LIVE_STATUS_GM45; |
| break; |
| case PORT_D: |
| - bit = PORTD_HOTPLUG_LIVE_STATUS_VLV; |
| + bit = PORTD_HOTPLUG_LIVE_STATUS_GM45; |
| break; |
| default: |
| MISSING_CASE(port->port); |
| @@ -4657,8 +4657,8 @@ bool intel_digital_port_connected(struct |
| return cpt_digital_port_connected(dev_priv, port); |
| else if (IS_BROXTON(dev_priv)) |
| return bxt_digital_port_connected(dev_priv, port); |
| - else if (IS_VALLEYVIEW(dev_priv)) |
| - return vlv_digital_port_connected(dev_priv, port); |
| + else if (IS_GM45(dev_priv)) |
| + return gm45_digital_port_connected(dev_priv, port); |
| else |
| return g4x_digital_port_connected(dev_priv, port); |
| } |