mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 10:41:38 -04:00
drm/atomic: document how to handle driver private objects
DK put some nice docs into the commit introducing driver private state, but in the git history alone it'll be lost. Also, since Ville remove the void* usage it's a good opportunity to give the driver private stuff some tlc on the doc front. Finally try to explain why the "let's just subclass drm_atomic_state" approach wasn't the greatest, and annotate all those functions as deprecated in favour of more standardized driver private states. Also note where we could/should extend driver private states going forward (atm neither locking nor synchronization is handled in core/helpers, which isn't really all that great). v2: Spelling and phrasing improvements (Alex, DK). Cc: Harry Wentland <[email protected]> Cc: Dhinakaran Pandiyan <[email protected]> Cc: Maarten Lankhorst <[email protected]> Cc: Ville Syrjälä <[email protected]> Cc: Laurent Pinchart <[email protected]> Cc: Rob Clark <[email protected]> Cc: Alex Deucher <[email protected]> Cc: Ben Skeggs <[email protected]> Reviewed-by: Dhinakaran Pandiyan <[email protected]> Reviewed-by: Alex Deucher <[email protected]> Signed-off-by: Daniel Vetter <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
This commit is contained in:
parent
924fe8df7f
commit
da6c059697
4 changed files with 85 additions and 3 deletions
|
|
@ -189,12 +189,40 @@ struct drm_private_state_funcs {
|
|||
struct drm_private_state *state);
|
||||
};
|
||||
|
||||
/**
|
||||
* struct drm_private_obj - base struct for driver private atomic object
|
||||
*
|
||||
* A driver private object is initialized by calling
|
||||
* drm_atomic_private_obj_init() and cleaned up by calling
|
||||
* drm_atomic_private_obj_fini().
|
||||
*
|
||||
* Currently only tracks the state update functions and the opaque driver
|
||||
* private state itself, but in the future might also track which
|
||||
* &drm_modeset_lock is required to duplicate and update this object's state.
|
||||
*/
|
||||
struct drm_private_obj {
|
||||
/**
|
||||
* @state: Current atomic state for this driver private object.
|
||||
*/
|
||||
struct drm_private_state *state;
|
||||
|
||||
/**
|
||||
* @funcs:
|
||||
*
|
||||
* Functions to manipulate the state of this driver private object, see
|
||||
* &drm_private_state_funcs.
|
||||
*/
|
||||
const struct drm_private_state_funcs *funcs;
|
||||
};
|
||||
|
||||
/**
|
||||
* struct drm_private_state - base struct for driver private object state
|
||||
* @state: backpointer to global drm_atomic_state
|
||||
*
|
||||
* Currently only contains a backpointer to the overall atomic update, but in
|
||||
* the future also might hold synchronization information similar to e.g.
|
||||
* &drm_crtc.commit.
|
||||
*/
|
||||
struct drm_private_state {
|
||||
struct drm_atomic_state *state;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -268,6 +268,9 @@ struct drm_mode_config_funcs {
|
|||
* state easily. If this hook is implemented, drivers must also
|
||||
* implement @atomic_state_clear and @atomic_state_free.
|
||||
*
|
||||
* Subclassing of &drm_atomic_state is deprecated in favour of using
|
||||
* &drm_private_state and &drm_private_obj.
|
||||
*
|
||||
* RETURNS:
|
||||
*
|
||||
* A new &drm_atomic_state on success or NULL on failure.
|
||||
|
|
@ -289,6 +292,9 @@ struct drm_mode_config_funcs {
|
|||
*
|
||||
* Drivers that implement this must call drm_atomic_state_default_clear()
|
||||
* to clear common state.
|
||||
*
|
||||
* Subclassing of &drm_atomic_state is deprecated in favour of using
|
||||
* &drm_private_state and &drm_private_obj.
|
||||
*/
|
||||
void (*atomic_state_clear)(struct drm_atomic_state *state);
|
||||
|
||||
|
|
@ -301,6 +307,9 @@ struct drm_mode_config_funcs {
|
|||
*
|
||||
* Drivers that implement this must call
|
||||
* drm_atomic_state_default_release() to release common resources.
|
||||
*
|
||||
* Subclassing of &drm_atomic_state is deprecated in favour of using
|
||||
* &drm_private_state and &drm_private_obj.
|
||||
*/
|
||||
void (*atomic_state_free)(struct drm_atomic_state *state);
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in a new issue