Commit d2f5e36d authored by Kumar, Mahesh's avatar Kumar, Mahesh Committed by Matt Roper

drm/i915/skl+: Perform wm level calculations in separate function

Instead of iterating over planes & wm levels in a single function use
skl_compute_wm_level function to interate over WM levels.
Change name of function to skl_compute_wm_levels (Matt).

These changes are to clean-up WM code & will help in making only new
ddb algorithm related changes in later patch in series.
Signed-off-by: default avatarMahesh Kumar <mahesh1.kumar@intel.com>
Reviewed-by: default avatarMatt Roper <matthew.d.roper@intel.com>
Reviewed-by: default avatarMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
Signed-off-by: default avatarMatt Roper <matthew.d.roper@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20170517115831.13830-10-mahesh1.kumar@intel.com
parent eb2fdcdf
...@@ -4382,18 +4382,18 @@ static int skl_compute_plane_wm(const struct drm_i915_private *dev_priv, ...@@ -4382,18 +4382,18 @@ static int skl_compute_plane_wm(const struct drm_i915_private *dev_priv,
} }
static int static int
skl_compute_wm_level(const struct drm_i915_private *dev_priv, skl_compute_wm_levels(const struct drm_i915_private *dev_priv,
struct skl_ddb_allocation *ddb, struct skl_ddb_allocation *ddb,
struct intel_crtc_state *cstate, struct intel_crtc_state *cstate,
const struct intel_plane_state *intel_pstate, const struct intel_plane_state *intel_pstate,
int level, struct skl_plane_wm *wm)
struct skl_wm_level *result)
{ {
struct intel_crtc *intel_crtc = to_intel_crtc(cstate->base.crtc); struct intel_crtc *intel_crtc = to_intel_crtc(cstate->base.crtc);
struct drm_plane *plane = intel_pstate->base.plane; struct drm_plane *plane = intel_pstate->base.plane;
struct intel_plane *intel_plane = to_intel_plane(plane); struct intel_plane *intel_plane = to_intel_plane(plane);
uint16_t ddb_blocks; uint16_t ddb_blocks;
enum pipe pipe = intel_crtc->pipe; enum pipe pipe = intel_crtc->pipe;
int level, max_level = ilk_wm_max_level(dev_priv);
int ret; int ret;
if (WARN_ON(!intel_pstate->base.fb)) if (WARN_ON(!intel_pstate->base.fb))
...@@ -4401,6 +4401,9 @@ skl_compute_wm_level(const struct drm_i915_private *dev_priv, ...@@ -4401,6 +4401,9 @@ skl_compute_wm_level(const struct drm_i915_private *dev_priv,
ddb_blocks = skl_ddb_entry_size(&ddb->plane[pipe][intel_plane->id]); ddb_blocks = skl_ddb_entry_size(&ddb->plane[pipe][intel_plane->id]);
for (level = 0; level <= max_level; level++) {
struct skl_wm_level *result = &wm->wm[level];
ret = skl_compute_plane_wm(dev_priv, ret = skl_compute_plane_wm(dev_priv,
cstate, cstate,
intel_pstate, intel_pstate,
...@@ -4411,6 +4414,7 @@ skl_compute_wm_level(const struct drm_i915_private *dev_priv, ...@@ -4411,6 +4414,7 @@ skl_compute_wm_level(const struct drm_i915_private *dev_priv,
&result->plane_en); &result->plane_en);
if (ret) if (ret)
return ret; return ret;
}
return 0; return 0;
} }
...@@ -4461,7 +4465,6 @@ static int skl_build_pipe_wm(struct intel_crtc_state *cstate, ...@@ -4461,7 +4465,6 @@ static int skl_build_pipe_wm(struct intel_crtc_state *cstate,
struct drm_plane *plane; struct drm_plane *plane;
const struct drm_plane_state *pstate; const struct drm_plane_state *pstate;
struct skl_plane_wm *wm; struct skl_plane_wm *wm;
int level, max_level = ilk_wm_max_level(dev_priv);
int ret; int ret;
/* /*
...@@ -4477,13 +4480,10 @@ static int skl_build_pipe_wm(struct intel_crtc_state *cstate, ...@@ -4477,13 +4480,10 @@ static int skl_build_pipe_wm(struct intel_crtc_state *cstate,
wm = &pipe_wm->planes[plane_id]; wm = &pipe_wm->planes[plane_id];
for (level = 0; level <= max_level; level++) { ret = skl_compute_wm_levels(dev_priv, ddb, cstate,
ret = skl_compute_wm_level(dev_priv, ddb, cstate, intel_pstate, wm);
intel_pstate, level,
&wm->wm[level]);
if (ret) if (ret)
return ret; return ret;
}
skl_compute_transition_wm(cstate, &wm->trans_wm); skl_compute_transition_wm(cstate, &wm->trans_wm);
} }
pipe_wm->linetime = skl_compute_linetime_wm(cstate); pipe_wm->linetime = skl_compute_linetime_wm(cstate);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment