提交 26cca0e5 编写于 作者: V Ville Syrjälä

drm/i915: Introduce vlv_invert_wm_value()

Add a small helper to do invert the vlv/chv values. Less fragile
perhaps, and let's us clearly mark all overlarge wateramarks as
disabled (by just making them all USHRT_MAX).
Signed-off-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1480354637-14209-8-git-send-email-ville.syrjala@linux.intel.comReviewed-by: NMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
上级 1b31389c
......@@ -1053,6 +1053,14 @@ static void vlv_compute_fifo(struct intel_crtc *crtc)
WARN_ON(fifo_left != 0);
}
static u16 vlv_invert_wm_value(u16 wm, u16 fifo_size)
{
if (wm > fifo_size)
return USHRT_MAX;
else
return fifo_size - wm;
}
static void vlv_invert_wms(struct intel_crtc *crtc)
{
struct vlv_wm_state *wm_state = &crtc->wm_state;
......@@ -1064,12 +1072,17 @@ static void vlv_invert_wms(struct intel_crtc *crtc)
INTEL_INFO(to_i915(dev))->num_pipes * 512 - 1;
struct intel_plane *plane;
wm_state->sr[level].plane = sr_fifo_size - wm_state->sr[level].plane;
wm_state->sr[level].cursor = 63 - wm_state->sr[level].cursor;
wm_state->sr[level].plane =
vlv_invert_wm_value(wm_state->sr[level].plane,
sr_fifo_size);
wm_state->sr[level].cursor =
vlv_invert_wm_value(wm_state->sr[level].cursor,
63);
for_each_intel_plane_on_crtc(dev, crtc, plane) {
wm_state->wm[level].plane[plane->id] = plane->wm.fifo_size -
wm_state->wm[level].plane[plane->id];
wm_state->wm[level].plane[plane->id] =
vlv_invert_wm_value(wm_state->wm[level].plane[plane->id],
plane->wm.fifo_size);
}
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册