summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjsg <jsg@openbsd.org>2014-01-23 03:49:53 +0000
committerjsg <jsg@openbsd.org>2014-01-23 03:49:53 +0000
commit748861c4f029e70e140f7ed5b1955e6239d92f2f (patch)
tree5a154927a683cb3120587d8f7b591f3b9da9882f
parentdrm/i915: don't setup hdmi for port D edp in ddi_init (diff)
downloadwireguard-openbsd-748861c4f029e70e140f7ed5b1955e6239d92f2f.tar.xz
wireguard-openbsd-748861c4f029e70e140f7ed5b1955e6239d92f2f.zip
drm/i915: Preserve the DDI_A_4_LANES bit from the bios
From Stephane Marchesin bcd20ba343996f631f506c71ced67a1f7947524e in ubuntu 3.8 bcf53de4e60d9000b82f541d654529e2902a4c2c in mainline linux
-rw-r--r--sys/dev/pci/drm/i915/intel_ddi.c12
-rw-r--r--sys/dev/pci/drm/i915/intel_drv.h4
2 files changed, 9 insertions, 7 deletions
diff --git a/sys/dev/pci/drm/i915/intel_ddi.c b/sys/dev/pci/drm/i915/intel_ddi.c
index 881e00a1929..450891fef79 100644
--- a/sys/dev/pci/drm/i915/intel_ddi.c
+++ b/sys/dev/pci/drm/i915/intel_ddi.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: intel_ddi.c,v 1.8 2014/01/23 03:43:04 jsg Exp $ */
+/* $OpenBSD: intel_ddi.c,v 1.9 2014/01/23 03:49:53 jsg Exp $ */
/*
* Copyright © 2012 Intel Corporation
*
@@ -685,7 +685,7 @@ static void intel_ddi_mode_set(struct drm_encoder *encoder,
struct intel_digital_port *intel_dig_port =
enc_to_dig_port(encoder);
- intel_dp->DP = intel_dig_port->port_reversal |
+ intel_dp->DP = intel_dig_port->saved_port_bits |
DDI_BUF_CTL_ENABLE | DDI_BUF_EMP_400MV_0DB_HSW;
switch (intel_dp->lane_count) {
case 1:
@@ -1309,7 +1309,8 @@ static void intel_enable_ddi(struct intel_encoder *intel_encoder)
* enabling the port.
*/
I915_WRITE(DDI_BUF_CTL(port),
- intel_dig_port->port_reversal | DDI_BUF_CTL_ENABLE);
+ intel_dig_port->saved_port_bits |
+ DDI_BUF_CTL_ENABLE);
} else if (type == INTEL_OUTPUT_EDP) {
struct intel_dp *intel_dp = enc_to_intel_dp(encoder);
@@ -1504,8 +1505,9 @@ void intel_ddi_init(struct drm_device *dev, enum port port)
intel_encoder->get_hw_state = intel_ddi_get_hw_state;
intel_dig_port->port = port;
- intel_dig_port->port_reversal = I915_READ(DDI_BUF_CTL(port)) &
- DDI_BUF_PORT_REVERSAL;
+ intel_dig_port->saved_port_bits = I915_READ(DDI_BUF_CTL(port)) &
+ (DDI_BUF_PORT_REVERSAL |
+ DDI_A_4_LANES);
intel_dig_port->dp.output_reg = DDI_BUF_CTL(port);
intel_encoder->type = INTEL_OUTPUT_UNKNOWN;
diff --git a/sys/dev/pci/drm/i915/intel_drv.h b/sys/dev/pci/drm/i915/intel_drv.h
index 81a39080681..9903fda9b11 100644
--- a/sys/dev/pci/drm/i915/intel_drv.h
+++ b/sys/dev/pci/drm/i915/intel_drv.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: intel_drv.h,v 1.4 2014/01/23 03:23:48 jsg Exp $ */
+/* $OpenBSD: intel_drv.h,v 1.5 2014/01/23 03:49:53 jsg Exp $ */
/*
* Copyright (c) 2006 Dave Airlie <airlied@linux.ie>
* Copyright (c) 2007-2008 Intel Corporation
@@ -346,7 +346,7 @@ struct intel_dp {
struct intel_digital_port {
struct intel_encoder base;
enum port port;
- u32 port_reversal;
+ u32 saved_port_bits;
struct intel_dp dp;
struct intel_hdmi hdmi;
};