public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
* [PATCH] drm/i915: Fix skl plane scaling for planner YUV buffers
@ 2019-05-08 12:04 Shashank Sharma
  2019-05-08 12:57 ` ✗ Fi.CI.SPARSE: warning for " Patchwork
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Shashank Sharma @ 2019-05-08 12:04 UTC (permalink / raw)
  To: intel-gfx; +Cc: Lukas Rusak, Juha-pekka Heikkila, Maarten Lankhorst

From: Lukas Rusak <lorusak@gmail.com>

Plane scaling for YUV planar formats should be max 2 times.

Cc: Maarten Lankhorst <maarten.lankhorst@intel.com>
Cc: Juha-pekka Heikkila <juha-pekka.heikkila@intel.com>
Cc: Shashank Sharma <shashank.sharma@intel.com>

Signed-off-by: Lukas Rusak <lorusak@gmail.com>
---
 drivers/gpu/drm/i915/intel_display.c | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index a351c8e219ba..2ac0a55a9c9f 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -13897,7 +13897,7 @@ skl_max_scale(const struct intel_crtc_state *crtc_state,
 {
 	struct intel_crtc *crtc = to_intel_crtc(crtc_state->base.crtc);
 	struct drm_i915_private *dev_priv = to_i915(crtc->base.dev);
-	int max_scale, mult;
+	int max_scale, mult, remainder;
 	int crtc_clock, max_dotclk, tmpclk1, tmpclk2;
 
 	if (!crtc_state->base.enable)
@@ -13914,12 +13914,15 @@ skl_max_scale(const struct intel_crtc_state *crtc_state,
 
 	/*
 	 * skl max scale is lower of:
-	 *    close to 3 but not 3, -1 is for that purpose
-	 *            or
-	 *    cdclk/crtc_clock
+	 * for planar YUV formats: 2
+	 *	or
+	 * for other formats: close to 3 but not 3, -1 is for that purpose
+	 *	or
+	 * cdclk/crtc_clock
 	 */
 	mult = is_planar_yuv_format(pixel_format) ? 2 : 3;
-	tmpclk1 = (1 << 16) * mult - 1;
+	remainder = is_planar_yuv_format(pixel_format) ? 0 : 1;
+	tmpclk1 = (1 << 16) * mult - remainder;
 	tmpclk2 = (1 << 8) * ((max_dotclk << 8) / crtc_clock);
 	max_scale = min(tmpclk1, tmpclk2);
 
-- 
2.17.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2019-05-08 16:54 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-05-08 12:04 [PATCH] drm/i915: Fix skl plane scaling for planner YUV buffers Shashank Sharma
2019-05-08 12:57 ` ✗ Fi.CI.SPARSE: warning for " Patchwork
2019-05-08 13:26 ` ✓ Fi.CI.BAT: success " Patchwork
2019-05-08 13:56 ` [PATCH] " Ville Syrjälä
2019-05-08 16:54 ` ✓ Fi.CI.IGT: success for " Patchwork

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox