XenevaOS
Loading...
Searching...
No Matches
Public Attributes | List of all members
drm_crtc_commit Struct Reference

#include <drm_atomic.h>

Collaboration diagram for drm_crtc_commit:
Collaboration graph
[legend]

Public Attributes

struct drm_crtc * crtc
 
struct kref ref
 
struct completion flip_done
 
struct completion hw_done
 
struct completion cleanup_done
 
struct list_head commit_entry
 
struct drm_pending_vblank_event * event
 
bool abort_completion
 

Detailed Description

struct drm_crtc_commit - track modeset commits on a CRTC

This structure is used to track pending modeset changes and atomic commit on a per-CRTC basis. Since updating the list should never block, this structure is reference counted to allow waiters to safely wait on an event to complete, without holding any locks.

It has 3 different events in total to allow a fine-grained synchronization between outstanding updates::

atomic commit thread hardware

write new state into hardware -—> ... signal hw_done switch to new state on next ... v/hblank

wait for buffers to show up ...

... send completion irq irq handler signals flip_done cleanup old buffers

signal cleanup_done

wait for flip_done <-— clean up atomic state

The important bit to know is that &cleanup_done is the terminal event, but the ordering between &flip_done and &hw_done is entirely up to the specific driver and modeset state change.

For an implementation of how to use this look at drm_atomic_helper_setup_commit() from the atomic helper library.

See also drm_crtc_commit_wait().

Member Data Documentation

◆ abort_completion

bool drm_crtc_commit::abort_completion

@abort_completion:

A flag that's set after drm_atomic_helper_setup_commit() takes a second reference for the completion of $drm_crtc_state.event. It's used by the free code to remove the second reference if commit fails.

◆ cleanup_done

struct completion drm_crtc_commit::cleanup_done

@cleanup_done:

Will be signalled after old buffers have been cleaned up by calling drm_atomic_helper_cleanup_planes(). Since this can only happen after a vblank wait completed it might be a bit later. This completion is useful to throttle updates and avoid hardware updates getting ahead of the buffer cleanup too much.

Drivers should call drm_atomic_helper_commit_cleanup_done() to signal completion of this stage.

◆ commit_entry

struct list_head drm_crtc_commit::commit_entry

@commit_entry:

Entry on the per-CRTC &drm_crtc.commit_list. Protected by $drm_crtc.commit_lock.

◆ crtc

struct drm_crtc* drm_crtc_commit::crtc

@crtc:

DRM CRTC for this commit.

◆ event

struct drm_pending_vblank_event* drm_crtc_commit::event

@event:

&drm_pending_vblank_event pointer to clean up private events.

◆ flip_done

struct completion drm_crtc_commit::flip_done

@flip_done:

Will be signaled when the hardware has flipped to the new set of buffers. Signals at the same time as when the drm event for this commit is sent to userspace, or when an out-fence is singalled. Note that for most hardware, in most cases this happens after @hw_done is signalled.

Completion of this stage is signalled implicitly by calling drm_crtc_send_vblank_event() on &drm_crtc_state.event.

◆ hw_done

struct completion drm_crtc_commit::hw_done

@hw_done:

Will be signalled when all hw register changes for this commit have been written out. Especially when disabling a pipe this can be much later than @flip_done, since that can signal already when the screen goes black, whereas to fully shut down a pipe more register I/O is required.

Note that this does not need to include separately reference-counted resources like backing storage buffer pinning, or runtime pm management.

Drivers should call drm_atomic_helper_commit_hw_done() to signal completion of this stage.

◆ ref

struct kref drm_crtc_commit::ref

Reference count for this structure. Needed to allow blocking on completions without the risk of the completion disappearing meanwhile.


The documentation for this struct was generated from the following file: