Skip to content

Commit

Permalink
drm/i915/skl: Rework when the transition WMs are computed
Browse files Browse the repository at this point in the history
The transition WMs code was doing a shortcut and the values were copied
from the WM0 ones at compute_wm_results() time. Going forward, we want
to compute them like the other WMs and resolve their final register
values in the same way as well.

This patch does just that and isolate the transtion WM compute code in
skl_compute_transition_wm() while skl_compute_wm_results() takes care of
the register values.

We also take the opportunity to disable the transition WMs for now.
We've noticed underruns and they seem to be the culprit.

Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
  • Loading branch information
Damien Lespiau authored and Daniel Vetter committed Nov 7, 2014
1 parent 407b50f commit 9414f56
Showing 1 changed file with 31 additions and 15 deletions.
46 changes: 31 additions & 15 deletions drivers/gpu/drm/i915/intel_pm.c
Original file line number Diff line number Diff line change
Expand Up @@ -3374,14 +3374,18 @@ skl_compute_linetime_wm(struct drm_crtc *crtc, struct skl_pipe_wm_parameters *p)

static void skl_compute_transition_wm(struct drm_crtc *crtc,
struct skl_pipe_wm_parameters *params,
struct skl_pipe_wm *pipe_wm)
struct skl_wm_level *trans_wm /* out */)
{
/*
* For now it is suggested to use the LP0 wm val of corresponding
* plane as transition wm val.
*/
struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
int i;

if (!params->active)
return;

/* Until we know more, just disable transition WMs */
for (i = 0; i < intel_num_planes(intel_crtc); i++)
trans_wm->plane_en[i] = false;
trans_wm->cursor_en = false;
}

static void skl_compute_pipe_wm(struct drm_crtc *crtc,
Expand All @@ -3401,7 +3405,7 @@ static void skl_compute_pipe_wm(struct drm_crtc *crtc,
}
pipe_wm->linetime = skl_compute_linetime_wm(crtc, params);

skl_compute_transition_wm(crtc, params, pipe_wm);
skl_compute_transition_wm(crtc, params, &pipe_wm->trans_wm);
}

static void skl_compute_wm_results(struct drm_device *dev,
Expand All @@ -3412,11 +3416,10 @@ static void skl_compute_wm_results(struct drm_device *dev,
{
int level, max_level = ilk_wm_max_level(dev);
enum pipe pipe = intel_crtc->pipe;
uint32_t temp;
int i;

for (level = 0; level <= max_level; level++) {
uint32_t temp;
int i;

for (i = 0; i < intel_num_planes(intel_crtc); i++) {
temp = 0;

Expand All @@ -3427,9 +3430,6 @@ static void skl_compute_wm_results(struct drm_device *dev,
temp |= PLANE_WM_EN;

r->plane[pipe][i][level] = temp;
/* Use the LP0 WM value for transition WM for now. */
if (level == 0)
r->plane_trans[pipe][i] = temp;
}

temp = 0;
Expand All @@ -3441,12 +3441,28 @@ static void skl_compute_wm_results(struct drm_device *dev,
temp |= PLANE_WM_EN;

r->cursor[pipe][level] = temp;
/* Use the LP0 WM value for transition WM for now. */
if (level == 0)
r->cursor_trans[pipe] = temp;

}

/* transition WMs */
for (i = 0; i < intel_num_planes(intel_crtc); i++) {
temp = 0;
temp |= p_wm->trans_wm.plane_res_l[i] << PLANE_WM_LINES_SHIFT;
temp |= p_wm->trans_wm.plane_res_b[i];
if (p_wm->trans_wm.plane_en[i])
temp |= PLANE_WM_EN;

r->plane_trans[pipe][i] = temp;
}

temp = 0;
temp |= p_wm->trans_wm.cursor_res_l << PLANE_WM_LINES_SHIFT;
temp |= p_wm->trans_wm.cursor_res_b;
if (p_wm->trans_wm.cursor_en)
temp |= PLANE_WM_EN;

r->cursor_trans[pipe] = temp;

r->wm_linetime[pipe] = p_wm->linetime;
}

Expand Down

0 comments on commit 9414f56

Please sign in to comment.