All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/4] drm/atomic: Add accessor macros for all atomic state.
@ 2016-11-16 13:58 Maarten Lankhorst
  2016-11-16 13:58 ` [PATCH v2 1/4] drm/atomic: Add new iterators over all state, v2 Maarten Lankhorst
                   ` (5 more replies)
  0 siblings, 6 replies; 24+ messages in thread
From: Maarten Lankhorst @ 2016-11-16 13:58 UTC (permalink / raw)
  To: dri-devel

Second approach. Instead of trying to convert all drivers straight away,
implement all macros that are required to get state working.

Current situation:
Use obj->state, which can refer to old or new state.
Use drm_atomic_get_(existing_)obj_state, which can refer to new or old state.
Use for_each_obj_in_state, which refers to new or old state.

New situation:
When doing some dereferencing outside atomic_state, use
drm_atomic_get_current_obj_state which has locking checks, instead of
obj->state.

During atomic check:
- Use drm_atomic_get_obj_state to add a object to the atomic state,
  or get the new state.
- Use drm_atomic_get_(old/new)_obj_state to peek at the new/old state,
  without adding the object if it's not part of the state. For planes
  and connectors the relevant crtc_state is added, so this will work to
  get the crtc_state from foo_state->crtc too, saves some error handling. :)

During atomic commit:
- Do not use drm_atomic_get_obj_state, obj->state or drm_atomic_get_(existing_)obj_state
  any more, replace with drm_atomic_get_old/new_obj_state calls as required.

During both:
- Use for_each_(new,old,oldnew)_obj_in_state to get the old or new state as needed.
  oldnew will be renamed to for_each_obj_in_state after all callers are converted
  to the new api.

This will give the correct state regardless of swapping.

Maarten Lankhorst (4):
  drm/atomic: Add new iterators over all state, v2.
  drm/atomic: Add accessor macros for the current state.
  drm/atomic: Add macros to access existing old/new state
  drm/atomic: Add checks to ensure get_state is not called after
    swapping.

 drivers/gpu/drm/drm_atomic.c         |  24 +++-
 drivers/gpu/drm/drm_atomic_helper.c  |  47 ++++++-
 drivers/gpu/drm/i915/intel_display.c |  11 +-
 include/drm/drm_atomic.h             | 247 ++++++++++++++++++++++++++++++++++-
 include/drm/drm_atomic_helper.h      |   2 +
 include/drm/drm_modeset_lock.h       |  21 +++
 6 files changed, 338 insertions(+), 14 deletions(-)

-- 
2.7.4

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 24+ messages in thread

end of thread, other threads:[~2016-12-28 14:25 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-16 13:58 [PATCH v2 0/4] drm/atomic: Add accessor macros for all atomic state Maarten Lankhorst
2016-11-16 13:58 ` [PATCH v2 1/4] drm/atomic: Add new iterators over all state, v2 Maarten Lankhorst
2016-11-16 13:58 ` [PATCH v2 2/4] drm/atomic: Add accessor macros for the current state Maarten Lankhorst
2016-11-16 14:35   ` Ville Syrjälä
2016-11-16 15:04     ` Daniel Vetter
2016-11-16 16:11       ` Maarten Lankhorst
2016-11-16 16:26         ` Daniel Vetter
2016-11-16 16:32         ` Ville Syrjälä
2016-11-17 11:58           ` Maarten Lankhorst
2016-11-17 12:26             ` Ville Syrjälä
2016-11-17 12:42               ` Maarten Lankhorst
2016-11-17 12:50                 ` Ville Syrjälä
2016-11-17 13:20                   ` [PATCH v2.1 2/4] drm/atomic: Add accessor macros for the current state, v2 Maarten Lankhorst
2016-12-09 22:27                     ` Daniel Vetter
2016-12-14 13:15                     ` Daniel Vetter
2016-12-15 10:24                       ` [PATCH v2.2 2/4] drm/atomic: Add accessor macros for the current state, v3 Maarten Lankhorst
2016-11-16 13:58 ` [PATCH v2 3/4] drm/atomic: Add macros to access existing old/new state Maarten Lankhorst
2016-12-28 14:25   ` Daniel Vetter
2016-11-16 13:58 ` [PATCH v2 4/4] drm/atomic: Add checks to ensure get_state is not called after swapping Maarten Lankhorst
2016-11-16 14:18 ` [PATCH v2 0/4] drm/atomic: Add accessor macros for all atomic state Daniel Vetter
2016-11-16 16:11   ` Maarten Lankhorst
2016-11-16 16:27     ` Daniel Vetter
2016-12-14 13:17 ` Daniel Vetter
2016-12-15  9:19   ` Maarten Lankhorst

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.