From: Ville Syrjälä Date: Thu, 25 Mar 2021 00:44:15 +0000 (+0200) Subject: drm/i915: Stop adding planes to the commit needlessly X-Git-Tag: accepted/tizen/unified/20230118.172025~6402^2~29^2~277 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=67f6f52af4566192a9b087986b3ddcc33e817d72;p=platform%2Fkernel%2Flinux-rpi.git drm/i915: Stop adding planes to the commit needlessly The dbuf bandwidth calculations don't need the planes to be added to the state. Each plane's data rate has already been precalculated and stored in the crtc state, and that with the dbuf slice usage for each plane is all the dbuf bandwidth code needs to figure out what the minimum cdclk is. What we're trying to do here is make sure each plane recalculates its minimum cdclk (ie. plane->min_cdclk()) on those platforms where the number of active planes affects the result of said calculation. Nothing to do with any dbuf cdclk requirements. Not sure if we had stuff in slightly different order or what, but at least in the current scheme this is not necessary. Cc: Stanislav Lisovskiy Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20210325004415.17432-2-ville.syrjala@linux.intel.com Reviewed-by: Stanislav Lisovskiy --- diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c index bde9cc4..984d38e 100644 --- a/drivers/gpu/drm/i915/display/intel_display.c +++ b/drivers/gpu/drm/i915/display/intel_display.c @@ -9783,7 +9783,7 @@ static bool active_planes_affects_min_cdclk(struct drm_i915_private *dev_priv) /* See {hsw,vlv,ivb}_plane_ratio() */ return IS_BROADWELL(dev_priv) || IS_HASWELL(dev_priv) || IS_CHERRYVIEW(dev_priv) || IS_VALLEYVIEW(dev_priv) || - IS_IVYBRIDGE(dev_priv) || (DISPLAY_VER(dev_priv) >= 11); + IS_IVYBRIDGE(dev_priv); } static int intel_crtc_add_bigjoiner_planes(struct intel_atomic_state *state, @@ -9870,13 +9870,7 @@ static int intel_atomic_check_planes(struct intel_atomic_state *state) old_active_planes = old_crtc_state->active_planes & ~BIT(PLANE_CURSOR); new_active_planes = new_crtc_state->active_planes & ~BIT(PLANE_CURSOR); - /* - * Not only the number of planes, but if the plane configuration had - * changed might already mean we need to recompute min CDCLK, - * because different planes might consume different amount of Dbuf bandwidth - * according to formula: Bw per plane = Pixel rate * bpp * pipe/plane scale factor - */ - if (old_active_planes == new_active_planes) + if (hweight8(old_active_planes) == hweight8(new_active_planes)) continue; ret = intel_crtc_add_planes_to_state(state, crtc, new_active_planes);