summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorJonathan Gray <jsg@cvs.openbsd.org>2014-02-18 02:48:58 +0000
committerJonathan Gray <jsg@cvs.openbsd.org>2014-02-18 02:48:58 +0000
commitbb326ecd0fbb538fcf23e510137b7a6a72df757f (patch)
treeab063a3082fa58fb0e88c37a6fa9ed7c1e735385 /sys/dev
parent39c0db437e4553db599b6a2c277c2669eca6a86e (diff)
drm/i915: VLV2 - Fix hotplug detect bits
From Todd Previte 080caf7f5b0d025c2e19f2f516da634d020ba70f in ubuntu 3.8 232a6ee9af8adb185640f67fcaaa9014a9aa0573 in mainline linux
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/pci/drm/i915/i915_reg.h20
-rw-r--r--sys/dev/pci/drm/i915/intel_dp.c42
2 files changed, 44 insertions, 18 deletions
diff --git a/sys/dev/pci/drm/i915/i915_reg.h b/sys/dev/pci/drm/i915/i915_reg.h
index 0a13c26f0fa..6b7a8ad4783 100644
--- a/sys/dev/pci/drm/i915/i915_reg.h
+++ b/sys/dev/pci/drm/i915/i915_reg.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: i915_reg.h,v 1.7 2014/02/02 04:02:04 jsg Exp $ */
+/* $OpenBSD: i915_reg.h,v 1.8 2014/02/18 02:48:57 jsg Exp $ */
/* Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas.
* All Rights Reserved.
*
@@ -1662,10 +1662,20 @@
#define CRT_HOTPLUG_DETECT_VOLTAGE_475MV (1 << 2)
#define PORT_HOTPLUG_STAT 0x61114
-/* HDMI/DP bits are gen4+ */
-#define DPB_HOTPLUG_LIVE_STATUS (1 << 29)
-#define DPC_HOTPLUG_LIVE_STATUS (1 << 28)
-#define DPD_HOTPLUG_LIVE_STATUS (1 << 27)
+/*
+ * HDMI/DP bits are gen4+
+ *
+ * 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 DPD_HOTPLUG_LIVE_STATUS_G4X (1 << 29)
+#define DPC_HOTPLUG_LIVE_STATUS_G4X (1 << 28)
+#define DPB_HOTPLUG_LIVE_STATUS_G4X (1 << 27)
+/* VLV DP/HDMI bits again match Bspec */
+#define DPD_HOTPLUG_LIVE_STATUS_VLV (1 << 27)
+#define DPC_HOTPLUG_LIVE_STATUS_VLV (1 << 28)
+#define DPB_HOTPLUG_LIVE_STATUS_VLV (1 << 29)
#define DPD_HOTPLUG_INT_STATUS (3 << 21)
#define DPC_HOTPLUG_INT_STATUS (3 << 19)
#define DPB_HOTPLUG_INT_STATUS (3 << 17)
diff --git a/sys/dev/pci/drm/i915/intel_dp.c b/sys/dev/pci/drm/i915/intel_dp.c
index 29dc199eb14..e57d0d9ddb3 100644
--- a/sys/dev/pci/drm/i915/intel_dp.c
+++ b/sys/dev/pci/drm/i915/intel_dp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: intel_dp.c,v 1.15 2014/02/02 01:06:21 jsg Exp $ */
+/* $OpenBSD: intel_dp.c,v 1.16 2014/02/18 02:48:57 jsg Exp $ */
/*
* Copyright © 2008 Intel Corporation
*
@@ -2269,18 +2269,34 @@ g4x_dp_detect(struct intel_dp *intel_dp)
struct drm_i915_private *dev_priv = dev->dev_private;
uint32_t bit;
- switch (intel_dp->output_reg) {
- case DP_B:
- bit = DPB_HOTPLUG_LIVE_STATUS;
- break;
- case DP_C:
- bit = DPC_HOTPLUG_LIVE_STATUS;
- break;
- case DP_D:
- bit = DPD_HOTPLUG_LIVE_STATUS;
- break;
- default:
- return connector_status_unknown;
+ if (IS_VALLEYVIEW(dev)) {
+ switch (intel_dp->output_reg) {
+ case DP_B:
+ bit = DPB_HOTPLUG_LIVE_STATUS_VLV;
+ break;
+ case DP_C:
+ bit = DPC_HOTPLUG_LIVE_STATUS_VLV;
+ break;
+ case DP_D:
+ bit = DPD_HOTPLUG_LIVE_STATUS_VLV;
+ break;
+ default:
+ return connector_status_unknown;
+ }
+ } else {
+ switch (intel_dp->output_reg) {
+ case DP_B:
+ bit = DPB_HOTPLUG_LIVE_STATUS_G4X;
+ break;
+ case DP_C:
+ bit = DPC_HOTPLUG_LIVE_STATUS_G4X;
+ break;
+ case DP_D:
+ bit = DPD_HOTPLUG_LIVE_STATUS_G4X;
+ break;
+ default:
+ return connector_status_unknown;
+ }
}
if ((I915_READ(PORT_HOTPLUG_STAT) & bit) == 0)