Name

struct drm_private_state_funcs — atomic state functions for private objects

Synopsis

struct drm_private_state_funcs {
  void *(* duplicate_state) (struct drm_atomic_state *state, void *obj);
  void (* swap_state) (void *obj, void **obj_state_ptr);
  void (* destroy_state) (void *obj_state);
};  

Members

duplicate_state

Duplicate the current state of the private object and return it. It is an error to call this before obj->state has been initialized.

RETURNS:

Duplicated atomic state or NULL when obj->state is not initialized or allocation failed.

swap_state

This function swaps the existing state of a private object obj with it's newly created state, the pointer to which is passed as obj_state_ptr.

destroy_state

Frees the private object state created with duplicate_state.

Description

These hooks are used by atomic helpers to create, swap and destroy states o private objects. The structure itself is used as a vtable to identify the associated private object type. Each private object type that needs to be added to the atomic states is expected to have an implementation of these hooks and pass a pointer to it's drm_private_state_funcs struct to drm_atomic_get_private_obj_state.