@@ -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));
@@ -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.