Frame Buffer Compression (FBC)¶
FBC tries to save memory bandwidth (and so power consumption) by compressing the amount of memory used by the display. It is total transparent to user space and completely handled in the kernel.
The benefits of FBC are mostly visible with solid backgrounds and variation-less patterns. It comes from keeping the memory footprint small and having fewer memory pages opened and accessed for refreshing the display.
i915 is responsible to reserve stolen memory for FBC and configure its offset on proper registers. The hardware takes care of all compress/decompress. However there are many known cases where we have to forcibly disable it to allow proper screen updates.
-
void intel_fbc_disable(struct intel_crtc *crtc)¶
disable FBC if it’s associated with crtc
Parameters
struct intel_crtc *crtcthe CRTC
Description
This function disables FBC if it’s associated with the provided CRTC.
-
void intel_fbc_handle_fifo_underrun_irq(struct intel_display *display)¶
disable FBC when we get a FIFO underrun
Parameters
struct intel_display *displaydisplay
Description
Without FBC, most underruns are harmless and don’t really cause too many problems, except for an annoying message on dmesg. With FBC, underruns can become black screens or even worse, especially when paired with bad watermarks. So in order for us to be on the safe side, completely disable FBC in case we ever detect a FIFO underrun on any pipe. An underrun on any pipe already suggests that watermarks may be bad, so try to be as safe as possible.
This function is called from the IRQ handler.
-
void intel_fbc_read_underrun_dbg_info(struct intel_display *display, enum pipe pipe, bool log)¶
Read and log FBC-related FIFO underrun debug info
Parameters
struct intel_display *displaydisplay device instance
enum pipe pipethe pipe possibly containing the FBC
bool loglog the info?
Description
If pipe does not contain an FBC instance, this function bails early. Otherwise, FBC-related FIFO underrun is read and cleared, and then, if log is true, printed with error level.
-
void intel_fbc_init(struct intel_display *display)¶
Initialize FBC
Parameters
struct intel_display *displaydisplay
Description
This function might be called during PM init process.
-
void intel_fbc_sanitize(struct intel_display *display)¶
Sanitize FBC
Parameters
struct intel_display *displaydisplay
Description
Make sure FBC is initially disabled since we have no idea eg. into which parts of stolen it might be scribbling into.