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

Reviewed-by: Ville Syrjälä <[email protected]>
Signed-off-by: Jani Nikula <[email protected]>
---
 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 d639d9152bf5..e77811396474 100644
--- a/drivers/gpu/drm/i915/display/intel_display_rps.c
+++ b/drivers/gpu/drm/i915/display/intel_display_rps.c
@@ -9,7 +9,6 @@
 #include <drm/drm_vblank.h>
 
 #include "i915_reg.h"
-#include "i915_request.h"
 #include "intel_display_core.h"
 #include "intel_display_irq.h"
 #include "intel_display_rps.h"
@@ -54,9 +53,6 @@ void intel_display_rps_boost_after_vblank(struct drm_crtc 
*crtc,
        if (!intel_parent_rps_available(display))
                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 c42a1ee42b58..d233dc122bd7 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_if_not_started(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 (!i915_request_started(rq))
                intel_rps_boost(rq);
-- 
2.47.3

Reply via email to