public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
* [PATCH v2 0/7] drm/atomic: Add accessor macros for all atomic state.
@ 2017-01-10 10:21 Maarten Lankhorst
  2017-01-10 10:21 ` [PATCH v2 1/7] drm/atomic: Add new iterators over all state Maarten Lankhorst
                   ` (7 more replies)
  0 siblings, 8 replies; 13+ messages in thread
From: Maarten Lankhorst @ 2017-01-10 10:21 UTC (permalink / raw)
  To: dri-devel; +Cc: intel-gfx

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

Old 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:

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. This will return NULL if the object is
  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 obj_state->crtc
  too, this means not having to write 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.

When not doing atomic updates:
Look at obj->state for now. I have some patches to fix this but I was asked to
make it return a const state. This breaks a lot of users though so I add that
patch in this iteration.

This will give the correct state regardless of swapping.

Maarten Lankhorst (7):
  drm/atomic: Add new iterators over all state
  drm/atomic: Make add_affected_connectors look at crtc_state.
  drm/atomic: Use new atomic iterator macros.
  drm/atomic: Fix atomic helpers to use the new iterator macros.
  drm/atomic: Add macros to access existing old/new state
  drm/atomic: Convert get_existing_state callers to get_old/new_state
  drm/blend: Use new atomic iterator macros.

 drivers/gpu/drm/drm_atomic.c         |  39 ++--
 drivers/gpu/drm/drm_atomic_helper.c  | 376 ++++++++++++++++++++---------------
 drivers/gpu/drm/drm_blend.c          |  23 +--
 drivers/gpu/drm/i915/intel_display.c |  11 +-
 include/drm/drm_atomic.h             | 180 ++++++++++++++++-
 include/drm/drm_atomic_helper.h      |   3 +
 6 files changed, 437 insertions(+), 195 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] 13+ messages in thread

end of thread, other threads:[~2017-01-16  9:26 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-01-10 10:21 [PATCH v2 0/7] drm/atomic: Add accessor macros for all atomic state Maarten Lankhorst
2017-01-10 10:21 ` [PATCH v2 1/7] drm/atomic: Add new iterators over all state Maarten Lankhorst
2017-01-10 13:46   ` [PATCH v2.1 1/7] drm/atomic: Add new iterators over all state, v3 Maarten Lankhorst
2017-01-15 19:56     ` Laurent Pinchart
2017-01-16  9:26       ` Maarten Lankhorst
2017-01-10 10:21 ` [PATCH v2 2/7] drm/atomic: Make add_affected_connectors look at crtc_state Maarten Lankhorst
2017-01-10 10:21 ` [PATCH v2 3/7] drm/atomic: Use new atomic iterator macros Maarten Lankhorst
2017-01-10 10:21 ` [PATCH v2 4/7] drm/atomic: Fix atomic helpers to use the new " Maarten Lankhorst
2017-01-10 10:21 ` [PATCH v2 5/7] drm/atomic: Add macros to access existing old/new state Maarten Lankhorst
2017-01-10 10:21 ` [PATCH v2 6/7] drm/atomic: Convert get_existing_state callers to get_old/new_state Maarten Lankhorst
2017-01-12  9:27   ` [PATCH v2.1 6/7] drm/atomic: Convert get_existing_state callers to get_old/new_state, v2 Maarten Lankhorst
2017-01-10 10:21 ` [PATCH v2 7/7] drm/blend: Use new atomic iterator macros Maarten Lankhorst
2017-01-10 12:23 ` ✗ Fi.CI.BAT: warning for drm/atomic: Add accessor macros for all atomic state Patchwork

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox