Make the RPS boost code independent of i915 request code by moving the
dma_fence_is_i915() check to the RPS boost call.

Signed-off-by: Jani Nikula <[email protected]>

---

I'm not actually sure what the non-i915 fences would be here, and what
kind of overhead they would cause.
---
 drivers/gpu/drm/i915/display/intel_display_rps.c | 4 ----
 drivers/gpu/drm/i915/gt/intel_rps.c              | 7 ++++++-
 2 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/intel_display_rps.c 
b/drivers/gpu/drm/i915/display/intel_display_rps.c
index 27714b75d32d..44cb9dba0c19 100644
--- a/drivers/gpu/drm/i915/display/intel_display_rps.c
+++ b/drivers/gpu/drm/i915/display/intel_display_rps.c
@@ -10,7 +10,6 @@
 #include <drm/intel/display_parent_interface.h>
 
 #include "i915_reg.h"
-#include "i915_request.h"
 #include "intel_display_core.h"
 #include "intel_display_irq.h"
 #include "intel_display_rps.h"
@@ -49,9 +48,6 @@ void intel_display_rps_boost_after_vblank(struct drm_crtc 
*crtc,
        if (!display->parent->rps)
                return;
 
-       if (!dma_fence_is_i915(fence))
-               return;
-
        if (DISPLAY_VER(display) < 6)
                return;
 
diff --git a/drivers/gpu/drm/i915/gt/intel_rps.c 
b/drivers/gpu/drm/i915/gt/intel_rps.c
index 61d746bda462..05b21de6c24b 100644
--- a/drivers/gpu/drm/i915/gt/intel_rps.c
+++ b/drivers/gpu/drm/i915/gt/intel_rps.c
@@ -2917,7 +2917,12 @@ EXPORT_SYMBOL_GPL(i915_gpu_turbo_disable);
 
 static void boost(struct dma_fence *fence)
 {
-       struct i915_request *rq = to_request(fence);
+       struct i915_request *rq;
+
+       if (!dma_fence_is_i915(fence))
+               return;
+
+       rq = to_request(fence);
 
        /*
         * If we missed the vblank, but the request is already running it
-- 
2.47.3

Reply via email to