aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/sti/sti_drv.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2016-10-14 13:18:18 +0100
committerDaniel Vetter <daniel.vetter@ffwll.ch>2016-10-17 08:19:57 +0200
commit0853695c3ba46f97dfc0b5885f7b7e640ca212dd (patch)
tree6c8c3cbeb836094cb0e45b60a19c7e4419a3f4c2 /drivers/gpu/drm/sti/sti_drv.c
parentdrm/crtc: constify drm_crtc_mask parameter (diff)
downloadlinux-dev-0853695c3ba46f97dfc0b5885f7b7e640ca212dd.tar.xz
linux-dev-0853695c3ba46f97dfc0b5885f7b7e640ca212dd.zip
drm: Add reference counting to drm_atomic_state
drm_atomic_state has a complicated single owner model that tracks the single reference from allocation through to destruction on another thread - or perhaps on a local error path. We can simplify this tracking by using reference counting (at a cost of a few more atomics). This is even more beneficial when the lifetime of the state becomes more convoluted than being passed to a single worker thread for the commit. v2: Double check !intel atomic_commit functions for missing gets v3: Update kerneldocs Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Cc: dri-devel@lists.freedesktop.org Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com> Reviewed-by: Sean Paul <seanpaul@chromium.org> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: http://patchwork.freedesktop.org/patch/msgid/20161014121833.439-27-chris@chris-wilson.co.uk
Diffstat (limited to 'drivers/gpu/drm/sti/sti_drv.c')
-rw-r--r--drivers/gpu/drm/sti/sti_drv.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/gpu/drm/sti/sti_drv.c b/drivers/gpu/drm/sti/sti_drv.c
index 2784919a7366..7087499969bc 100644
--- a/drivers/gpu/drm/sti/sti_drv.c
+++ b/drivers/gpu/drm/sti/sti_drv.c
@@ -184,7 +184,7 @@ static void sti_atomic_complete(struct sti_private *private,
drm_atomic_helper_wait_for_vblanks(drm, state);
drm_atomic_helper_cleanup_planes(drm, state);
- drm_atomic_state_free(state);
+ drm_atomic_state_put(state);
}
static void sti_atomic_work(struct work_struct *work)
@@ -217,6 +217,7 @@ static int sti_atomic_commit(struct drm_device *drm,
drm_atomic_helper_swap_state(state, true);
+ drm_atomic_state_get(state);
if (nonblock)
sti_atomic_schedule(private, state);
else