aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Airlie <airlied@gmail.com>2015-11-07 02:16:59 -0500
committerDave Airlie <airlied@gmail.com>2015-11-07 02:16:59 -0500
commit816d2206f0f9953ca854e4ff1a2749a5cbd62715 (patch)
tree26b8a56c4656a8794911c31246061bfe05d9cd9b
parentd0baf9218cacd9dd606c75f9961f94172b16de12 (diff)
parent1b0e3a049efe471c399674fd954500ce97438d30 (diff)
Merge tag 'drm-intel-next-fixes-2015-11-06' of git://anongit.freedesktop.org/drm-intel into drm-next
Here's a handful of i915 fixes for drm-next/v4.4. Imre's commit alone should address the remaining warnings galore you experienced on Skylake. Almost all of the rest are also fixes against user or QA reported bugs, with references. * tag 'drm-intel-next-fixes-2015-11-06' of git://anongit.freedesktop.org/drm-intel: drm/i915/skl: disable display side power well support for now drm/i915: Extend DSL readout fix to BDW and SKL. drm/i915: Do graphics device reset under forcewake drm/i915: Skip fence installation for objects with rotated views (v4) drm/i915: add quirk to enable backlight on Dell Chromebook 11 (2015) drm/i915/skl: Prevent unclaimed register writes on skylake. drm/i915: disable CPU PWM also on LPT/SPT backlight disable drm/i915: Fix maxfifo watermark calc on vlv cursor planes drm/i915: add hotplug activation period to hotplug update mask
-rw-r--r--drivers/gpu/drm/i915/i915_irq.c9
-rw-r--r--drivers/gpu/drm/i915/i915_params.c5
-rw-r--r--drivers/gpu/drm/i915/intel_display.c39
-rw-r--r--drivers/gpu/drm/i915/intel_panel.c14
-rw-r--r--drivers/gpu/drm/i915/intel_pm.c7
-rw-r--r--drivers/gpu/drm/i915/intel_runtime_pm.c18
-rw-r--r--drivers/gpu/drm/i915/intel_uncore.c11
7 files changed, 79 insertions, 24 deletions
diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c
index d68328fa175b..0d228f909dcb 100644
--- a/drivers/gpu/drm/i915/i915_irq.c
+++ b/drivers/gpu/drm/i915/i915_irq.c
@@ -749,7 +749,7 @@ static int __intel_get_crtc_scanline(struct intel_crtc *crtc)
749 * problem. We may need to extend this to include other platforms, 749 * problem. We may need to extend this to include other platforms,
750 * but so far testing only shows the problem on HSW. 750 * but so far testing only shows the problem on HSW.
751 */ 751 */
752 if (IS_HASWELL(dev) && !position) { 752 if (HAS_DDI(dev) && !position) {
753 int i, temp; 753 int i, temp;
754 754
755 for (i = 0; i < 100; i++) { 755 for (i = 0; i < 100; i++) {
@@ -4236,9 +4236,10 @@ static void i915_hpd_irq_setup(struct drm_device *dev)
4236 4236
4237 /* Ignore TV since it's buggy */ 4237 /* Ignore TV since it's buggy */
4238 i915_hotplug_interrupt_update_locked(dev_priv, 4238 i915_hotplug_interrupt_update_locked(dev_priv,
4239 (HOTPLUG_INT_EN_MASK 4239 HOTPLUG_INT_EN_MASK |
4240 | CRT_HOTPLUG_VOLTAGE_COMPARE_MASK), 4240 CRT_HOTPLUG_VOLTAGE_COMPARE_MASK |
4241 hotplug_en); 4241 CRT_HOTPLUG_ACTIVATION_PERIOD_64,
4242 hotplug_en);
4242} 4243}
4243 4244
4244static irqreturn_t i965_irq_handler(int irq, void *arg) 4245static irqreturn_t i965_irq_handler(int irq, void *arg)
diff --git a/drivers/gpu/drm/i915/i915_params.c b/drivers/gpu/drm/i915/i915_params.c
index ca9b8f644ffe..96bb23865eac 100644
--- a/drivers/gpu/drm/i915/i915_params.c
+++ b/drivers/gpu/drm/i915/i915_params.c
@@ -38,7 +38,7 @@ struct i915_params i915 __read_mostly = {
38 .enable_ppgtt = -1, 38 .enable_ppgtt = -1,
39 .enable_psr = 0, 39 .enable_psr = 0,
40 .preliminary_hw_support = IS_ENABLED(CONFIG_DRM_I915_PRELIMINARY_HW_SUPPORT), 40 .preliminary_hw_support = IS_ENABLED(CONFIG_DRM_I915_PRELIMINARY_HW_SUPPORT),
41 .disable_power_well = 1, 41 .disable_power_well = -1,
42 .enable_ips = 1, 42 .enable_ips = 1,
43 .prefault_disable = 0, 43 .prefault_disable = 0,
44 .load_detect_test = 0, 44 .load_detect_test = 0,
@@ -127,7 +127,8 @@ MODULE_PARM_DESC(preliminary_hw_support,
127 127
128module_param_named_unsafe(disable_power_well, i915.disable_power_well, int, 0600); 128module_param_named_unsafe(disable_power_well, i915.disable_power_well, int, 0600);
129MODULE_PARM_DESC(disable_power_well, 129MODULE_PARM_DESC(disable_power_well,
130 "Disable the power well when possible (default: true)"); 130 "Disable display power wells when possible "
131 "(-1=auto [default], 0=power wells always on, 1=power wells disabled when possible)");
131 132
132module_param_named_unsafe(enable_ips, i915.enable_ips, int, 0600); 133module_param_named_unsafe(enable_ips, i915.enable_ips, int, 0600);
133MODULE_PARM_DESC(enable_ips, "Enable IPS (default: true)"); 134MODULE_PARM_DESC(enable_ips, "Enable IPS (default: true)");
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 82128b95785c..6795df562341 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -2389,22 +2389,24 @@ intel_pin_and_fence_fb_obj(struct drm_plane *plane,
2389 * framebuffer compression. For simplicity, we always install 2389 * framebuffer compression. For simplicity, we always install
2390 * a fence as the cost is not that onerous. 2390 * a fence as the cost is not that onerous.
2391 */ 2391 */
2392 ret = i915_gem_object_get_fence(obj); 2392 if (view.type == I915_GGTT_VIEW_NORMAL) {
2393 if (ret == -EDEADLK) { 2393 ret = i915_gem_object_get_fence(obj);
2394 /* 2394 if (ret == -EDEADLK) {
2395 * -EDEADLK means there are no free fences 2395 /*
2396 * no pending flips. 2396 * -EDEADLK means there are no free fences
2397 * 2397 * no pending flips.
2398 * This is propagated to atomic, but it uses 2398 *
2399 * -EDEADLK to force a locking recovery, so 2399 * This is propagated to atomic, but it uses
2400 * change the returned error to -EBUSY. 2400 * -EDEADLK to force a locking recovery, so
2401 */ 2401 * change the returned error to -EBUSY.
2402 ret = -EBUSY; 2402 */
2403 goto err_unpin; 2403 ret = -EBUSY;
2404 } else if (ret) 2404 goto err_unpin;
2405 goto err_unpin; 2405 } else if (ret)
2406 goto err_unpin;
2406 2407
2407 i915_gem_object_pin_fence(obj); 2408 i915_gem_object_pin_fence(obj);
2409 }
2408 2410
2409 dev_priv->mm.interruptible = true; 2411 dev_priv->mm.interruptible = true;
2410 intel_runtime_pm_put(dev_priv); 2412 intel_runtime_pm_put(dev_priv);
@@ -2430,7 +2432,9 @@ static void intel_unpin_fb_obj(struct drm_framebuffer *fb,
2430 ret = intel_fill_fb_ggtt_view(&view, fb, plane_state); 2432 ret = intel_fill_fb_ggtt_view(&view, fb, plane_state);
2431 WARN_ONCE(ret, "Couldn't get view from plane state!"); 2433 WARN_ONCE(ret, "Couldn't get view from plane state!");
2432 2434
2433 i915_gem_object_unpin_fence(obj); 2435 if (view.type == I915_GGTT_VIEW_NORMAL)
2436 i915_gem_object_unpin_fence(obj);
2437
2434 i915_gem_object_unpin_from_display_plane(obj, &view); 2438 i915_gem_object_unpin_from_display_plane(obj, &view);
2435} 2439}
2436 2440
@@ -14695,6 +14699,9 @@ static struct intel_quirk intel_quirks[] = {
14695 14699
14696 /* Dell Chromebook 11 */ 14700 /* Dell Chromebook 11 */
14697 { 0x0a06, 0x1028, 0x0a35, quirk_backlight_present }, 14701 { 0x0a06, 0x1028, 0x0a35, quirk_backlight_present },
14702
14703 /* Dell Chromebook 11 (2015 version) */
14704 { 0x0a16, 0x1028, 0x0a35, quirk_backlight_present },
14698}; 14705};
14699 14706
14700static void intel_init_quirks(struct drm_device *dev) 14707static void intel_init_quirks(struct drm_device *dev)
diff --git a/drivers/gpu/drm/i915/intel_panel.c b/drivers/gpu/drm/i915/intel_panel.c
index b05c6d9b3be7..a24df35e11e7 100644
--- a/drivers/gpu/drm/i915/intel_panel.c
+++ b/drivers/gpu/drm/i915/intel_panel.c
@@ -732,6 +732,20 @@ static void lpt_disable_backlight(struct intel_connector *connector)
732 732
733 intel_panel_actually_set_backlight(connector, 0); 733 intel_panel_actually_set_backlight(connector, 0);
734 734
735 /*
736 * Although we don't support or enable CPU PWM with LPT/SPT based
737 * systems, it may have been enabled prior to loading the
738 * driver. Disable to avoid warnings on LCPLL disable.
739 *
740 * This needs rework if we need to add support for CPU PWM on PCH split
741 * platforms.
742 */
743 tmp = I915_READ(BLC_PWM_CPU_CTL2);
744 if (tmp & BLM_PWM_ENABLE) {
745 DRM_DEBUG_KMS("cpu backlight was enabled, disabling\n");
746 I915_WRITE(BLC_PWM_CPU_CTL2, tmp & ~BLM_PWM_ENABLE);
747 }
748
735 tmp = I915_READ(BLC_PWM_PCH_CTL1); 749 tmp = I915_READ(BLC_PWM_PCH_CTL1);
736 I915_WRITE(BLC_PWM_PCH_CTL1, tmp & ~BLM_PCH_PWM_ENABLE); 750 I915_WRITE(BLC_PWM_PCH_CTL1, tmp & ~BLM_PCH_PWM_ENABLE);
737} 751}
diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
index 9dda3eaebd12..d52a15df6917 100644
--- a/drivers/gpu/drm/i915/intel_pm.c
+++ b/drivers/gpu/drm/i915/intel_pm.c
@@ -1135,7 +1135,7 @@ static void vlv_compute_wm(struct intel_crtc *crtc)
1135 case DRM_PLANE_TYPE_CURSOR: 1135 case DRM_PLANE_TYPE_CURSOR:
1136 for (level = 0; level < wm_state->num_levels; level++) 1136 for (level = 0; level < wm_state->num_levels; level++)
1137 wm_state->sr[level].cursor = 1137 wm_state->sr[level].cursor =
1138 wm_state->sr[level].cursor; 1138 wm_state->wm[level].cursor;
1139 break; 1139 break;
1140 case DRM_PLANE_TYPE_PRIMARY: 1140 case DRM_PLANE_TYPE_PRIMARY:
1141 for (level = 0; level < wm_state->num_levels; level++) 1141 for (level = 0; level < wm_state->num_levels; level++)
@@ -2818,7 +2818,12 @@ void skl_ddb_get_hw_state(struct drm_i915_private *dev_priv,
2818 int plane; 2818 int plane;
2819 u32 val; 2819 u32 val;
2820 2820
2821 memset(ddb, 0, sizeof(*ddb));
2822
2821 for_each_pipe(dev_priv, pipe) { 2823 for_each_pipe(dev_priv, pipe) {
2824 if (!intel_display_power_is_enabled(dev_priv, POWER_DOMAIN_PIPE(pipe)))
2825 continue;
2826
2822 for_each_plane(dev_priv, pipe, plane) { 2827 for_each_plane(dev_priv, pipe, plane) {
2823 val = I915_READ(PLANE_BUF_CFG(pipe, plane)); 2828 val = I915_READ(PLANE_BUF_CFG(pipe, plane));
2824 skl_ddb_entry_init_from_hw(&ddb->plane[pipe][plane], 2829 skl_ddb_entry_init_from_hw(&ddb->plane[pipe][plane],
diff --git a/drivers/gpu/drm/i915/intel_runtime_pm.c b/drivers/gpu/drm/i915/intel_runtime_pm.c
index ec010ee74050..d89c1d0aa1b7 100644
--- a/drivers/gpu/drm/i915/intel_runtime_pm.c
+++ b/drivers/gpu/drm/i915/intel_runtime_pm.c
@@ -1811,6 +1811,21 @@ static struct i915_power_well bxt_power_wells[] = {
1811 } 1811 }
1812}; 1812};
1813 1813
1814static int
1815sanitize_disable_power_well_option(const struct drm_i915_private *dev_priv,
1816 int disable_power_well)
1817{
1818 if (disable_power_well >= 0)
1819 return !!disable_power_well;
1820
1821 if (IS_SKYLAKE(dev_priv)) {
1822 DRM_DEBUG_KMS("Disabling display power well support\n");
1823 return 0;
1824 }
1825
1826 return 1;
1827}
1828
1814#define set_power_wells(power_domains, __power_wells) ({ \ 1829#define set_power_wells(power_domains, __power_wells) ({ \
1815 (power_domains)->power_wells = (__power_wells); \ 1830 (power_domains)->power_wells = (__power_wells); \
1816 (power_domains)->power_well_count = ARRAY_SIZE(__power_wells); \ 1831 (power_domains)->power_well_count = ARRAY_SIZE(__power_wells); \
@@ -1827,6 +1842,9 @@ int intel_power_domains_init(struct drm_i915_private *dev_priv)
1827{ 1842{
1828 struct i915_power_domains *power_domains = &dev_priv->power_domains; 1843 struct i915_power_domains *power_domains = &dev_priv->power_domains;
1829 1844
1845 i915.disable_power_well = sanitize_disable_power_well_option(dev_priv,
1846 i915.disable_power_well);
1847
1830 mutex_init(&power_domains->lock); 1848 mutex_init(&power_domains->lock);
1831 1849
1832 /* 1850 /*
diff --git a/drivers/gpu/drm/i915/intel_uncore.c b/drivers/gpu/drm/i915/intel_uncore.c
index 1663ea55e37c..43cba129a0c0 100644
--- a/drivers/gpu/drm/i915/intel_uncore.c
+++ b/drivers/gpu/drm/i915/intel_uncore.c
@@ -1531,13 +1531,22 @@ static int (*intel_get_gpu_reset(struct drm_device *dev))(struct drm_device *)
1531 1531
1532int intel_gpu_reset(struct drm_device *dev) 1532int intel_gpu_reset(struct drm_device *dev)
1533{ 1533{
1534 struct drm_i915_private *dev_priv = to_i915(dev);
1534 int (*reset)(struct drm_device *); 1535 int (*reset)(struct drm_device *);
1536 int ret;
1535 1537
1536 reset = intel_get_gpu_reset(dev); 1538 reset = intel_get_gpu_reset(dev);
1537 if (reset == NULL) 1539 if (reset == NULL)
1538 return -ENODEV; 1540 return -ENODEV;
1539 1541
1540 return reset(dev); 1542 /* If the power well sleeps during the reset, the reset
1543 * request may be dropped and never completes (causing -EIO).
1544 */
1545 intel_uncore_forcewake_get(dev_priv, FORCEWAKE_ALL);
1546 ret = reset(dev);
1547 intel_uncore_forcewake_put(dev_priv, FORCEWAKE_ALL);
1548
1549 return ret;
1541} 1550}
1542 1551
1543bool intel_has_gpu_reset(struct drm_device *dev) 1552bool intel_has_gpu_reset(struct drm_device *dev)