[Intel-xe] [PATCH 03/12] fixup! drm/i915/display: Remaining changes to make xe compile

Jouni Högander jouni.hogander at intel.com
Fri Aug 25 09:38:55 UTC 2023


Fixups related to "drm/xe: Add frontbuffer setter/getter for xe_bo"

Signed-off-by: Jouni Högander <jouni.hogander at intel.com>
---
 drivers/gpu/drm/i915/display/intel_frontbuffer.c | 16 ++++------------
 1 file changed, 4 insertions(+), 12 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/intel_frontbuffer.c b/drivers/gpu/drm/i915/display/intel_frontbuffer.c
index bfd348e72d09..4f651cbec1c5 100644
--- a/drivers/gpu/drm/i915/display/intel_frontbuffer.c
+++ b/drivers/gpu/drm/i915/display/intel_frontbuffer.c
@@ -233,9 +233,8 @@ static void frontbuffer_release(struct kref *ref)
 
 #ifdef I915
 	i915_ggtt_clear_scanout(obj);
-
-	i915_gem_object_set_frontbuffer(obj, NULL);
 #endif
+	i915_gem_object_set_frontbuffer(obj, NULL);
 	spin_unlock(&intel_bo_to_i915(obj)->display.fb_tracking.lock);
 
 #ifdef I915
@@ -249,17 +248,12 @@ static void frontbuffer_release(struct kref *ref)
 struct intel_frontbuffer *
 intel_frontbuffer_get(struct drm_i915_gem_object *obj)
 {
-#ifdef I915
 	struct drm_i915_private *i915 = intel_bo_to_i915(obj);
-	struct intel_frontbuffer *cur;
-#endif
-	struct intel_frontbuffer *front;
+	struct intel_frontbuffer *front, *cur;
 
-#ifdef I915
 	front = i915_gem_object_get_frontbuffer(obj);
 	if (front)
 		return front;
-#endif
 
 	front = kmalloc(sizeof(*front), GFP_KERNEL);
 	if (!front)
@@ -273,16 +267,14 @@ intel_frontbuffer_get(struct drm_i915_gem_object *obj)
 			 frontbuffer_active,
 			 frontbuffer_retire,
 			 I915_ACTIVE_RETIRE_SLEEPS);
-
+#endif
 	spin_lock(&i915->display.fb_tracking.lock);
 	cur = i915_gem_object_set_frontbuffer(obj, front);
 	spin_unlock(&i915->display.fb_tracking.lock);
 	if (cur != front)
 		kfree(front);
-	return cur;
-#endif
 
-	return front;
+	return cur;
 }
 
 void intel_frontbuffer_put(struct intel_frontbuffer *front)
-- 
2.34.1



More information about the Intel-xe mailing list