@@ -978,24 +978,26 @@ static void vlv_setup_wm_latency(struct drm_i915_private *dev_priv)
978
978
}
979
979
}
980
980
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 ,
984
983
int level )
985
984
{
985
+ struct intel_plane * plane = to_intel_plane (plane_state -> base .plane );
986
986
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 ;
987
989
int clock , htotal , cpp , width , wm ;
988
990
989
991
if (dev_priv -> wm .pri_latency [level ] == 0 )
990
992
return USHRT_MAX ;
991
993
992
- if (!state -> base .visible )
994
+ if (!plane_state -> base .visible )
993
995
return 0 ;
994
996
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 ;
999
1001
if (WARN_ON (htotal == 0 ))
1000
1002
htotal = 1 ;
1001
1003
@@ -1145,7 +1147,7 @@ static void vlv_compute_wm(struct intel_crtc *crtc)
1145
1147
1146
1148
/* normal watermarks */
1147
1149
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 );
1149
1151
int max_wm = plane -> wm .fifo_size ;
1150
1152
1151
1153
/* hack */
0 commit comments