Add i915_gem_fence_wait_priority_display() helper to wait with
I915_PRIORITY_DISPLAY. This drops the intel_plane.c dependency on
i915_scheduler_types.h, and allows us to remove the compat header from
xe.

Signed-off-by: Jani Nikula <[email protected]>
---
 drivers/gpu/drm/i915/display/intel_plane.c          |  5 +----
 drivers/gpu/drm/i915/gem/i915_gem_object.h          |  1 +
 drivers/gpu/drm/i915/gem/i915_gem_wait.c            |  7 +++++++
 .../xe/compat-i915-headers/gem/i915_gem_object.h    |  4 +---
 .../xe/compat-i915-headers/i915_scheduler_types.h   | 13 -------------
 5 files changed, 10 insertions(+), 20 deletions(-)
 delete mode 100644 
drivers/gpu/drm/xe/compat-i915-headers/i915_scheduler_types.h

diff --git a/drivers/gpu/drm/i915/display/intel_plane.c 
b/drivers/gpu/drm/i915/display/intel_plane.c
index 2329f09d413d..19d4640c0e53 100644
--- a/drivers/gpu/drm/i915/display/intel_plane.c
+++ b/drivers/gpu/drm/i915/display/intel_plane.c
@@ -45,7 +45,6 @@
 #include <drm/drm_panic.h>
 
 #include "gem/i915_gem_object.h"
-#include "i915_scheduler_types.h"
 #include "i9xx_plane_regs.h"
 #include "intel_cdclk.h"
 #include "intel_cursor.h"
@@ -1172,7 +1171,6 @@ static int
 intel_prepare_plane_fb(struct drm_plane *_plane,
                       struct drm_plane_state *_new_plane_state)
 {
-       struct i915_sched_attr attr = { .priority = I915_PRIORITY_DISPLAY };
        struct intel_plane *plane = to_intel_plane(_plane);
        struct intel_display *display = to_intel_display(plane);
        struct intel_plane_state *new_plane_state =
@@ -1221,8 +1219,7 @@ intel_prepare_plane_fb(struct drm_plane *_plane,
                goto unpin_fb;
 
        if (new_plane_state->uapi.fence) {
-               i915_gem_fence_wait_priority(new_plane_state->uapi.fence,
-                                            &attr);
+               
i915_gem_fence_wait_priority_display(new_plane_state->uapi.fence);
 
                intel_display_rps_boost_after_vblank(new_plane_state->hw.crtc,
                                                     
new_plane_state->uapi.fence);
diff --git a/drivers/gpu/drm/i915/gem/i915_gem_object.h 
b/drivers/gpu/drm/i915/gem/i915_gem_object.h
index 148034ef504d..8878539c10ed 100644
--- a/drivers/gpu/drm/i915/gem/i915_gem_object.h
+++ b/drivers/gpu/drm/i915/gem/i915_gem_object.h
@@ -802,6 +802,7 @@ static inline void __start_cpu_write(struct 
drm_i915_gem_object *obj)
 
 void i915_gem_fence_wait_priority(struct dma_fence *fence,
                                  const struct i915_sched_attr *attr);
+void i915_gem_fence_wait_priority_display(struct dma_fence *fence);
 
 int i915_gem_object_wait(struct drm_i915_gem_object *obj,
                         unsigned int flags,
diff --git a/drivers/gpu/drm/i915/gem/i915_gem_wait.c 
b/drivers/gpu/drm/i915/gem/i915_gem_wait.c
index 54829801d3f7..2893df65c359 100644
--- a/drivers/gpu/drm/i915/gem/i915_gem_wait.c
+++ b/drivers/gpu/drm/i915/gem/i915_gem_wait.c
@@ -138,6 +138,13 @@ void i915_gem_fence_wait_priority(struct dma_fence *fence,
        local_bh_enable(); /* kick the tasklets if queues were reprioritised */
 }
 
+void i915_gem_fence_wait_priority_display(struct dma_fence *fence)
+{
+       struct i915_sched_attr attr = { .priority = I915_PRIORITY_DISPLAY };
+
+       i915_gem_fence_wait_priority(fence, &attr);
+}
+
 int
 i915_gem_object_wait_priority(struct drm_i915_gem_object *obj,
                              unsigned int flags,
diff --git a/drivers/gpu/drm/xe/compat-i915-headers/gem/i915_gem_object.h 
b/drivers/gpu/drm/xe/compat-i915-headers/gem/i915_gem_object.h
index 8a048980ea38..0548b2e0316f 100644
--- a/drivers/gpu/drm/xe/compat-i915-headers/gem/i915_gem_object.h
+++ b/drivers/gpu/drm/xe/compat-i915-headers/gem/i915_gem_object.h
@@ -5,10 +5,8 @@
 #define __I915_GEM_OBJECT_H__
 
 struct dma_fence;
-struct i915_sched_attr;
 
-static inline void i915_gem_fence_wait_priority(struct dma_fence *fence,
-                                               const struct i915_sched_attr 
*attr)
+static inline void i915_gem_fence_wait_priority_display(struct dma_fence 
*fence)
 {
 }
 
diff --git a/drivers/gpu/drm/xe/compat-i915-headers/i915_scheduler_types.h 
b/drivers/gpu/drm/xe/compat-i915-headers/i915_scheduler_types.h
deleted file mode 100644
index c11130440d31..000000000000
--- a/drivers/gpu/drm/xe/compat-i915-headers/i915_scheduler_types.h
+++ /dev/null
@@ -1,13 +0,0 @@
-/* SPDX-License-Identifier: MIT */
-/* Copyright © 2025 Intel Corporation */
-
-#ifndef __I915_SCHEDULER_TYPES_H__
-#define __I915_SCHEDULER_TYPES_H__
-
-#define I915_PRIORITY_DISPLAY 0
-
-struct i915_sched_attr {
-       int priority;
-};
-
-#endif
-- 
2.47.3

Reply via email to