aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaulo Zanoni <paulo.r.zanoni@intel.com>2016-10-07 16:28:57 -0400
committerJani Nikula <jani.nikula@intel.com>2016-10-28 08:20:15 -0400
commit5e33791e1f27c3207e7b44071e7c94a487d1eb39 (patch)
treed4d18758b6b9d51fb3a0dc78bbf3df8a71572375
parentfd58753ead86ee289ea89fe26e1842f36e54b36c (diff)
drm/i915/gen9: fix watermarks when using the pipe scaler
Luckily, the necessary adjustments for when we're using the scaler are exactly the same as the ones needed on ILK+, so just reuse the function we already have. v2: Invert the patch order so stable backports get easier. Cc: stable@vger.kernel.org Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com> Reviewed-by: Matt Roper <matthew.d.roper@intel.com> Link: http://patchwork.freedesktop.org/patch/msgid/1475872138-16194-1-git-send-email-paulo.r.zanoni@intel.com (cherry picked from commit cfd7e3a20251b9ac95651d64556f87f86128a966) Signed-off-by: Jani Nikula <jani.nikula@intel.com>
-rw-r--r--drivers/gpu/drm/i915/intel_pm.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
index 1a11ab87ec5d..db24f898853c 100644
--- a/drivers/gpu/drm/i915/intel_pm.c
+++ b/drivers/gpu/drm/i915/intel_pm.c
@@ -3470,12 +3470,6 @@ skl_allocate_pipe_ddb(struct intel_crtc_state *cstate,
3470 return 0; 3470 return 0;
3471} 3471}
3472 3472
3473static uint32_t skl_pipe_pixel_rate(const struct intel_crtc_state *config)
3474{
3475 /* TODO: Take into account the scalers once we support them */
3476 return config->base.adjusted_mode.crtc_clock;
3477}
3478
3479/* 3473/*
3480 * The max latency should be 257 (max the punit can code is 255 and we add 2us 3474 * The max latency should be 257 (max the punit can code is 255 and we add 2us
3481 * for the read latency) and cpp should always be <= 8, so that 3475 * for the read latency) and cpp should always be <= 8, so that
@@ -3526,7 +3520,7 @@ static uint32_t skl_adjusted_plane_pixel_rate(const struct intel_crtc_state *cst
3526 * Adjusted plane pixel rate is just the pipe's adjusted pixel rate 3520 * Adjusted plane pixel rate is just the pipe's adjusted pixel rate
3527 * with additional adjustments for plane-specific scaling. 3521 * with additional adjustments for plane-specific scaling.
3528 */ 3522 */
3529 adjusted_pixel_rate = skl_pipe_pixel_rate(cstate); 3523 adjusted_pixel_rate = ilk_pipe_pixel_rate(cstate);
3530 downscale_amount = skl_plane_downscale_amount(pstate); 3524 downscale_amount = skl_plane_downscale_amount(pstate);
3531 3525
3532 pixel_rate = adjusted_pixel_rate * downscale_amount >> 16; 3526 pixel_rate = adjusted_pixel_rate * downscale_amount >> 16;
@@ -3738,11 +3732,11 @@ skl_compute_linetime_wm(struct intel_crtc_state *cstate)
3738 if (!cstate->base.active) 3732 if (!cstate->base.active)
3739 return 0; 3733 return 0;
3740 3734
3741 if (WARN_ON(skl_pipe_pixel_rate(cstate) == 0)) 3735 if (WARN_ON(ilk_pipe_pixel_rate(cstate) == 0))
3742 return 0; 3736 return 0;
3743 3737
3744 return DIV_ROUND_UP(8 * cstate->base.adjusted_mode.crtc_htotal * 1000, 3738 return DIV_ROUND_UP(8 * cstate->base.adjusted_mode.crtc_htotal * 1000,
3745 skl_pipe_pixel_rate(cstate)); 3739 ilk_pipe_pixel_rate(cstate));
3746} 3740}
3747 3741
3748static void skl_compute_transition_wm(struct intel_crtc_state *cstate, 3742static void skl_compute_transition_wm(struct intel_crtc_state *cstate,