Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1379412

[RFC 7/8] drm/fence: create per-crtc sync_timeline

From Gustavo Padovan <gustavo@padovan.org>
Newsgroups linux.kernel
Subject [RFC 7/8] drm/fence: create per-crtc sync_timeline
Date 2016-04-15 03:40 +0200
Message-ID <ro0TM-3bX-17@gated-at.bofh.it> (permalink)
References <ro0K6-37f-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


From: Gustavo Padovan <gustavo.padovan@collabora.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@collabora.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

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[RFC 0/8] drm: explicit fencing support Gustavo Padovan <gustavo@padovan.org> - 2016-04-15 03:30 +0200
  [RFC 1/8] dma-buf/fence: add fence_collection fences Gustavo Padovan <gustavo@padovan.org> - 2016-04-15 03:30 +0200
    Re: [RFC 1/8] dma-buf/fence: add fence_collection fences Daniel Vetter <daniel@ffwll.ch> - 2016-04-15 10:10 +0200
      Re: [RFC 1/8] dma-buf/fence: add fence_collection fences Daniel Vetter <daniel@ffwll.ch> - 2016-04-15 13:50 +0200
  [RFC 3/8] drm/fence: allow fence waiting to be interrupted by userspace Gustavo Padovan <gustavo@padovan.org> - 2016-04-15 03:30 +0200
    Re: [RFC 3/8] drm/fence: allow fence waiting to be interrupted by  userspace Daniel Vetter <daniel@ffwll.ch> - 2016-04-15 09:50 +0200
  [RFC 6/8] drm/fence: create DRM_MODE_ATOMIC_OUT_FENCE flag Gustavo Padovan <gustavo@padovan.org> - 2016-04-15 03:30 +0200
    Re: [RFC 6/8] drm/fence: create DRM_MODE_ATOMIC_OUT_FENCE flag Rob Clark <robdclark@gmail.com> - 2016-04-15 03:50 +0200
  [RFC 2/8] dma-buf/sync_file: add sync_file_fences_get() Gustavo Padovan <gustavo@padovan.org> - 2016-04-15 03:40 +0200
    Re: [RFC 2/8] dma-buf/sync_file: add sync_file_fences_get() Daniel Vetter <daniel@ffwll.ch> - 2016-04-15 10:00 +0200
  [RFC 5/8] drm/fence: add fence to drm_pending_event Gustavo Padovan <gustavo@padovan.org> - 2016-04-15 03:40 +0200
    Re: [RFC 5/8] drm/fence: add fence to drm_pending_event Daniel Vetter <daniel@ffwll.ch> - 2016-04-15 10:20 +0200
  [RFC 8/8] drm/fence: add out-fences support Gustavo Padovan <gustavo@padovan.org> - 2016-04-15 03:40 +0200
    Re: [RFC 8/8] drm/fence: add out-fences support Daniel Vetter <daniel@ffwll.ch> - 2016-04-15 10:20 +0200
  [RFC 4/8] drm/fence: add in-fences support Gustavo Padovan <gustavo@padovan.org> - 2016-04-15 03:40 +0200
    Re: [RFC 4/8] drm/fence: add in-fences support Daniel Vetter <daniel@ffwll.ch> - 2016-04-15 10:10 +0200
    Re: [RFC 4/8] drm/fence: add in-fences support Daniel Vetter <daniel@ffwll.ch> - 2016-04-15 10:20 +0200
  [RFC 7/8] drm/fence: create per-crtc sync_timeline Gustavo Padovan <gustavo@padovan.org> - 2016-04-15 03:40 +0200

csiph-web