@@ -63,7 +63,7 @@ static bool ivb_can_enable_err_int(struct intel_display *display)
6363
6464 lockdep_assert_held (& dev_priv -> irq_lock );
6565
66- for_each_pipe (dev_priv , pipe ) {
66+ for_each_pipe (display , pipe ) {
6767 crtc = intel_crtc_for_pipe (display , pipe );
6868
6969 if (crtc -> cpu_fifo_underrun_disabled )
@@ -81,7 +81,7 @@ static bool cpt_can_enable_serr_int(struct intel_display *display)
8181
8282 lockdep_assert_held (& dev_priv -> irq_lock );
8383
84- for_each_pipe (dev_priv , pipe ) {
84+ for_each_pipe (display , pipe ) {
8585 crtc = intel_crtc_for_pipe (display , pipe );
8686
8787 if (crtc -> pch_fifo_underrun_disabled )
@@ -95,40 +95,40 @@ static void i9xx_check_fifo_underruns(struct intel_crtc *crtc)
9595{
9696 struct intel_display * display = to_intel_display (crtc );
9797 struct drm_i915_private * dev_priv = to_i915 (crtc -> base .dev );
98- i915_reg_t reg = PIPESTAT (dev_priv , crtc -> pipe );
98+ i915_reg_t reg = PIPESTAT (display , crtc -> pipe );
9999 u32 enable_mask ;
100100
101101 lockdep_assert_held (& dev_priv -> irq_lock );
102102
103- if ((intel_de_read (dev_priv , reg ) & PIPE_FIFO_UNDERRUN_STATUS ) == 0 )
103+ if ((intel_de_read (display , reg ) & PIPE_FIFO_UNDERRUN_STATUS ) == 0 )
104104 return ;
105105
106106 enable_mask = i915_pipestat_enable_mask (dev_priv , crtc -> pipe );
107- intel_de_write (dev_priv , reg , enable_mask | PIPE_FIFO_UNDERRUN_STATUS );
108- intel_de_posting_read (dev_priv , reg );
107+ intel_de_write (display , reg , enable_mask | PIPE_FIFO_UNDERRUN_STATUS );
108+ intel_de_posting_read (display , reg );
109109
110110 trace_intel_cpu_fifo_underrun (display , crtc -> pipe );
111- drm_err (& dev_priv -> drm , "pipe %c underrun\n" , pipe_name (crtc -> pipe ));
111+ drm_err (display -> drm , "pipe %c underrun\n" , pipe_name (crtc -> pipe ));
112112}
113113
114114static void i9xx_set_fifo_underrun_reporting (struct intel_display * display ,
115115 enum pipe pipe ,
116116 bool enable , bool old )
117117{
118118 struct drm_i915_private * dev_priv = to_i915 (display -> drm );
119- i915_reg_t reg = PIPESTAT (dev_priv , pipe );
119+ i915_reg_t reg = PIPESTAT (display , pipe );
120120
121121 lockdep_assert_held (& dev_priv -> irq_lock );
122122
123123 if (enable ) {
124124 u32 enable_mask = i915_pipestat_enable_mask (dev_priv , pipe );
125125
126- intel_de_write (dev_priv , reg ,
126+ intel_de_write (display , reg ,
127127 enable_mask | PIPE_FIFO_UNDERRUN_STATUS );
128- intel_de_posting_read (dev_priv , reg );
128+ intel_de_posting_read (display , reg );
129129 } else {
130- if (old && intel_de_read (dev_priv , reg ) & PIPE_FIFO_UNDERRUN_STATUS )
131- drm_err (& dev_priv -> drm , "pipe %c underrun\n" ,
130+ if (old && intel_de_read (display , reg ) & PIPE_FIFO_UNDERRUN_STATUS )
131+ drm_err (display -> drm , "pipe %c underrun\n" ,
132132 pipe_name (pipe ));
133133 }
134134}
@@ -151,18 +151,18 @@ static void ivb_check_fifo_underruns(struct intel_crtc *crtc)
151151 struct intel_display * display = to_intel_display (crtc );
152152 struct drm_i915_private * dev_priv = to_i915 (crtc -> base .dev );
153153 enum pipe pipe = crtc -> pipe ;
154- u32 err_int = intel_de_read (dev_priv , GEN7_ERR_INT );
154+ u32 err_int = intel_de_read (display , GEN7_ERR_INT );
155155
156156 lockdep_assert_held (& dev_priv -> irq_lock );
157157
158158 if ((err_int & ERR_INT_FIFO_UNDERRUN (pipe )) == 0 )
159159 return ;
160160
161- intel_de_write (dev_priv , GEN7_ERR_INT , ERR_INT_FIFO_UNDERRUN (pipe ));
162- intel_de_posting_read (dev_priv , GEN7_ERR_INT );
161+ intel_de_write (display , GEN7_ERR_INT , ERR_INT_FIFO_UNDERRUN (pipe ));
162+ intel_de_posting_read (display , GEN7_ERR_INT );
163163
164164 trace_intel_cpu_fifo_underrun (display , pipe );
165- drm_err (& dev_priv -> drm , "fifo underrun on pipe %c\n" , pipe_name (pipe ));
165+ drm_err (display -> drm , "fifo underrun on pipe %c\n" , pipe_name (pipe ));
166166}
167167
168168static void ivb_set_fifo_underrun_reporting (struct intel_display * display ,
@@ -171,7 +171,7 @@ static void ivb_set_fifo_underrun_reporting(struct intel_display *display,
171171{
172172 struct drm_i915_private * dev_priv = to_i915 (display -> drm );
173173 if (enable ) {
174- intel_de_write (dev_priv , GEN7_ERR_INT ,
174+ intel_de_write (display , GEN7_ERR_INT ,
175175 ERR_INT_FIFO_UNDERRUN (pipe ));
176176
177177 if (!ivb_can_enable_err_int (display ))
@@ -182,8 +182,8 @@ static void ivb_set_fifo_underrun_reporting(struct intel_display *display,
182182 ilk_disable_display_irq (dev_priv , DE_ERR_INT_IVB );
183183
184184 if (old &&
185- intel_de_read (dev_priv , GEN7_ERR_INT ) & ERR_INT_FIFO_UNDERRUN (pipe )) {
186- drm_err (& dev_priv -> drm ,
185+ intel_de_read (display , GEN7_ERR_INT ) & ERR_INT_FIFO_UNDERRUN (pipe )) {
186+ drm_err (display -> drm ,
187187 "uncleared fifo underrun on pipe %c\n" ,
188188 pipe_name (pipe ));
189189 }
@@ -220,19 +220,19 @@ static void cpt_check_pch_fifo_underruns(struct intel_crtc *crtc)
220220 struct intel_display * display = to_intel_display (crtc );
221221 struct drm_i915_private * dev_priv = to_i915 (crtc -> base .dev );
222222 enum pipe pch_transcoder = crtc -> pipe ;
223- u32 serr_int = intel_de_read (dev_priv , SERR_INT );
223+ u32 serr_int = intel_de_read (display , SERR_INT );
224224
225225 lockdep_assert_held (& dev_priv -> irq_lock );
226226
227227 if ((serr_int & SERR_INT_TRANS_FIFO_UNDERRUN (pch_transcoder )) == 0 )
228228 return ;
229229
230- intel_de_write (dev_priv , SERR_INT ,
230+ intel_de_write (display , SERR_INT ,
231231 SERR_INT_TRANS_FIFO_UNDERRUN (pch_transcoder ));
232- intel_de_posting_read (dev_priv , SERR_INT );
232+ intel_de_posting_read (display , SERR_INT );
233233
234234 trace_intel_pch_fifo_underrun (display , pch_transcoder );
235- drm_err (& dev_priv -> drm , "pch fifo underrun on pch transcoder %c\n" ,
235+ drm_err (display -> drm , "pch fifo underrun on pch transcoder %c\n" ,
236236 pipe_name (pch_transcoder ));
237237}
238238
@@ -243,7 +243,7 @@ static void cpt_set_fifo_underrun_reporting(struct intel_display *display,
243243 struct drm_i915_private * dev_priv = to_i915 (display -> drm );
244244
245245 if (enable ) {
246- intel_de_write (dev_priv , SERR_INT ,
246+ intel_de_write (display , SERR_INT ,
247247 SERR_INT_TRANS_FIFO_UNDERRUN (pch_transcoder ));
248248
249249 if (!cpt_can_enable_serr_int (display ))
@@ -253,9 +253,9 @@ static void cpt_set_fifo_underrun_reporting(struct intel_display *display,
253253 } else {
254254 ibx_disable_display_interrupt (dev_priv , SDE_ERROR_CPT );
255255
256- if (old && intel_de_read (dev_priv , SERR_INT ) &
256+ if (old && intel_de_read (display , SERR_INT ) &
257257 SERR_INT_TRANS_FIFO_UNDERRUN (pch_transcoder )) {
258- drm_err (& dev_priv -> drm ,
258+ drm_err (display -> drm ,
259259 "uncleared pch fifo underrun on pch transcoder %c\n" ,
260260 pipe_name (pch_transcoder ));
261261 }
@@ -368,81 +368,79 @@ bool intel_set_pch_fifo_underrun_reporting(struct intel_display *display,
368368
369369/**
370370 * intel_cpu_fifo_underrun_irq_handler - handle CPU fifo underrun interrupt
371- * @dev_priv: i915 device instance
371+ * @display: display device instance
372372 * @pipe: (CPU) pipe to set state for
373373 *
374374 * This handles a CPU fifo underrun interrupt, generating an underrun warning
375375 * into dmesg if underrun reporting is enabled and then disables the underrun
376376 * interrupt to avoid an irq storm.
377377 */
378- void intel_cpu_fifo_underrun_irq_handler (struct drm_i915_private * dev_priv ,
378+ void intel_cpu_fifo_underrun_irq_handler (struct intel_display * display ,
379379 enum pipe pipe )
380380{
381- struct intel_display * display = & dev_priv -> display ;
382381 struct intel_crtc * crtc = intel_crtc_for_pipe (display , pipe );
383382
384383 /* We may be called too early in init, thanks BIOS! */
385384 if (crtc == NULL )
386385 return ;
387386
388387 /* GMCH can't disable fifo underruns, filter them. */
389- if (HAS_GMCH (dev_priv ) &&
388+ if (HAS_GMCH (display ) &&
390389 crtc -> cpu_fifo_underrun_disabled )
391390 return ;
392391
393392 if (intel_set_cpu_fifo_underrun_reporting (display , pipe , false)) {
394393 trace_intel_cpu_fifo_underrun (display , pipe );
395394
396- drm_err (& dev_priv -> drm , "CPU pipe %c FIFO underrun\n" , pipe_name (pipe ));
395+ drm_err (display -> drm , "CPU pipe %c FIFO underrun\n" , pipe_name (pipe ));
397396 }
398397
399- intel_fbc_handle_fifo_underrun_irq (& dev_priv -> display );
398+ intel_fbc_handle_fifo_underrun_irq (display );
400399}
401400
402401/**
403402 * intel_pch_fifo_underrun_irq_handler - handle PCH fifo underrun interrupt
404- * @dev_priv: i915 device instance
403+ * @display: display device instance
405404 * @pch_transcoder: the PCH transcoder (same as pipe on IVB and older)
406405 *
407406 * This handles a PCH fifo underrun interrupt, generating an underrun warning
408407 * into dmesg if underrun reporting is enabled and then disables the underrun
409408 * interrupt to avoid an irq storm.
410409 */
411- void intel_pch_fifo_underrun_irq_handler (struct drm_i915_private * dev_priv ,
410+ void intel_pch_fifo_underrun_irq_handler (struct intel_display * display ,
412411 enum pipe pch_transcoder )
413412{
414- struct intel_display * display = & dev_priv -> display ;
415-
416413 if (intel_set_pch_fifo_underrun_reporting (display , pch_transcoder ,
417414 false)) {
418415 trace_intel_pch_fifo_underrun (display , pch_transcoder );
419- drm_err (& dev_priv -> drm , "PCH transcoder %c FIFO underrun\n" ,
416+ drm_err (display -> drm , "PCH transcoder %c FIFO underrun\n" ,
420417 pipe_name (pch_transcoder ));
421418 }
422419}
423420
424421/**
425422 * intel_check_cpu_fifo_underruns - check for CPU fifo underruns immediately
426- * @dev_priv: i915 device instance
423+ * @display: display device instance
427424 *
428425 * Check for CPU fifo underruns immediately. Useful on IVB/HSW where the shared
429426 * error interrupt may have been disabled, and so CPU fifo underruns won't
430427 * necessarily raise an interrupt, and on GMCH platforms where underruns never
431428 * raise an interrupt.
432429 */
433- void intel_check_cpu_fifo_underruns (struct drm_i915_private * dev_priv )
430+ void intel_check_cpu_fifo_underruns (struct intel_display * display )
434431{
432+ struct drm_i915_private * dev_priv = to_i915 (display -> drm );
435433 struct intel_crtc * crtc ;
436434
437435 spin_lock_irq (& dev_priv -> irq_lock );
438436
439- for_each_intel_crtc (& dev_priv -> drm , crtc ) {
437+ for_each_intel_crtc (display -> drm , crtc ) {
440438 if (crtc -> cpu_fifo_underrun_disabled )
441439 continue ;
442440
443- if (HAS_GMCH (dev_priv ))
441+ if (HAS_GMCH (display ))
444442 i9xx_check_fifo_underruns (crtc );
445- else if (DISPLAY_VER (dev_priv ) == 7 )
443+ else if (DISPLAY_VER (display ) == 7 )
446444 ivb_check_fifo_underruns (crtc );
447445 }
448446
@@ -451,19 +449,20 @@ void intel_check_cpu_fifo_underruns(struct drm_i915_private *dev_priv)
451449
452450/**
453451 * intel_check_pch_fifo_underruns - check for PCH fifo underruns immediately
454- * @dev_priv: i915 device instance
452+ * @display: display device instance
455453 *
456454 * Check for PCH fifo underruns immediately. Useful on CPT/PPT where the shared
457455 * error interrupt may have been disabled, and so PCH fifo underruns won't
458456 * necessarily raise an interrupt.
459457 */
460- void intel_check_pch_fifo_underruns (struct drm_i915_private * dev_priv )
458+ void intel_check_pch_fifo_underruns (struct intel_display * display )
461459{
460+ struct drm_i915_private * dev_priv = to_i915 (display -> drm );
462461 struct intel_crtc * crtc ;
463462
464463 spin_lock_irq (& dev_priv -> irq_lock );
465464
466- for_each_intel_crtc (& dev_priv -> drm , crtc ) {
465+ for_each_intel_crtc (display -> drm , crtc ) {
467466 if (crtc -> pch_fifo_underrun_disabled )
468467 continue ;
469468
@@ -474,10 +473,12 @@ void intel_check_pch_fifo_underruns(struct drm_i915_private *dev_priv)
474473 spin_unlock_irq (& dev_priv -> irq_lock );
475474}
476475
477- void intel_init_fifo_underrun_reporting (struct drm_i915_private * i915 ,
476+ void intel_init_fifo_underrun_reporting (struct intel_display * display ,
478477 struct intel_crtc * crtc ,
479478 bool enable )
480479{
480+ struct drm_i915_private * i915 = to_i915 (display -> drm );
481+
481482 crtc -> cpu_fifo_underrun_disabled = !enable ;
482483
483484 /*
0 commit comments