diff options
-rw-r--r-- | drivers/gpu/drm/i915/i915_drv.c | 10 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/i915_gem_gtt.c | 16 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/intel_panel.c | 17 |
3 files changed, 41 insertions, 2 deletions
diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c index 055d5e7fbf12..2318b4c7a8f8 100644 --- a/drivers/gpu/drm/i915/i915_drv.c +++ b/drivers/gpu/drm/i915/i915_drv.c | |||
@@ -986,6 +986,15 @@ static int i915_pm_freeze(struct device *dev) | |||
986 | return i915_drm_freeze(drm_dev); | 986 | return i915_drm_freeze(drm_dev); |
987 | } | 987 | } |
988 | 988 | ||
989 | static int i915_pm_freeze_late(struct device *dev) | ||
990 | { | ||
991 | struct pci_dev *pdev = to_pci_dev(dev); | ||
992 | struct drm_device *drm_dev = pci_get_drvdata(pdev); | ||
993 | struct drm_i915_private *dev_priv = drm_dev->dev_private; | ||
994 | |||
995 | return intel_suspend_complete(dev_priv); | ||
996 | } | ||
997 | |||
989 | static int i915_pm_thaw_early(struct device *dev) | 998 | static int i915_pm_thaw_early(struct device *dev) |
990 | { | 999 | { |
991 | struct pci_dev *pdev = to_pci_dev(dev); | 1000 | struct pci_dev *pdev = to_pci_dev(dev); |
@@ -1570,6 +1579,7 @@ static const struct dev_pm_ops i915_pm_ops = { | |||
1570 | .resume_early = i915_pm_resume_early, | 1579 | .resume_early = i915_pm_resume_early, |
1571 | .resume = i915_pm_resume, | 1580 | .resume = i915_pm_resume, |
1572 | .freeze = i915_pm_freeze, | 1581 | .freeze = i915_pm_freeze, |
1582 | .freeze_late = i915_pm_freeze_late, | ||
1573 | .thaw_early = i915_pm_thaw_early, | 1583 | .thaw_early = i915_pm_thaw_early, |
1574 | .thaw = i915_pm_thaw, | 1584 | .thaw = i915_pm_thaw, |
1575 | .poweroff = i915_pm_poweroff, | 1585 | .poweroff = i915_pm_poweroff, |
diff --git a/drivers/gpu/drm/i915/i915_gem_gtt.c b/drivers/gpu/drm/i915/i915_gem_gtt.c index b672b843fd5e..728938f02341 100644 --- a/drivers/gpu/drm/i915/i915_gem_gtt.c +++ b/drivers/gpu/drm/i915/i915_gem_gtt.c | |||
@@ -1902,6 +1902,22 @@ static void bdw_setup_private_ppat(struct drm_i915_private *dev_priv) | |||
1902 | GEN8_PPAT(6, GEN8_PPAT_WB | GEN8_PPAT_LLCELLC | GEN8_PPAT_AGE(2)) | | 1902 | GEN8_PPAT(6, GEN8_PPAT_WB | GEN8_PPAT_LLCELLC | GEN8_PPAT_AGE(2)) | |
1903 | GEN8_PPAT(7, GEN8_PPAT_WB | GEN8_PPAT_LLCELLC | GEN8_PPAT_AGE(3)); | 1903 | GEN8_PPAT(7, GEN8_PPAT_WB | GEN8_PPAT_LLCELLC | GEN8_PPAT_AGE(3)); |
1904 | 1904 | ||
1905 | if (!USES_PPGTT(dev_priv->dev)) | ||
1906 | /* Spec: "For GGTT, there is NO pat_sel[2:0] from the entry, | ||
1907 | * so RTL will always use the value corresponding to | ||
1908 | * pat_sel = 000". | ||
1909 | * So let's disable cache for GGTT to avoid screen corruptions. | ||
1910 | * MOCS still can be used though. | ||
1911 | * - System agent ggtt writes (i.e. cpu gtt mmaps) already work | ||
1912 | * before this patch, i.e. the same uncached + snooping access | ||
1913 | * like on gen6/7 seems to be in effect. | ||
1914 | * - So this just fixes blitter/render access. Again it looks | ||
1915 | * like it's not just uncached access, but uncached + snooping. | ||
1916 | * So we can still hold onto all our assumptions wrt cpu | ||
1917 | * clflushing on LLC machines. | ||
1918 | */ | ||
1919 | pat = GEN8_PPAT(0, GEN8_PPAT_UC); | ||
1920 | |||
1905 | /* XXX: spec defines this as 2 distinct registers. It's unclear if a 64b | 1921 | /* XXX: spec defines this as 2 distinct registers. It's unclear if a 64b |
1906 | * write would work. */ | 1922 | * write would work. */ |
1907 | I915_WRITE(GEN8_PRIVATE_PAT, pat); | 1923 | I915_WRITE(GEN8_PRIVATE_PAT, pat); |
diff --git a/drivers/gpu/drm/i915/intel_panel.c b/drivers/gpu/drm/i915/intel_panel.c index 0e018cb49147..41b3be217493 100644 --- a/drivers/gpu/drm/i915/intel_panel.c +++ b/drivers/gpu/drm/i915/intel_panel.c | |||
@@ -1098,12 +1098,25 @@ static u32 get_backlight_min_vbt(struct intel_connector *connector) | |||
1098 | struct drm_device *dev = connector->base.dev; | 1098 | struct drm_device *dev = connector->base.dev; |
1099 | struct drm_i915_private *dev_priv = dev->dev_private; | 1099 | struct drm_i915_private *dev_priv = dev->dev_private; |
1100 | struct intel_panel *panel = &connector->panel; | 1100 | struct intel_panel *panel = &connector->panel; |
1101 | int min; | ||
1101 | 1102 | ||
1102 | WARN_ON(panel->backlight.max == 0); | 1103 | WARN_ON(panel->backlight.max == 0); |
1103 | 1104 | ||
1105 | /* | ||
1106 | * XXX: If the vbt value is 255, it makes min equal to max, which leads | ||
1107 | * to problems. There are such machines out there. Either our | ||
1108 | * interpretation is wrong or the vbt has bogus data. Or both. Safeguard | ||
1109 | * against this by letting the minimum be at most (arbitrarily chosen) | ||
1110 | * 25% of the max. | ||
1111 | */ | ||
1112 | min = clamp_t(int, dev_priv->vbt.backlight.min_brightness, 0, 64); | ||
1113 | if (min != dev_priv->vbt.backlight.min_brightness) { | ||
1114 | DRM_DEBUG_KMS("clamping VBT min backlight %d/255 to %d/255\n", | ||
1115 | dev_priv->vbt.backlight.min_brightness, min); | ||
1116 | } | ||
1117 | |||
1104 | /* vbt value is a coefficient in range [0..255] */ | 1118 | /* vbt value is a coefficient in range [0..255] */ |
1105 | return scale(dev_priv->vbt.backlight.min_brightness, 0, 255, | 1119 | return scale(min, 0, 255, 0, panel->backlight.max); |
1106 | 0, panel->backlight.max); | ||
1107 | } | 1120 | } |
1108 | 1121 | ||
1109 | static int bdw_setup_backlight(struct intel_connector *connector) | 1122 | static int bdw_setup_backlight(struct intel_connector *connector) |