Frontbuffer Tracking¶
Many features require us to track changes to the currently active frontbuffer, especially rendering targeted at the frontbuffer.
To be able to do so we track frontbuffers using a bitmask for all possible
frontbuffer slots through intel_frontbuffer_track(). The functions in this
file are then called when the contents of the frontbuffer are invalidated,
when frontbuffer rendering has stopped again to flush out all the changes
and when the frontbuffer is exchanged with a flip. Subsystems interested in
frontbuffer changes (e.g. PSR, FBC, DRRS) should directly put their callbacks
into the relevant places and filter for the frontbuffer slots that they are
interested int.
On a high level there are two types of powersaving features. The first one work like a special cache (FBC and PSR) and are interested when they should stop caching and when to restart caching. This is done by placing callbacks into the invalidate and the flush functions: At invalidate the caching must be stopped and at flush time it can be restarted. And maybe they need to know when the frontbuffer changes (e.g. when the hw doesn’t initiate an invalidate and flush on its own) which can be achieved with placing callbacks into the flip functions.
The other type of display power saving feature only cares about busyness (e.g. DRRS). In that case all three (invalidate, flush and flip) indicate busyness. There is no direct way to detect idleness. Instead an idle timer work delayed work should be started from the flush and flip functions and cancelled as soon as busyness is detected.
-
bool intel_frontbuffer_invalidate(struct intel_frontbuffer *front, enum fb_op_origin origin)¶
invalidate frontbuffer object
Parameters
struct intel_frontbuffer *frontGEM object to invalidate
enum fb_op_origin originwhich operation caused the invalidation
Description
This function gets called every time rendering on the given object starts and frontbuffer caching (fbc, low refresh rate for DRRS, panel self refresh) must be invalidated. For ORIGIN_CS any subsequent invalidation will be delayed until the rendering completes or a flip on this frontbuffer plane is scheduled.
-
void intel_frontbuffer_flush(struct intel_frontbuffer *front, enum fb_op_origin origin)¶
flush frontbuffer object
Parameters
struct intel_frontbuffer *frontGEM object to flush
enum fb_op_origin originwhich operation caused the flush
Description
This function gets called every time rendering on the given object has completed and frontbuffer caching can be started again.
-
void frontbuffer_flush(struct intel_display *display, unsigned int frontbuffer_bits, enum fb_op_origin origin)¶
flush frontbuffer
Parameters
struct intel_display *displaydisplay device
unsigned int frontbuffer_bitsfrontbuffer plane tracking bits
enum fb_op_origin originwhich operation caused the flush
Description
This function gets called every time rendering on the given planes has completed and frontbuffer caching can be started again. Flushes will get delayed if they’re blocked by some outstanding asynchronous rendering.
Can be called without any locks held.
-
void intel_frontbuffer_flip(struct intel_display *display, unsigned frontbuffer_bits)¶
synchronous frontbuffer flip
Parameters
struct intel_display *displaydisplay device
unsigned frontbuffer_bitsfrontbuffer plane tracking bits
Description
This function gets called after scheduling a flip on obj. This is for synchronous plane updates which will happen on the next vblank and which will not get delayed by pending gpu rendering.
Can be called without any locks held.
-
void intel_frontbuffer_queue_flush(struct intel_frontbuffer *front)¶
queue flushing frontbuffer object
Parameters
struct intel_frontbuffer *frontGEM object to flush
Description
This function is targeted for our dirty callback for queueing flush when dma fence is signals
-
void intel_frontbuffer_track(struct intel_frontbuffer *old, struct intel_frontbuffer *new, unsigned int frontbuffer_bits)¶
update frontbuffer tracking
Parameters
struct intel_frontbuffer *oldcurrent buffer for the frontbuffer slots
struct intel_frontbuffer *newnew buffer for the frontbuffer slots
unsigned int frontbuffer_bitsbitmask of frontbuffer slots
Description
This updates the frontbuffer tracking bits frontbuffer_bits by clearing them from old and setting them in new. Both old and new can be NULL.