[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1460683781-22535-8-git-send-email-gustavo@padovan.org>
Date: Thu, 14 Apr 2016 18:29:40 -0700
From: Gustavo Padovan <gustavo@...ovan.org>
To: dri-devel@...ts.freedesktop.org
Cc: linux-kernel@...r.kernel.org, Daniel Stone <daniels@...labora.com>,
Arve Hjønnevåg <arve@...roid.com>,
Riley Andrews <riandrews@...roid.com>,
Daniel Vetter <daniel.vetter@...ll.ch>,
Rob Clark <robdclark@...il.com>,
Greg Hackmann <ghackmann@...gle.com>,
John Harrison <John.C.Harrison@...el.com>,
laurent.pinchart@...asonboard.com, seanpaul@...gle.com,
marcheu@...gle.com, m.chehab@...sung.com,
Maarten Lankhorst <maarten.lankhorst@...ux.intel.com>,
Gustavo Padovan <gustavo.padovan@...labora.co.uk>
Subject: [RFC 7/8] drm/fence: create per-crtc sync_timeline
From: Gustavo Padovan <gustavo.padovan@...labora.co.uk>
Add one timeline per-crtc that will be use to handle fence signalling
to userspace via sync_files.
Signed-off-by: Gustavo Padovan <gustavo.padovan@...labora.co.uk>
---
drivers/gpu/drm/drm_crtc.c | 9 +++++++++
include/drm/drm_crtc.h | 4 ++++
2 files changed, 13 insertions(+)
diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c
index 65212ce..e1204cf 100644
--- a/drivers/gpu/drm/drm_crtc.c
+++ b/drivers/gpu/drm/drm_crtc.c
@@ -709,6 +709,13 @@ int drm_crtc_init_with_planes(struct drm_device *dev, struct drm_crtc *crtc,
return -ENOMEM;
}
+ crtc->timeline = sync_timeline_create(dev->driver->name, crtc->name);
+ if (!crtc->timeline) {
+ drm_mode_object_put(dev, &crtc->base);
+ kfree(crtc->name);
+ return -ENOMEM;
+ }
+
crtc->base.properties = &crtc->properties;
list_add_tail(&crtc->head, &config->crtc_list);
@@ -755,6 +762,8 @@ void drm_crtc_cleanup(struct drm_crtc *crtc)
if (crtc->state && crtc->funcs->atomic_destroy_state)
crtc->funcs->atomic_destroy_state(crtc, crtc->state);
+ sync_timeline_destroy(crtc->timeline);
+
kfree(crtc->name);
memset(crtc, 0, sizeof(*crtc));
diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h
index 5ba3cda..7934178 100644
--- a/include/drm/drm_crtc.h
+++ b/include/drm/drm_crtc.h
@@ -32,6 +32,7 @@
#include <linux/fb.h>
#include <linux/hdmi.h>
#include <linux/media-bus-format.h>
+#include <linux/sync_timeline.h>
#include <uapi/drm/drm_mode.h>
#include <uapi/drm/drm_fourcc.h>
#include <drm/drm_modeset_lock.h>
@@ -715,6 +716,7 @@ struct drm_crtc_funcs {
* @helper_private: mid-layer private data
* @properties: property tracking for this CRTC
* @state: current atomic state for this CRTC
+ * @timeline: sync timeline for fence sigalling
* @acquire_ctx: per-CRTC implicit acquire context used by atomic drivers for
* legacy IOCTLs
*
@@ -771,6 +773,8 @@ struct drm_crtc {
struct drm_crtc_state *state;
+ struct sync_timeline *timeline;
+
/*
* For legacy crtc IOCTLs so that atomic drivers can get at the locking
* acquire context.
--
2.5.5
Powered by blists - more mailing lists