[Intel-xe] [RFC PATCH v2 12/23] drm/i915: Add intel_bo_flush_if_display define for i915

Jouni Högander jouni.hogander at intel.com
Wed May 10 12:11:41 UTC 2023


Add intel_bo_flush_if_display for i915 and use it instead of
i915_gem_object_flush_if_display. This is targeting to get rid of need
for #ifdef I195 when doing i915_gem_object_flush_if_display during
dirtyfb call back.

Signed-off-by: Jouni Högander <jouni.hogander at intel.com>
---
 drivers/gpu/drm/i915/display/intel_fb.c          | 2 +-
 drivers/gpu/drm/i915/display/intel_fb_pin.c      | 2 +-
 drivers/gpu/drm/i915/gem/i915_gem_object_types.h | 2 ++
 3 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/intel_fb.c b/drivers/gpu/drm/i915/display/intel_fb.c
index 37cd0efa5352..e62e1e12758d 100644
--- a/drivers/gpu/drm/i915/display/intel_fb.c
+++ b/drivers/gpu/drm/i915/display/intel_fb.c
@@ -1895,7 +1895,7 @@ static int intel_user_framebuffer_dirty(struct drm_framebuffer *fb,
 {
 	struct drm_i915_gem_object *obj = intel_fb_obj(fb);
 
-	i915_gem_object_flush_if_display(obj);
+	intel_bo_flush_if_display(obj);
 	intel_frontbuffer_flush(to_intel_frontbuffer(fb), ORIGIN_DIRTYFB);
 
 	return 0;
diff --git a/drivers/gpu/drm/i915/display/intel_fb_pin.c b/drivers/gpu/drm/i915/display/intel_fb_pin.c
index 1aca7552a85d..707b3cd171a3 100644
--- a/drivers/gpu/drm/i915/display/intel_fb_pin.c
+++ b/drivers/gpu/drm/i915/display/intel_fb_pin.c
@@ -93,7 +93,7 @@ intel_pin_fb_obj_dpt(struct drm_framebuffer *fb,
 
 	vma->display_alignment = max(vma->display_alignment, alignment);
 
-	i915_gem_object_flush_if_display(obj);
+	intel_bo_flush_if_display(obj);
 
 	i915_vma_get(vma);
 err:
diff --git a/drivers/gpu/drm/i915/gem/i915_gem_object_types.h b/drivers/gpu/drm/i915/gem/i915_gem_object_types.h
index 17db49464597..87171b142989 100644
--- a/drivers/gpu/drm/i915/gem/i915_gem_object_types.h
+++ b/drivers/gpu/drm/i915/gem/i915_gem_object_types.h
@@ -685,4 +685,6 @@ to_intel_bo(struct drm_gem_object *gem)
 	return container_of(gem, struct drm_i915_gem_object, base);
 }
 
+#define intel_bo_flush_if_display(obj) i915_gem_object_flush_if_display(obj)
+
 #endif
-- 
2.34.1



More information about the Intel-xe mailing list