[Intel-xe] [PATCH v3 01/12] drm/i915/display: Move releasing gem object away from fb tracking

Jouni Högander jouni.hogander at intel.com
Tue Sep 12 06:46:58 UTC 2023


As a preparation for Xe we want to remove all i915_gem_object details away
from frontbuffer tacking code. Due to this mobe releasing gem object
reference to i915_gem_object_set_frontbuffer.

Signed-off-by: Jouni Högander <jouni.hogander at intel.com>
---
 drivers/gpu/drm/i915/display/intel_frontbuffer.c | 2 --
 drivers/gpu/drm/i915/gem/i915_gem_object.h       | 1 +
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/intel_frontbuffer.c b/drivers/gpu/drm/i915/display/intel_frontbuffer.c
index 4f077b222b36..a9a8c75b8236 100644
--- a/drivers/gpu/drm/i915/display/intel_frontbuffer.c
+++ b/drivers/gpu/drm/i915/display/intel_frontbuffer.c
@@ -244,8 +244,6 @@ static void frontbuffer_release(struct kref *ref)
 
 #ifdef I915
 	i915_active_fini(&front->write);
-
-	i915_gem_object_put(obj);
 #endif
 	kfree_rcu(front, rcu);
 }
diff --git a/drivers/gpu/drm/i915/gem/i915_gem_object.h b/drivers/gpu/drm/i915/gem/i915_gem_object.h
index f607b87890dd..525cb440cc15 100644
--- a/drivers/gpu/drm/i915/gem/i915_gem_object.h
+++ b/drivers/gpu/drm/i915/gem/i915_gem_object.h
@@ -943,6 +943,7 @@ i915_gem_object_set_frontbuffer(struct drm_i915_gem_object *obj,
 
 	if (!front) {
 		RCU_INIT_POINTER(obj->frontbuffer, NULL);
+		i915_gem_object_put(obj);
 	} else if (rcu_access_pointer(obj->frontbuffer)) {
 		cur = rcu_dereference_protected(obj->frontbuffer, true);
 		kref_get(&cur->ref);
-- 
2.34.1



More information about the Intel-xe mailing list