drm/i915: VLV2 - Fix hotplug detect bits
authorTodd Previte <tprevite@gmail.com>
Thu, 23 Jan 2014 07:13:41 +0000 (00:13 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 13 Feb 2014 21:48:03 +0000 (13:48 -0800)
commit 232a6ee9af8adb185640f67fcaaa9014a9aa0573 upstream.

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.]
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/gpu/drm/i915/i915_reg.h
drivers/gpu/drm/i915/intel_dp.c

index b1a0cdba59e7446133225fbfde95f9e814753d73..2d90f96c19d021337813bed6b0c5435939d23e7f 100644 (file)
  * Please check the detailed lore in the commit message for for experimental
  * evidence.
  */
-#define   PORTD_HOTPLUG_LIVE_STATUS               (1 << 29)
-#define   PORTC_HOTPLUG_LIVE_STATUS               (1 << 28)
-#define   PORTB_HOTPLUG_LIVE_STATUS               (1 << 27)
+#define   PORTD_HOTPLUG_LIVE_STATUS_G4X                (1 << 29)
+#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   PORTD_HOTPLUG_INT_STATUS             (3 << 21)
 #define   PORTC_HOTPLUG_INT_STATUS             (3 << 19)
 #define   PORTB_HOTPLUG_INT_STATUS             (3 << 17)
index 80feaec88d2b47e76a7ee78afd2dbce00268b8ef..cfd327c292ee1798db44ac764f2a9dc0d0445a20 100644 (file)
@@ -2277,18 +2277,34 @@ g4x_dp_detect(struct intel_dp *intel_dp)
                return status;
        }
 
-       switch (intel_dig_port->port) {
-       case PORT_B:
-               bit = PORTB_HOTPLUG_LIVE_STATUS;
-               break;
-       case PORT_C:
-               bit = PORTC_HOTPLUG_LIVE_STATUS;
-               break;
-       case PORT_D:
-               bit = PORTD_HOTPLUG_LIVE_STATUS;
-               break;
-       default:
-               return connector_status_unknown;
+       if (IS_VALLEYVIEW(dev)) {
+               switch (intel_dig_port->port) {
+               case PORT_B:
+                       bit = PORTB_HOTPLUG_LIVE_STATUS_VLV;
+                       break;
+               case PORT_C:
+                       bit = PORTC_HOTPLUG_LIVE_STATUS_VLV;
+                       break;
+               case PORT_D:
+                       bit = PORTD_HOTPLUG_LIVE_STATUS_VLV;
+                       break;
+               default:
+                       return connector_status_unknown;
+               }
+       } else {
+               switch (intel_dig_port->port) {
+               case PORT_B:
+                       bit = PORTB_HOTPLUG_LIVE_STATUS_G4X;
+                       break;
+               case PORT_C:
+                       bit = PORTC_HOTPLUG_LIVE_STATUS_G4X;
+                       break;
+               case PORT_D:
+                       bit = PORTD_HOTPLUG_LIVE_STATUS_G4X;
+                       break;
+               default:
+                       return connector_status_unknown;
+               }
        }
 
        if ((I915_READ(PORT_HOTPLUG_STAT) & bit) == 0)