diff options
author | Paulo Zanoni <paulo.r.zanoni@intel.com> | 2012-11-20 12:12:07 -0500 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2012-11-21 11:47:08 -0500 |
commit | 17a303ec7cd5a245c621b6d0898eb3ef9fc96329 (patch) | |
tree | 35d90637b3b1740526740d32b23bbc8ef73af0e7 /drivers/gpu/drm/i915 | |
parent | c54e59046c825266ca0decdac47fcfcf902b6cd6 (diff) |
drm/i915: make DP work on LPT-LP machines
We need to enable a special bit, otherwise none of the DP functions
requiring the PCH will work.
Version 2: store the PCH ID inside dev_priv, as suggested by Daniel
Vetter.
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Reviewed-by: Damien Lespiau <damien.lespiau@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu/drm/i915')
-rw-r--r-- | drivers/gpu/drm/i915/i915_drv.c | 10 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/i915_drv.h | 8 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/i915_reg.h | 1 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/intel_pm.c | 15 |
4 files changed, 26 insertions, 8 deletions
diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c index f7aef97290bc..d5d8f2f2ed09 100644 --- a/drivers/gpu/drm/i915/i915_drv.c +++ b/drivers/gpu/drm/i915/i915_drv.c | |||
@@ -396,13 +396,6 @@ static const struct pci_device_id pciidlist[] = { /* aka */ | |||
396 | MODULE_DEVICE_TABLE(pci, pciidlist); | 396 | MODULE_DEVICE_TABLE(pci, pciidlist); |
397 | #endif | 397 | #endif |
398 | 398 | ||
399 | #define INTEL_PCH_DEVICE_ID_MASK 0xff00 | ||
400 | #define INTEL_PCH_IBX_DEVICE_ID_TYPE 0x3b00 | ||
401 | #define INTEL_PCH_CPT_DEVICE_ID_TYPE 0x1c00 | ||
402 | #define INTEL_PCH_PPT_DEVICE_ID_TYPE 0x1e00 | ||
403 | #define INTEL_PCH_LPT_DEVICE_ID_TYPE 0x8c00 | ||
404 | #define INTEL_PCH_LPT_LP_DEVICE_ID_TYPE 0x9c00 | ||
405 | |||
406 | void intel_detect_pch(struct drm_device *dev) | 399 | void intel_detect_pch(struct drm_device *dev) |
407 | { | 400 | { |
408 | struct drm_i915_private *dev_priv = dev->dev_private; | 401 | struct drm_i915_private *dev_priv = dev->dev_private; |
@@ -417,8 +410,9 @@ void intel_detect_pch(struct drm_device *dev) | |||
417 | pch = pci_get_class(PCI_CLASS_BRIDGE_ISA << 8, NULL); | 410 | pch = pci_get_class(PCI_CLASS_BRIDGE_ISA << 8, NULL); |
418 | if (pch) { | 411 | if (pch) { |
419 | if (pch->vendor == PCI_VENDOR_ID_INTEL) { | 412 | if (pch->vendor == PCI_VENDOR_ID_INTEL) { |
420 | int id; | 413 | unsigned short id; |
421 | id = pch->device & INTEL_PCH_DEVICE_ID_MASK; | 414 | id = pch->device & INTEL_PCH_DEVICE_ID_MASK; |
415 | dev_priv->pch_id = id; | ||
422 | 416 | ||
423 | if (id == INTEL_PCH_IBX_DEVICE_ID_TYPE) { | 417 | if (id == INTEL_PCH_IBX_DEVICE_ID_TYPE) { |
424 | dev_priv->pch_type = PCH_IBX; | 418 | dev_priv->pch_type = PCH_IBX; |
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h index b25df10b0b5c..669afcabe3b1 100644 --- a/drivers/gpu/drm/i915/i915_drv.h +++ b/drivers/gpu/drm/i915/i915_drv.h | |||
@@ -737,6 +737,7 @@ typedef struct drm_i915_private { | |||
737 | 737 | ||
738 | /* PCH chipset type */ | 738 | /* PCH chipset type */ |
739 | enum intel_pch pch_type; | 739 | enum intel_pch pch_type; |
740 | unsigned short pch_id; | ||
740 | 741 | ||
741 | unsigned long quirks; | 742 | unsigned long quirks; |
742 | 743 | ||
@@ -1205,6 +1206,13 @@ struct drm_i915_file_private { | |||
1205 | 1206 | ||
1206 | #define HAS_PIPE_CONTROL(dev) (INTEL_INFO(dev)->gen >= 5) | 1207 | #define HAS_PIPE_CONTROL(dev) (INTEL_INFO(dev)->gen >= 5) |
1207 | 1208 | ||
1209 | #define INTEL_PCH_DEVICE_ID_MASK 0xff00 | ||
1210 | #define INTEL_PCH_IBX_DEVICE_ID_TYPE 0x3b00 | ||
1211 | #define INTEL_PCH_CPT_DEVICE_ID_TYPE 0x1c00 | ||
1212 | #define INTEL_PCH_PPT_DEVICE_ID_TYPE 0x1e00 | ||
1213 | #define INTEL_PCH_LPT_DEVICE_ID_TYPE 0x8c00 | ||
1214 | #define INTEL_PCH_LPT_LP_DEVICE_ID_TYPE 0x9c00 | ||
1215 | |||
1208 | #define INTEL_PCH_TYPE(dev) (((struct drm_i915_private *)(dev)->dev_private)->pch_type) | 1216 | #define INTEL_PCH_TYPE(dev) (((struct drm_i915_private *)(dev)->dev_private)->pch_type) |
1209 | #define HAS_PCH_LPT(dev) (INTEL_PCH_TYPE(dev) == PCH_LPT) | 1217 | #define HAS_PCH_LPT(dev) (INTEL_PCH_TYPE(dev) == PCH_LPT) |
1210 | #define HAS_PCH_CPT(dev) (INTEL_PCH_TYPE(dev) == PCH_CPT) | 1218 | #define HAS_PCH_CPT(dev) (INTEL_PCH_TYPE(dev) == PCH_CPT) |
diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h index 9118bd112589..2d838766418b 100644 --- a/drivers/gpu/drm/i915/i915_reg.h +++ b/drivers/gpu/drm/i915/i915_reg.h | |||
@@ -3851,6 +3851,7 @@ | |||
3851 | 3851 | ||
3852 | #define SOUTH_DSPCLK_GATE_D 0xc2020 | 3852 | #define SOUTH_DSPCLK_GATE_D 0xc2020 |
3853 | #define PCH_DPLSUNIT_CLOCK_GATE_DISABLE (1<<29) | 3853 | #define PCH_DPLSUNIT_CLOCK_GATE_DISABLE (1<<29) |
3854 | #define PCH_LP_PARTITION_LEVEL_DISABLE (1<<12) | ||
3854 | 3855 | ||
3855 | /* CPU: FDI_TX */ | 3856 | /* CPU: FDI_TX */ |
3856 | #define _FDI_TXA_CTL 0x60100 | 3857 | #define _FDI_TXA_CTL 0x60100 |
diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c index 0edb549d1434..647dfcc26c4e 100644 --- a/drivers/gpu/drm/i915/intel_pm.c +++ b/drivers/gpu/drm/i915/intel_pm.c | |||
@@ -3549,6 +3549,20 @@ static void gen7_setup_fixed_func_scheduler(struct drm_i915_private *dev_priv) | |||
3549 | I915_WRITE(GEN7_FF_THREAD_MODE, reg); | 3549 | I915_WRITE(GEN7_FF_THREAD_MODE, reg); |
3550 | } | 3550 | } |
3551 | 3551 | ||
3552 | static void lpt_init_clock_gating(struct drm_device *dev) | ||
3553 | { | ||
3554 | struct drm_i915_private *dev_priv = dev->dev_private; | ||
3555 | |||
3556 | /* | ||
3557 | * TODO: this bit should only be enabled when really needed, then | ||
3558 | * disabled when not needed anymore in order to save power. | ||
3559 | */ | ||
3560 | if (dev_priv->pch_id == INTEL_PCH_LPT_LP_DEVICE_ID_TYPE) | ||
3561 | I915_WRITE(SOUTH_DSPCLK_GATE_D, | ||
3562 | I915_READ(SOUTH_DSPCLK_GATE_D) | | ||
3563 | PCH_LP_PARTITION_LEVEL_DISABLE); | ||
3564 | } | ||
3565 | |||
3552 | static void haswell_init_clock_gating(struct drm_device *dev) | 3566 | static void haswell_init_clock_gating(struct drm_device *dev) |
3553 | { | 3567 | { |
3554 | struct drm_i915_private *dev_priv = dev->dev_private; | 3568 | struct drm_i915_private *dev_priv = dev->dev_private; |
@@ -3600,6 +3614,7 @@ static void haswell_init_clock_gating(struct drm_device *dev) | |||
3600 | WM_DBG_DISALLOW_SPRITE | | 3614 | WM_DBG_DISALLOW_SPRITE | |
3601 | WM_DBG_DISALLOW_MAXFIFO); | 3615 | WM_DBG_DISALLOW_MAXFIFO); |
3602 | 3616 | ||
3617 | lpt_init_clock_gating(dev); | ||
3603 | } | 3618 | } |
3604 | 3619 | ||
3605 | static void ivybridge_init_clock_gating(struct drm_device *dev) | 3620 | static void ivybridge_init_clock_gating(struct drm_device *dev) |