Commit 50a9dd3f authored by Ville Syrjälä's avatar Ville Syrjälä

drm/i915: Clean up VLV/CHV maxfifo watermark setup

Let's compute the maxfifo watermarks using max() instead of min().
Can't even recall why I did it the other way originally. Anyways
using max() avoids having to initialize the watermarks to the max
value first.
Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1480354637-14209-5-git-send-email-ville.syrjala@linux.intel.comReviewed-by: default avatarMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
parent 1be4d379
...@@ -1100,7 +1100,6 @@ static void vlv_compute_wm(struct intel_crtc *crtc) ...@@ -1100,7 +1100,6 @@ static void vlv_compute_wm(struct intel_crtc *crtc)
struct drm_i915_private *dev_priv = to_i915(dev); struct drm_i915_private *dev_priv = to_i915(dev);
struct vlv_wm_state *wm_state = &crtc->wm_state; struct vlv_wm_state *wm_state = &crtc->wm_state;
struct intel_plane *plane; struct intel_plane *plane;
int sr_fifo_size = INTEL_INFO(dev_priv)->num_pipes * 512 - 1;
int level; int level;
memset(wm_state, 0, sizeof(*wm_state)); memset(wm_state, 0, sizeof(*wm_state));
...@@ -1115,13 +1114,6 @@ static void vlv_compute_wm(struct intel_crtc *crtc) ...@@ -1115,13 +1114,6 @@ static void vlv_compute_wm(struct intel_crtc *crtc)
if (wm_state->num_active_planes != 1) if (wm_state->num_active_planes != 1)
wm_state->cxsr = false; wm_state->cxsr = false;
if (wm_state->cxsr) {
for (level = 0; level < wm_state->num_levels; level++) {
wm_state->sr[level].plane = sr_fifo_size;
wm_state->sr[level].cursor = 63;
}
}
for_each_intel_plane_on_crtc(dev, crtc, plane) { for_each_intel_plane_on_crtc(dev, crtc, plane) {
struct intel_plane_state *state = struct intel_plane_state *state =
to_intel_plane_state(plane->base.state); to_intel_plane_state(plane->base.state);
...@@ -1172,14 +1164,14 @@ static void vlv_compute_wm(struct intel_crtc *crtc) ...@@ -1172,14 +1164,14 @@ static void vlv_compute_wm(struct intel_crtc *crtc)
case DRM_PLANE_TYPE_PRIMARY: case DRM_PLANE_TYPE_PRIMARY:
for (level = 0; level < wm_state->num_levels; level++) for (level = 0; level < wm_state->num_levels; level++)
wm_state->sr[level].plane = wm_state->sr[level].plane =
min(wm_state->sr[level].plane, max(wm_state->sr[level].plane,
wm_state->wm[level].primary); wm_state->wm[level].primary);
break; break;
case DRM_PLANE_TYPE_OVERLAY: case DRM_PLANE_TYPE_OVERLAY:
sprite = vlv_sprite_id(plane->id); sprite = vlv_sprite_id(plane->id);
for (level = 0; level < wm_state->num_levels; level++) for (level = 0; level < wm_state->num_levels; level++)
wm_state->sr[level].plane = wm_state->sr[level].plane =
min(wm_state->sr[level].plane, max(wm_state->sr[level].plane,
wm_state->wm[level].sprite[sprite]); wm_state->wm[level].sprite[sprite]);
break; break;
} }
......
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