drm: Add driver-private objects to atomic state
authorPandiyan, Dhinakaran <dhinakaran.pandiyan@intel.com>
Fri, 21 Apr 2017 05:51:30 +0000 (22:51 -0700)
committerAo Xu <ao.xu@amlogic.com>
Tue, 9 Jul 2019 11:27:36 +0000 (19:27 +0800)
commit90f028c3da95165c996eeb867570f8a3123d15d9
tree8462c0434d87401f37e0ae044caa354e91afb20e
parent35d05d4d14ce9b72991faff18395b415ccc8fe0a
drm: Add driver-private objects to atomic state

It is necessary to track states for objects other than connector, crtc
and plane for atomic modesets. But adding objects like DP MST link
bandwidth to drm_atomic_state would mean that a non-core object will be
modified by the core helper functions for swapping and clearing
it's state. So, lets add void * objects and helper functions that operate
on void * types to keep these objects and states private to the core.
Drivers can then implement specific functions to swap and clear states.
The other advantage having just void * for these objects in
drm_atomic_state is that objects of different types can be managed in the
same state array.

v7: Use __for_each_private_obj to define for_each_private_obj (Maarten)
v6: More kernel-doc to keep 0-day happy
v5: Remove more NULL checks (Maarten)
v4: Avoid redundant NULL checks when private_objs array is empty (Maarten)
v3: Macro alignment (Chris)
v2: Added docs and new iterator to filter private objects (Daniel)

Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: Archit Taneja <architt@codeaurora.org>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Harry Wentland <Harry.wentland@amd.com>
Change-Id: I1d906ca120167b8b25a5e959b332c5bea55a97b7
Acked-by: Harry Wentland <harry.wentland@amd.com>
Suggested-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1492753893-3748-2-git-send-email-dhinakaran.pandiyan@intel.com
Signed-off-by: Ao Xu <ao.xu@amlogic.com>
drivers/gpu/drm/drm_atomic.c
drivers/gpu/drm/drm_atomic_helper.c
include/drm/drm_atomic.h