summaryrefslogtreecommitdiff
path: root/sys/dev/pci
diff options
context:
space:
mode:
authorJonathan Gray <jsg@cvs.openbsd.org>2013-07-04 09:52:30 +0000
committerJonathan Gray <jsg@cvs.openbsd.org>2013-07-04 09:52:30 +0000
commit8036e62f7023b3199685ab39a2c74c222a02fca9 (patch)
tree46574d15ef3ba67ef73732513e63f921312d8361 /sys/dev/pci
parent74897b0fb7b61f8a1968bb922245a6e4ebabb9f6 (diff)
set CPT FDI RX polarity bits based on VBT
from linux 3.8.13
Diffstat (limited to 'sys/dev/pci')
-rw-r--r--sys/dev/pci/drm/i915/i915_drv.h3
-rw-r--r--sys/dev/pci/drm/i915/i915_reg.h4
-rw-r--r--sys/dev/pci/drm/i915/intel_bios.c8
-rw-r--r--sys/dev/pci/drm/i915/intel_bios.h6
-rw-r--r--sys/dev/pci/drm/i915/intel_pm.c11
5 files changed, 21 insertions, 11 deletions
diff --git a/sys/dev/pci/drm/i915/i915_drv.h b/sys/dev/pci/drm/i915/i915_drv.h
index 95e20816d00..6b94dcff27f 100644
--- a/sys/dev/pci/drm/i915/i915_drv.h
+++ b/sys/dev/pci/drm/i915/i915_drv.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: i915_drv.h,v 1.22 2013/05/21 22:12:58 kettenis Exp $ */
+/* $OpenBSD: i915_drv.h,v 1.23 2013/07/04 09:52:29 jsg Exp $ */
/* i915_drv.h -- Private header for the I915 driver -*- linux-c -*-
*/
/*
@@ -587,6 +587,7 @@ struct inteldrm_softc {
unsigned int int_crt_support:1;
unsigned int lvds_use_ssc:1;
unsigned int display_clock_mode:1;
+ unsigned int fdi_rx_polarity_inverted:1;
int lvds_ssc_freq;
unsigned int bios_lvds_val; /* initial [PCH_]LVDS reg val in VBIOS */
unsigned int lvds_val; /* used for checking LVDS channel mode */
diff --git a/sys/dev/pci/drm/i915/i915_reg.h b/sys/dev/pci/drm/i915/i915_reg.h
index 25ac61b9b2b..2844eb6bbe2 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.1 2013/03/18 12:36:52 jsg Exp $ */
+/* $OpenBSD: i915_reg.h,v 1.2 2013/07/04 09:52:29 jsg Exp $ */
/* Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas.
* All Rights Reserved.
*
@@ -3841,7 +3841,7 @@
#define _TRANSB_CHICKEN2 0xf1064
#define TRANS_CHICKEN2(pipe) _PIPE(pipe, _TRANSA_CHICKEN2, _TRANSB_CHICKEN2)
#define TRANS_CHICKEN2_TIMING_OVERRIDE (1<<31)
-
+#define TRANS_CHICKEN2_FDI_POLARITY_REVERSED (1<<29)
#define SOUTH_CHICKEN1 0xc2000
#define FDIA_PHASE_SYNC_SHIFT_OVR 19
diff --git a/sys/dev/pci/drm/i915/intel_bios.c b/sys/dev/pci/drm/i915/intel_bios.c
index ccd6d638076..b994f4cb543 100644
--- a/sys/dev/pci/drm/i915/intel_bios.c
+++ b/sys/dev/pci/drm/i915/intel_bios.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: intel_bios.c,v 1.2 2013/03/18 13:06:37 mpi Exp $ */
+/* $OpenBSD: intel_bios.c,v 1.3 2013/07/04 09:52:29 jsg Exp $ */
/*
* Copyright © 2006 Intel Corporation
*
@@ -384,12 +384,14 @@ parse_general_features(struct inteldrm_softc *dev_priv,
dev_priv->lvds_ssc_freq =
intel_bios_ssc_frequency(dev, general->ssc_freq);
dev_priv->display_clock_mode = general->display_clock_mode;
- DRM_DEBUG_KMS("BDB_GENERAL_FEATURES int_tv_support %d int_crt_support %d lvds_use_ssc %d lvds_ssc_freq %d display_clock_mode %d\n",
+ dev_priv->fdi_rx_polarity_inverted = general->fdi_rx_polarity_inverted;
+ DRM_DEBUG_KMS("BDB_GENERAL_FEATURES int_tv_support %d int_crt_support %d lvds_use_ssc %d lvds_ssc_freq %d display_clock_mode %d fdi_rx_polarity_inverted %d\n",
dev_priv->int_tv_support,
dev_priv->int_crt_support,
dev_priv->lvds_use_ssc,
dev_priv->lvds_ssc_freq,
- dev_priv->display_clock_mode);
+ dev_priv->display_clock_mode,
+ dev_priv->fdi_rx_polarity_inverted);
}
}
diff --git a/sys/dev/pci/drm/i915/intel_bios.h b/sys/dev/pci/drm/i915/intel_bios.h
index 548cb4393fc..1d6f4a8708e 100644
--- a/sys/dev/pci/drm/i915/intel_bios.h
+++ b/sys/dev/pci/drm/i915/intel_bios.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: intel_bios.h,v 1.1 2013/03/18 12:36:52 jsg Exp $ */
+/* $OpenBSD: intel_bios.h,v 1.2 2013/07/04 09:52:29 jsg Exp $ */
/*
* Copyright © 2006 Intel Corporation
*
@@ -128,7 +128,9 @@ struct bdb_general_features {
/* bits 3 */
u8 disable_smooth_vision:1;
u8 single_dvi:1;
- u8 rsvd9:6; /* finish byte */
+ u8 rsvd9:1;
+ u8 fdi_rx_polarity_inverted:1;
+ u8 rsvd10:4; /* finish byte */
/* bits 4 */
u8 legacy_monitor_detect;
diff --git a/sys/dev/pci/drm/i915/intel_pm.c b/sys/dev/pci/drm/i915/intel_pm.c
index 6aec6c0a5a9..fb3d21cdac3 100644
--- a/sys/dev/pci/drm/i915/intel_pm.c
+++ b/sys/dev/pci/drm/i915/intel_pm.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: intel_pm.c,v 1.6 2013/06/01 02:03:30 kettenis Exp $ */
+/* $OpenBSD: intel_pm.c,v 1.7 2013/07/04 09:52:29 jsg Exp $ */
/*
* Copyright © 2012 Intel Corporation
*
@@ -3789,6 +3789,7 @@ cpt_init_clock_gating(struct drm_device *dev)
{
struct inteldrm_softc *dev_priv = dev->dev_private;
int pipe;
+ uint32_t val;
/*
* On Ibex Peak and Cougar Point, we need to disable clock
@@ -3801,8 +3802,12 @@ cpt_init_clock_gating(struct drm_device *dev)
/* The below fixes the weird display corruption, a few pixels shifted
* downward, on (only) LVDS of some HP laptops with IVY.
*/
- for_each_pipe(pipe)
- I915_WRITE(TRANS_CHICKEN2(pipe), TRANS_CHICKEN2_TIMING_OVERRIDE);
+ for_each_pipe(pipe) {
+ val = TRANS_CHICKEN2_TIMING_OVERRIDE;
+ if (dev_priv->fdi_rx_polarity_inverted)
+ val |= TRANS_CHICKEN2_FDI_POLARITY_REVERSED;
+ I915_WRITE(TRANS_CHICKEN2(pipe), val);
+ }
/* WADP0ClockGatingDisable */
for_each_pipe(pipe) {
I915_WRITE(TRANS_CHICKEN1(pipe),