drm/i915/gt: Always call kref_init for the timeline
authorChris Wilson <chris@chris-wilson.co.uk>
Tue, 25 Jun 2019 23:33:49 +0000 (00:33 +0100)
committerChris Wilson <chris@chris-wilson.co.uk>
Wed, 26 Jun 2019 06:25:54 +0000 (07:25 +0100)
Always initialise the refcount, even for the embedded timelines inside
mock devices.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Matthew Auld <matthew.auld@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190625233349.32371-2-chris@chris-wilson.co.uk
drivers/gpu/drm/i915/gt/intel_timeline.c

index 3bbb632cb535fb6942f8020c35eb69d59aecedb4..6daa9eb59e194cf2067fc80885745a82d3caf48c 100644 (file)
@@ -210,8 +210,11 @@ int intel_timeline_init(struct intel_timeline *timeline,
 {
        void *vaddr;
 
+       kref_init(&timeline->kref);
+
        timeline->gt = gt;
        timeline->pin_count = 0;
+
        timeline->has_initial_breadcrumb = !hwsp;
        timeline->hwsp_cacheline = NULL;
 
@@ -357,8 +360,6 @@ intel_timeline_create(struct intel_gt *gt, struct i915_vma *global_hwsp)
                return ERR_PTR(err);
        }
 
-       kref_init(&timeline->kref);
-
        return timeline;
 }