diff options
Diffstat (limited to 'drivers/gpu/drm/i915/intel_pm.c')
-rw-r--r-- | drivers/gpu/drm/i915/intel_pm.c | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c index eb5fa05cf476..b28c29f20e75 100644 --- a/drivers/gpu/drm/i915/intel_pm.c +++ b/drivers/gpu/drm/i915/intel_pm.c | |||
@@ -1783,16 +1783,20 @@ static uint32_t ilk_compute_cur_wm(const struct intel_crtc_state *cstate, | |||
1783 | const struct intel_plane_state *pstate, | 1783 | const struct intel_plane_state *pstate, |
1784 | uint32_t mem_value) | 1784 | uint32_t mem_value) |
1785 | { | 1785 | { |
1786 | int bpp = pstate->base.fb ? pstate->base.fb->bits_per_pixel / 8 : 0; | 1786 | /* |
1787 | * We treat the cursor plane as always-on for the purposes of watermark | ||
1788 | * calculation. Until we have two-stage watermark programming merged, | ||
1789 | * this is necessary to avoid flickering. | ||
1790 | */ | ||
1791 | int cpp = 4; | ||
1792 | int width = pstate->visible ? pstate->base.crtc_w : 64; | ||
1787 | 1793 | ||
1788 | if (!cstate->base.active || !pstate->visible) | 1794 | if (!cstate->base.active) |
1789 | return 0; | 1795 | return 0; |
1790 | 1796 | ||
1791 | return ilk_wm_method2(ilk_pipe_pixel_rate(cstate), | 1797 | return ilk_wm_method2(ilk_pipe_pixel_rate(cstate), |
1792 | cstate->base.adjusted_mode.crtc_htotal, | 1798 | cstate->base.adjusted_mode.crtc_htotal, |
1793 | drm_rect_width(&pstate->dst), | 1799 | width, cpp, mem_value); |
1794 | bpp, | ||
1795 | mem_value); | ||
1796 | } | 1800 | } |
1797 | 1801 | ||
1798 | /* Only for WM_LP. */ | 1802 | /* Only for WM_LP. */ |
@@ -2825,7 +2829,10 @@ void skl_ddb_get_hw_state(struct drm_i915_private *dev_priv, | |||
2825 | memset(ddb, 0, sizeof(*ddb)); | 2829 | memset(ddb, 0, sizeof(*ddb)); |
2826 | 2830 | ||
2827 | for_each_pipe(dev_priv, pipe) { | 2831 | for_each_pipe(dev_priv, pipe) { |
2828 | if (!intel_display_power_is_enabled(dev_priv, POWER_DOMAIN_PIPE(pipe))) | 2832 | enum intel_display_power_domain power_domain; |
2833 | |||
2834 | power_domain = POWER_DOMAIN_PIPE(pipe); | ||
2835 | if (!intel_display_power_get_if_enabled(dev_priv, power_domain)) | ||
2829 | continue; | 2836 | continue; |
2830 | 2837 | ||
2831 | for_each_plane(dev_priv, pipe, plane) { | 2838 | for_each_plane(dev_priv, pipe, plane) { |
@@ -2837,6 +2844,8 @@ void skl_ddb_get_hw_state(struct drm_i915_private *dev_priv, | |||
2837 | val = I915_READ(CUR_BUF_CFG(pipe)); | 2844 | val = I915_READ(CUR_BUF_CFG(pipe)); |
2838 | skl_ddb_entry_init_from_hw(&ddb->plane[pipe][PLANE_CURSOR], | 2845 | skl_ddb_entry_init_from_hw(&ddb->plane[pipe][PLANE_CURSOR], |
2839 | val); | 2846 | val); |
2847 | |||
2848 | intel_display_power_put(dev_priv, power_domain); | ||
2840 | } | 2849 | } |
2841 | } | 2850 | } |
2842 | 2851 | ||