diff options
| -rw-r--r-- | drivers/gpu/drm/i915/i915_drv.c | 23 | ||||
| -rw-r--r-- | drivers/gpu/drm/i915/i915_gem_stolen.c | 19 | ||||
| -rw-r--r-- | drivers/gpu/drm/i915/intel_display.c | 8 | ||||
| -rw-r--r-- | drivers/gpu/drm/i915/intel_hdmi.c | 6 | ||||
| -rw-r--r-- | drivers/gpu/drm/i915/intel_panel.c | 4 | ||||
| -rw-r--r-- | drivers/gpu/drm/i915/intel_pm.c | 6 |
6 files changed, 38 insertions, 28 deletions
diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c index 04f1f02c4019..ec7bb0fc71bc 100644 --- a/drivers/gpu/drm/i915/i915_drv.c +++ b/drivers/gpu/drm/i915/i915_drv.c | |||
| @@ -403,7 +403,7 @@ MODULE_DEVICE_TABLE(pci, pciidlist); | |||
| 403 | void intel_detect_pch(struct drm_device *dev) | 403 | void intel_detect_pch(struct drm_device *dev) |
| 404 | { | 404 | { |
| 405 | struct drm_i915_private *dev_priv = dev->dev_private; | 405 | struct drm_i915_private *dev_priv = dev->dev_private; |
| 406 | struct pci_dev *pch; | 406 | struct pci_dev *pch = NULL; |
| 407 | 407 | ||
| 408 | /* In all current cases, num_pipes is equivalent to the PCH_NOP setting | 408 | /* In all current cases, num_pipes is equivalent to the PCH_NOP setting |
| 409 | * (which really amounts to a PCH but no South Display). | 409 | * (which really amounts to a PCH but no South Display). |
| @@ -424,12 +424,9 @@ void intel_detect_pch(struct drm_device *dev) | |||
| 424 | * all the ISA bridge devices and check for the first match, instead | 424 | * all the ISA bridge devices and check for the first match, instead |
| 425 | * of only checking the first one. | 425 | * of only checking the first one. |
| 426 | */ | 426 | */ |
| 427 | pch = pci_get_class(PCI_CLASS_BRIDGE_ISA << 8, NULL); | 427 | while ((pch = pci_get_class(PCI_CLASS_BRIDGE_ISA << 8, pch))) { |
| 428 | while (pch) { | ||
| 429 | struct pci_dev *curr = pch; | ||
| 430 | if (pch->vendor == PCI_VENDOR_ID_INTEL) { | 428 | if (pch->vendor == PCI_VENDOR_ID_INTEL) { |
| 431 | unsigned short id; | 429 | unsigned short id = pch->device & INTEL_PCH_DEVICE_ID_MASK; |
| 432 | id = pch->device & INTEL_PCH_DEVICE_ID_MASK; | ||
| 433 | dev_priv->pch_id = id; | 430 | dev_priv->pch_id = id; |
| 434 | 431 | ||
| 435 | if (id == INTEL_PCH_IBX_DEVICE_ID_TYPE) { | 432 | if (id == INTEL_PCH_IBX_DEVICE_ID_TYPE) { |
| @@ -461,18 +458,16 @@ void intel_detect_pch(struct drm_device *dev) | |||
| 461 | DRM_DEBUG_KMS("Found LynxPoint LP PCH\n"); | 458 | DRM_DEBUG_KMS("Found LynxPoint LP PCH\n"); |
| 462 | WARN_ON(!IS_HASWELL(dev)); | 459 | WARN_ON(!IS_HASWELL(dev)); |
| 463 | WARN_ON(!IS_ULT(dev)); | 460 | WARN_ON(!IS_ULT(dev)); |
| 464 | } else { | 461 | } else |
| 465 | goto check_next; | 462 | continue; |
| 466 | } | 463 | |
| 467 | pci_dev_put(pch); | ||
| 468 | break; | 464 | break; |
| 469 | } | 465 | } |
| 470 | check_next: | ||
| 471 | pch = pci_get_class(PCI_CLASS_BRIDGE_ISA << 8, curr); | ||
| 472 | pci_dev_put(curr); | ||
| 473 | } | 466 | } |
| 474 | if (!pch) | 467 | if (!pch) |
| 475 | DRM_DEBUG_KMS("No PCH found?\n"); | 468 | DRM_DEBUG_KMS("No PCH found.\n"); |
| 469 | |||
| 470 | pci_dev_put(pch); | ||
| 476 | } | 471 | } |
| 477 | 472 | ||
| 478 | bool i915_semaphore_is_enabled(struct drm_device *dev) | 473 | bool i915_semaphore_is_enabled(struct drm_device *dev) |
diff --git a/drivers/gpu/drm/i915/i915_gem_stolen.c b/drivers/gpu/drm/i915/i915_gem_stolen.c index 1a24e84f2315..d58b4e287e32 100644 --- a/drivers/gpu/drm/i915/i915_gem_stolen.c +++ b/drivers/gpu/drm/i915/i915_gem_stolen.c | |||
| @@ -82,9 +82,22 @@ static unsigned long i915_stolen_to_physical(struct drm_device *dev) | |||
| 82 | r = devm_request_mem_region(dev->dev, base, dev_priv->gtt.stolen_size, | 82 | r = devm_request_mem_region(dev->dev, base, dev_priv->gtt.stolen_size, |
| 83 | "Graphics Stolen Memory"); | 83 | "Graphics Stolen Memory"); |
| 84 | if (r == NULL) { | 84 | if (r == NULL) { |
| 85 | DRM_ERROR("conflict detected with stolen region: [0x%08x - 0x%08x]\n", | 85 | /* |
| 86 | base, base + (uint32_t)dev_priv->gtt.stolen_size); | 86 | * One more attempt but this time requesting region from |
| 87 | base = 0; | 87 | * base + 1, as we have seen that this resolves the region |
| 88 | * conflict with the PCI Bus. | ||
| 89 | * This is a BIOS w/a: Some BIOS wrap stolen in the root | ||
| 90 | * PCI bus, but have an off-by-one error. Hence retry the | ||
| 91 | * reservation starting from 1 instead of 0. | ||
| 92 | */ | ||
| 93 | r = devm_request_mem_region(dev->dev, base + 1, | ||
| 94 | dev_priv->gtt.stolen_size - 1, | ||
| 95 | "Graphics Stolen Memory"); | ||
| 96 | if (r == NULL) { | ||
| 97 | DRM_ERROR("conflict detected with stolen region: [0x%08x - 0x%08x]\n", | ||
| 98 | base, base + (uint32_t)dev_priv->gtt.stolen_size); | ||
| 99 | base = 0; | ||
| 100 | } | ||
| 88 | } | 101 | } |
| 89 | 102 | ||
| 90 | return base; | 103 | return base; |
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index 4c1672809493..9b8a7c7ea7fc 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c | |||
| @@ -1092,12 +1092,12 @@ static void assert_cursor(struct drm_i915_private *dev_priv, | |||
| 1092 | struct drm_device *dev = dev_priv->dev; | 1092 | struct drm_device *dev = dev_priv->dev; |
| 1093 | bool cur_state; | 1093 | bool cur_state; |
| 1094 | 1094 | ||
| 1095 | if (IS_IVYBRIDGE(dev) || IS_HASWELL(dev)) | 1095 | if (IS_845G(dev) || IS_I865G(dev)) |
| 1096 | cur_state = I915_READ(CURCNTR_IVB(pipe)) & CURSOR_MODE; | ||
| 1097 | else if (IS_845G(dev) || IS_I865G(dev)) | ||
| 1098 | cur_state = I915_READ(_CURACNTR) & CURSOR_ENABLE; | 1096 | cur_state = I915_READ(_CURACNTR) & CURSOR_ENABLE; |
| 1099 | else | 1097 | else if (INTEL_INFO(dev)->gen <= 6 || IS_VALLEYVIEW(dev)) |
| 1100 | cur_state = I915_READ(CURCNTR(pipe)) & CURSOR_MODE; | 1098 | cur_state = I915_READ(CURCNTR(pipe)) & CURSOR_MODE; |
| 1099 | else | ||
| 1100 | cur_state = I915_READ(CURCNTR_IVB(pipe)) & CURSOR_MODE; | ||
| 1101 | 1101 | ||
| 1102 | WARN(cur_state != state, | 1102 | WARN(cur_state != state, |
| 1103 | "cursor on pipe %c assertion failure (expected %s, current %s)\n", | 1103 | "cursor on pipe %c assertion failure (expected %s, current %s)\n", |
diff --git a/drivers/gpu/drm/i915/intel_hdmi.c b/drivers/gpu/drm/i915/intel_hdmi.c index 6db0d9d17f47..ee3181ebcc92 100644 --- a/drivers/gpu/drm/i915/intel_hdmi.c +++ b/drivers/gpu/drm/i915/intel_hdmi.c | |||
| @@ -845,7 +845,7 @@ static int hdmi_portclock_limit(struct intel_hdmi *hdmi) | |||
| 845 | { | 845 | { |
| 846 | struct drm_device *dev = intel_hdmi_to_dev(hdmi); | 846 | struct drm_device *dev = intel_hdmi_to_dev(hdmi); |
| 847 | 847 | ||
| 848 | if (IS_G4X(dev)) | 848 | if (!hdmi->has_hdmi_sink || IS_G4X(dev)) |
| 849 | return 165000; | 849 | return 165000; |
| 850 | else if (IS_HASWELL(dev) || INTEL_INFO(dev)->gen >= 8) | 850 | else if (IS_HASWELL(dev) || INTEL_INFO(dev)->gen >= 8) |
| 851 | return 300000; | 851 | return 300000; |
| @@ -899,8 +899,8 @@ bool intel_hdmi_compute_config(struct intel_encoder *encoder, | |||
| 899 | * outputs. We also need to check that the higher clock still fits | 899 | * outputs. We also need to check that the higher clock still fits |
| 900 | * within limits. | 900 | * within limits. |
| 901 | */ | 901 | */ |
| 902 | if (pipe_config->pipe_bpp > 8*3 && clock_12bpc <= portclock_limit | 902 | if (pipe_config->pipe_bpp > 8*3 && intel_hdmi->has_hdmi_sink && |
| 903 | && HAS_PCH_SPLIT(dev)) { | 903 | clock_12bpc <= portclock_limit && HAS_PCH_SPLIT(dev)) { |
| 904 | DRM_DEBUG_KMS("picking bpc to 12 for HDMI output\n"); | 904 | DRM_DEBUG_KMS("picking bpc to 12 for HDMI output\n"); |
| 905 | desired_bpp = 12*3; | 905 | desired_bpp = 12*3; |
| 906 | 906 | ||
diff --git a/drivers/gpu/drm/i915/intel_panel.c b/drivers/gpu/drm/i915/intel_panel.c index 350de359123a..079ea38f14d9 100644 --- a/drivers/gpu/drm/i915/intel_panel.c +++ b/drivers/gpu/drm/i915/intel_panel.c | |||
| @@ -698,7 +698,7 @@ static void i9xx_enable_backlight(struct intel_connector *connector) | |||
| 698 | freq /= 0xff; | 698 | freq /= 0xff; |
| 699 | 699 | ||
| 700 | ctl = freq << 17; | 700 | ctl = freq << 17; |
| 701 | if (IS_GEN2(dev) && panel->backlight.combination_mode) | 701 | if (panel->backlight.combination_mode) |
| 702 | ctl |= BLM_LEGACY_MODE; | 702 | ctl |= BLM_LEGACY_MODE; |
| 703 | if (IS_PINEVIEW(dev) && panel->backlight.active_low_pwm) | 703 | if (IS_PINEVIEW(dev) && panel->backlight.active_low_pwm) |
| 704 | ctl |= BLM_POLARITY_PNV; | 704 | ctl |= BLM_POLARITY_PNV; |
| @@ -979,7 +979,7 @@ static int i9xx_setup_backlight(struct intel_connector *connector) | |||
| 979 | 979 | ||
| 980 | ctl = I915_READ(BLC_PWM_CTL); | 980 | ctl = I915_READ(BLC_PWM_CTL); |
| 981 | 981 | ||
| 982 | if (IS_GEN2(dev)) | 982 | if (IS_GEN2(dev) || IS_I915GM(dev) || IS_I945GM(dev)) |
| 983 | panel->backlight.combination_mode = ctl & BLM_LEGACY_MODE; | 983 | panel->backlight.combination_mode = ctl & BLM_LEGACY_MODE; |
| 984 | 984 | ||
| 985 | if (IS_PINEVIEW(dev)) | 985 | if (IS_PINEVIEW(dev)) |
diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c index d77cc81900f9..e1fc35a72656 100644 --- a/drivers/gpu/drm/i915/intel_pm.c +++ b/drivers/gpu/drm/i915/intel_pm.c | |||
| @@ -3493,6 +3493,8 @@ static void valleyview_setup_pctx(struct drm_device *dev) | |||
| 3493 | u32 pcbr; | 3493 | u32 pcbr; |
| 3494 | int pctx_size = 24*1024; | 3494 | int pctx_size = 24*1024; |
| 3495 | 3495 | ||
| 3496 | WARN_ON(!mutex_is_locked(&dev->struct_mutex)); | ||
| 3497 | |||
| 3496 | pcbr = I915_READ(VLV_PCBR); | 3498 | pcbr = I915_READ(VLV_PCBR); |
| 3497 | if (pcbr) { | 3499 | if (pcbr) { |
| 3498 | /* BIOS set it up already, grab the pre-alloc'd space */ | 3500 | /* BIOS set it up already, grab the pre-alloc'd space */ |
| @@ -3542,8 +3544,6 @@ static void valleyview_enable_rps(struct drm_device *dev) | |||
| 3542 | I915_WRITE(GTFIFODBG, gtfifodbg); | 3544 | I915_WRITE(GTFIFODBG, gtfifodbg); |
| 3543 | } | 3545 | } |
| 3544 | 3546 | ||
| 3545 | valleyview_setup_pctx(dev); | ||
| 3546 | |||
| 3547 | /* If VLV, Forcewake all wells, else re-direct to regular path */ | 3547 | /* If VLV, Forcewake all wells, else re-direct to regular path */ |
| 3548 | gen6_gt_force_wake_get(dev_priv, FORCEWAKE_ALL); | 3548 | gen6_gt_force_wake_get(dev_priv, FORCEWAKE_ALL); |
| 3549 | 3549 | ||
| @@ -4395,6 +4395,8 @@ void intel_enable_gt_powersave(struct drm_device *dev) | |||
| 4395 | ironlake_enable_rc6(dev); | 4395 | ironlake_enable_rc6(dev); |
| 4396 | intel_init_emon(dev); | 4396 | intel_init_emon(dev); |
| 4397 | } else if (IS_GEN6(dev) || IS_GEN7(dev)) { | 4397 | } else if (IS_GEN6(dev) || IS_GEN7(dev)) { |
| 4398 | if (IS_VALLEYVIEW(dev)) | ||
| 4399 | valleyview_setup_pctx(dev); | ||
| 4398 | /* | 4400 | /* |
| 4399 | * PCU communication is slow and this doesn't need to be | 4401 | * PCU communication is slow and this doesn't need to be |
| 4400 | * done at any specific time, so do this out of our fast path | 4402 | * done at any specific time, so do this out of our fast path |
