OSDN Git Service

drm/i915/skl+: pass skl_wm_level struct to wm compute func
authorMahesh Kumar <mahesh1.kumar@intel.com>
Mon, 9 Apr 2018 03:41:05 +0000 (09:11 +0530)
committerMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
Mon, 9 Apr 2018 11:37:28 +0000 (13:37 +0200)
This patch passes skl_wm_level structure itself to watermark
computation function skl_compute_plane_wm function (instead
of its internal parameters). It reduces number of arguments
required to be passed.

v2: Addressed review comments by Shashank Sharma

v3: Adding reviewed by tag from Shashank Sharma

v4: Added reviewed by from Juha-Pekka Heikkila

v5: Rebased the series

Reviewed-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Shashank Sharma <shashank.sharma@intel.com>
Signed-off-by: Mahesh Kumar <mahesh1.kumar@intel.com>
Signed-off-by: Vidya Srinivas <vidya.srinivas@intel.com>
Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/1523245273-30264-7-git-send-email-vidya.srinivas@intel.com
drivers/gpu/drm/i915/intel_pm.c

index fb30efa..06352c9 100644 (file)
@@ -4529,9 +4529,7 @@ static int skl_compute_plane_wm(const struct drm_i915_private *dev_priv,
                                uint16_t ddb_allocation,
                                int level,
                                const struct skl_wm_params *wp,
-                               uint16_t *out_blocks, /* out */
-                               uint8_t *out_lines, /* out */
-                               bool *enabled /* out */)
+                               struct skl_wm_level *result /* out */)
 {
        const struct drm_plane_state *pstate = &intel_pstate->base;
        uint32_t latency = dev_priv->wm.skl_latency[level];
@@ -4545,7 +4543,7 @@ static int skl_compute_plane_wm(const struct drm_i915_private *dev_priv,
 
        if (latency == 0 ||
            !intel_wm_plane_visible(cstate, intel_pstate)) {
-               *enabled = false;
+               result->plane_en = false;
                return 0;
        }
 
@@ -4626,7 +4624,7 @@ static int skl_compute_plane_wm(const struct drm_i915_private *dev_priv,
        if ((level > 0 && res_lines > 31) ||
            res_blocks >= ddb_allocation ||
            min_disp_buf_needed >= ddb_allocation) {
-               *enabled = false;
+               result->plane_en = false;
 
                /*
                 * If there are no valid level 0 watermarks, then we can't
@@ -4646,9 +4644,9 @@ static int skl_compute_plane_wm(const struct drm_i915_private *dev_priv,
        }
 
        /* The number of lines are ignored for the level 0 watermark. */
-       *out_lines = level ? res_lines : 0;
-       *out_blocks = res_blocks;
-       *enabled = true;
+       result->plane_res_b = res_blocks;
+       result->plane_res_l = res_lines;
+       result->plane_en = true;
 
        return 0;
 }
@@ -4688,9 +4686,7 @@ skl_compute_wm_levels(const struct drm_i915_private *dev_priv,
                                           ddb_blocks,
                                           level,
                                           wm_params,
-                                          &result->plane_res_b,
-                                          &result->plane_res_l,
-                                          &result->plane_en);
+                                          result);
                if (ret)
                        return ret;
        }