drm/i915/skl+: unify cpp value in WM calculation
authorKumar, Mahesh <mahesh1.kumar@intel.com>
Wed, 5 Jul 2017 14:31:49 +0000 (20:01 +0530)
committerMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
Thu, 13 Jul 2017 14:39:09 +0000 (16:39 +0200)
use same cpp value in different phase of plane WM caluclation.

Signed-off-by: Mahesh Kumar <mahesh1.kumar@intel.com>
Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20170705143154.32132-7-mahesh1.kumar@intel.com
drivers/gpu/drm/i915/intel_pm.c

index 81e77f073d8cbcec9f6019a84bf57394af280250..ee2a349cfe680e77e7eeb129b0eebd7965f051e5 100644 (file)
@@ -4399,13 +4399,11 @@ static int skl_compute_plane_wm(const struct drm_i915_private *dev_priv,
                width = drm_rect_width(&intel_pstate->base.src) >> 16;
        }
 
-       cpp = fb->format->cpp[0];
+       cpp = (fb->format->format == DRM_FORMAT_NV12) ? fb->format->cpp[1] :
+                                                       fb->format->cpp[0];
        plane_pixel_rate = skl_adjusted_plane_pixel_rate(cstate, intel_pstate);
 
        if (drm_rotation_90_or_270(pstate->rotation)) {
-               int cpp = (fb->format->format == DRM_FORMAT_NV12) ?
-                       fb->format->cpp[1] :
-                       fb->format->cpp[0];
 
                switch (cpp) {
                case 1: