aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTodd Previte <tprevite@gmail.com>2014-01-23 02:13:41 -0500
committerDaniel Vetter <daniel.vetter@ffwll.ch>2014-01-23 05:51:10 -0500
commit232a6ee9af8adb185640f67fcaaa9014a9aa0573 (patch)
treea72e4d004b303f74b0633bd60881f2f2cf985de3
parent431810112123bb26a0be39a99835861de9906abc (diff)
drm/i915: VLV2 - Fix hotplug detect bits
Add new definitions for hotplug live status bits for VLV2 since they're in reverse order from the gen4x ones. Changelog: - Restored gen4 bit definitions - Added new definitions for VLV2 - Added platform check for IS_VALLEYVIEW() in dp_detect to use the correct bit defintions - Replaced a lost trailing brace for the added switch() Signed-off-by: Todd Previte <tprevite@gmail.com> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=73951 [danvet: Switch to _VLV postfix instead of prefix and regroupg comments again so that the g4x warning is right next to those defines. Also add a _G4X suffix for those special ones. Also cc stable.] Cc: stable@vger.kernel.org Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
-rw-r--r--drivers/gpu/drm/i915/i915_reg.h10
-rw-r--r--drivers/gpu/drm/i915/intel_dp.c40
2 files changed, 35 insertions, 15 deletions
diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h
index 84365cd22092..ba0550222269 100644
--- a/drivers/gpu/drm/i915/i915_reg.h
+++ b/drivers/gpu/drm/i915/i915_reg.h
@@ -2122,9 +2122,13 @@
2122 * Please check the detailed lore in the commit message for for experimental 2122 * Please check the detailed lore in the commit message for for experimental
2123 * evidence. 2123 * evidence.
2124 */ 2124 */
2125#define PORTD_HOTPLUG_LIVE_STATUS (1 << 29) 2125#define PORTD_HOTPLUG_LIVE_STATUS_G4X (1 << 29)
2126#define PORTC_HOTPLUG_LIVE_STATUS (1 << 28) 2126#define PORTC_HOTPLUG_LIVE_STATUS_G4X (1 << 28)
2127#define PORTB_HOTPLUG_LIVE_STATUS (1 << 27) 2127#define PORTB_HOTPLUG_LIVE_STATUS_G4X (1 << 27)
2128/* VLV DP/HDMI bits again match Bspec */
2129#define PORTD_HOTPLUG_LIVE_STATUS_VLV (1 << 27)
2130#define PORTC_HOTPLUG_LIVE_STATUS_VLV (1 << 28)
2131#define PORTB_HOTPLUG_LIVE_STATUS_VLV (1 << 29)
2128#define PORTD_HOTPLUG_INT_STATUS (3 << 21) 2132#define PORTD_HOTPLUG_INT_STATUS (3 << 21)
2129#define PORTC_HOTPLUG_INT_STATUS (3 << 19) 2133#define PORTC_HOTPLUG_INT_STATUS (3 << 19)
2130#define PORTB_HOTPLUG_INT_STATUS (3 << 17) 2134#define PORTB_HOTPLUG_INT_STATUS (3 << 17)
diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
index 689b832f7551..5ede4e8e290d 100644
--- a/drivers/gpu/drm/i915/intel_dp.c
+++ b/drivers/gpu/drm/i915/intel_dp.c
@@ -3009,18 +3009,34 @@ g4x_dp_detect(struct intel_dp *intel_dp)
3009 return status; 3009 return status;
3010 } 3010 }
3011 3011
3012 switch (intel_dig_port->port) { 3012 if (IS_VALLEYVIEW(dev)) {
3013 case PORT_B: 3013 switch (intel_dig_port->port) {
3014 bit = PORTB_HOTPLUG_LIVE_STATUS; 3014 case PORT_B:
3015 break; 3015 bit = PORTB_HOTPLUG_LIVE_STATUS_VLV;
3016 case PORT_C: 3016 break;
3017 bit = PORTC_HOTPLUG_LIVE_STATUS; 3017 case PORT_C:
3018 break; 3018 bit = PORTC_HOTPLUG_LIVE_STATUS_VLV;
3019 case PORT_D: 3019 break;
3020 bit = PORTD_HOTPLUG_LIVE_STATUS; 3020 case PORT_D:
3021 break; 3021 bit = PORTD_HOTPLUG_LIVE_STATUS_VLV;
3022 default: 3022 break;
3023 return connector_status_unknown; 3023 default:
3024 return connector_status_unknown;
3025 }
3026 } else {
3027 switch (intel_dig_port->port) {
3028 case PORT_B:
3029 bit = PORTB_HOTPLUG_LIVE_STATUS_G4X;
3030 break;
3031 case PORT_C:
3032 bit = PORTC_HOTPLUG_LIVE_STATUS_G4X;
3033 break;
3034 case PORT_D:
3035 bit = PORTD_HOTPLUG_LIVE_STATUS_G4X;
3036 break;
3037 default:
3038 return connector_status_unknown;
3039 }
3024 } 3040 }
3025 3041
3026 if ((I915_READ(PORT_HOTPLUG_STAT) & bit) == 0) 3042 if ((I915_READ(PORT_HOTPLUG_STAT) & bit) == 0)