/** * DOC: fifo underrun handling * * The i915 driver checks for display fifo underruns using the interrupt signals * provided by the hardware. This is enabled by default and fairly useful to * debug display issues, especially watermark settings. * * If an underrun is detected this is logged into dmesg. To avoid flooding logs * and occupying the cpu underrun interrupts are disabled after the first * occurrence until the next modeset on a given pipe. * * Note that underrun detection on gmch platforms is a bit more ugly since there * is no interrupt (despite that the signalling bit is in the PIPESTAT pipe * interrupt register). Also on some other platforms underrun interrupts are * shared, which means that if we detect an underrun we need to disable underrun * reporting on all pipes. * * The code also supports underrun detection on the PCH transcoder.
*/
/** * intel_set_cpu_fifo_underrun_reporting - set cpu fifo underrun reporting state * @display: display device instance * @pipe: (CPU) pipe to set state for * @enable: whether underruns should be reported or not * * This function sets the fifo underrun state for @pipe. It is used in the * modeset code to avoid false positives since on many platforms underruns are * expected when disabling or enabling the pipe. * * Notice that on some platforms disabling underrun reports for one pipe * disables for all due to shared interrupts. Actual reporting is still per-pipe * though. * * Returns the previous state of underrun reporting.
*/ bool intel_set_cpu_fifo_underrun_reporting(struct intel_display *display, enum pipe pipe, bool enable)
{ unsignedlong flags; bool ret;
spin_lock_irqsave(&display->irq.lock, flags);
ret = __intel_set_cpu_fifo_underrun_reporting(display, pipe, enable);
spin_unlock_irqrestore(&display->irq.lock, flags);
return ret;
}
/** * intel_set_pch_fifo_underrun_reporting - set PCH fifo underrun reporting state * @display: display device instance * @pch_transcoder: the PCH transcoder (same as pipe on IVB and older) * @enable: whether underruns should be reported or not * * This function makes us disable or enable PCH fifo underruns for a specific * PCH transcoder. Notice that on some PCHs (e.g. CPT/PPT), disabling FIFO * underrun reporting for one transcoder may also disable all the other PCH * error interruts for the other transcoders, due to the fact that there's just * one interrupt mask/enable bit for all the transcoders. * * Returns the previous state of underrun reporting.
*/ bool intel_set_pch_fifo_underrun_reporting(struct intel_display *display, enum pipe pch_transcoder, bool enable)
{ struct intel_crtc *crtc = intel_crtc_for_pipe(display, pch_transcoder); unsignedlong flags; bool old;
/* * NOTE: Pre-LPT has a fixed cpu pipe -> pch transcoder mapping, but LPT * has only one pch transcoder A that all pipes can use. To avoid racy * pch transcoder -> pipe lookups from interrupt code simply store the * underrun statistics in crtc A. Since we never expose this anywhere * nor use it outside of the fifo underrun code here using the "wrong" * crtc on LPT won't cause issues.
*/
spin_lock_irqsave(&display->irq.lock, flags);
old = !crtc->pch_fifo_underrun_disabled;
crtc->pch_fifo_underrun_disabled = !enable;
if (HAS_PCH_IBX(display))
ibx_set_fifo_underrun_reporting(display,
pch_transcoder,
enable); else
cpt_set_fifo_underrun_reporting(display,
pch_transcoder,
enable, old);
/** * intel_cpu_fifo_underrun_irq_handler - handle CPU fifo underrun interrupt * @display: display device instance * @pipe: (CPU) pipe to set state for * * This handles a CPU fifo underrun interrupt, generating an underrun warning * into dmesg if underrun reporting is enabled and then disables the underrun * interrupt to avoid an irq storm.
*/ void intel_cpu_fifo_underrun_irq_handler(struct intel_display *display, enum pipe pipe)
{ struct intel_crtc *crtc = intel_crtc_for_pipe(display, pipe);
/* We may be called too early in init, thanks BIOS! */ if (crtc == NULL) return;
/** * intel_pch_fifo_underrun_irq_handler - handle PCH fifo underrun interrupt * @display: display device instance * @pch_transcoder: the PCH transcoder (same as pipe on IVB and older) * * This handles a PCH fifo underrun interrupt, generating an underrun warning * into dmesg if underrun reporting is enabled and then disables the underrun * interrupt to avoid an irq storm.
*/ void intel_pch_fifo_underrun_irq_handler(struct intel_display *display, enum pipe pch_transcoder)
{ if (intel_set_pch_fifo_underrun_reporting(display, pch_transcoder, false)) {
trace_intel_pch_fifo_underrun(display, pch_transcoder);
drm_err(display->drm, "PCH transcoder %c FIFO underrun\n",
pipe_name(pch_transcoder));
}
}
/** * intel_check_cpu_fifo_underruns - check for CPU fifo underruns immediately * @display: display device instance * * Check for CPU fifo underruns immediately. Useful on IVB/HSW where the shared * error interrupt may have been disabled, and so CPU fifo underruns won't * necessarily raise an interrupt, and on GMCH platforms where underruns never * raise an interrupt.
*/ void intel_check_cpu_fifo_underruns(struct intel_display *display)
{ struct intel_crtc *crtc;
spin_lock_irq(&display->irq.lock);
for_each_intel_crtc(display->drm, crtc) { if (crtc->cpu_fifo_underrun_disabled) continue;
if (HAS_GMCH(display))
i9xx_check_fifo_underruns(crtc); elseif (DISPLAY_VER(display) == 7)
ivb_check_fifo_underruns(crtc);
}
spin_unlock_irq(&display->irq.lock);
}
/** * intel_check_pch_fifo_underruns - check for PCH fifo underruns immediately * @display: display device instance * * Check for PCH fifo underruns immediately. Useful on CPT/PPT where the shared * error interrupt may have been disabled, and so PCH fifo underruns won't * necessarily raise an interrupt.
*/ void intel_check_pch_fifo_underruns(struct intel_display *display)
{ struct intel_crtc *crtc;
spin_lock_irq(&display->irq.lock);
for_each_intel_crtc(display->drm, crtc) { if (crtc->pch_fifo_underrun_disabled) continue;
if (HAS_PCH_CPT(display))
cpt_check_pch_fifo_underruns(crtc);
}
/* * We track the PCH trancoder underrun reporting state * within the crtc. With crtc for pipe A housing the underrun * reporting state for PCH transcoder A, crtc for pipe B housing * it for PCH transcoder B, etc. LPT-H has only PCH transcoder A, * and marking underrun reporting as disabled for the non-existing * PCH transcoders B and C would prevent enabling the south * error interrupt (see cpt_can_enable_serr_int()).
*/ if (intel_has_pch_trancoder(display, crtc->pipe))
crtc->pch_fifo_underrun_disabled = !enable;
}
Messung V0.5
¤ Dauer der Verarbeitung: 0.13 Sekunden
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.