Skip to content

Commit e339d67

Browse files
committed
drm/i915: Pass crtc state to vlv_compute_wm_level()
Rather than accessing crtc->config in vlv_compute_wm_level() let's pass in the crtc state explicitly. One step closer to atomic. Signed-off-by: Ville Syrjälä <[email protected]> Link: http://patchwork.freedesktop.org/patch/msgid/[email protected] Reviewed-by: Maarten Lankhorst <[email protected]>
1 parent fa292a4 commit e339d67

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

drivers/gpu/drm/i915/intel_pm.c

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -978,24 +978,26 @@ static void vlv_setup_wm_latency(struct drm_i915_private *dev_priv)
978978
}
979979
}
980980

981-
static uint16_t vlv_compute_wm_level(struct intel_plane *plane,
982-
struct intel_crtc *crtc,
983-
const struct intel_plane_state *state,
981+
static uint16_t vlv_compute_wm_level(const struct intel_crtc_state *crtc_state,
982+
const struct intel_plane_state *plane_state,
984983
int level)
985984
{
985+
struct intel_plane *plane = to_intel_plane(plane_state->base.plane);
986986
struct drm_i915_private *dev_priv = to_i915(plane->base.dev);
987+
const struct drm_display_mode *adjusted_mode =
988+
&crtc_state->base.adjusted_mode;
987989
int clock, htotal, cpp, width, wm;
988990

989991
if (dev_priv->wm.pri_latency[level] == 0)
990992
return USHRT_MAX;
991993

992-
if (!state->base.visible)
994+
if (!plane_state->base.visible)
993995
return 0;
994996

995-
cpp = drm_format_plane_cpp(state->base.fb->pixel_format, 0);
996-
clock = crtc->config->base.adjusted_mode.crtc_clock;
997-
htotal = crtc->config->base.adjusted_mode.crtc_htotal;
998-
width = crtc->config->pipe_src_w;
997+
cpp = drm_format_plane_cpp(plane_state->base.fb->pixel_format, 0);
998+
clock = adjusted_mode->crtc_clock;
999+
htotal = adjusted_mode->crtc_htotal;
1000+
width = crtc_state->pipe_src_w;
9991001
if (WARN_ON(htotal == 0))
10001002
htotal = 1;
10011003

@@ -1145,7 +1147,7 @@ static void vlv_compute_wm(struct intel_crtc *crtc)
11451147

11461148
/* normal watermarks */
11471149
for (level = 0; level < wm_state->num_levels; level++) {
1148-
int wm = vlv_compute_wm_level(plane, crtc, state, level);
1150+
int wm = vlv_compute_wm_level(crtc->config, state, level);
11491151
int max_wm = plane->wm.fifo_size;
11501152

11511153
/* hack */

0 commit comments

Comments
 (0)