i915 has the Kconfig option DRM_I915_FENCE_TIMEOUT, defaulting to 10
seconds. xe doesn't use it, instead defaulting to
MAX_SCHEDULE_TIMEOUT. Unify the behaviour by switching to
dma_fence_wait() which defaults to MAX_SCHEDULE_TIMEOUT.

As dma_fence_wait() returns 0 when the fence was signaled, update the
return value check.

v2: Use dma_fence_wait(), fix return value check (Maarten)

Reviewed-by: Maarten Lankhorst <[email protected]>
Cc: Ville Syrjälä <[email protected]>
Signed-off-by: Jani Nikula <[email protected]>

---

I am not sure about all the implications here. I'm just wondering if we
need to go through all the trouble of adding an interface to query this
from the parent driver.
---
 drivers/gpu/drm/i915/display/intel_display.c  |  7 ++-----
 .../drm/xe/compat-i915-headers/i915_config.h  | 19 -------------------
 2 files changed, 2 insertions(+), 24 deletions(-)
 delete mode 100644 drivers/gpu/drm/xe/compat-i915-headers/i915_config.h

diff --git a/drivers/gpu/drm/i915/display/intel_display.c 
b/drivers/gpu/drm/i915/display/intel_display.c
index 069967114bd9..18d2f326d7f4 100644
--- a/drivers/gpu/drm/i915/display/intel_display.c
+++ b/drivers/gpu/drm/i915/display/intel_display.c
@@ -49,7 +49,6 @@
 #include "g4x_dp.h"
 #include "g4x_hdmi.h"
 #include "hsw_ips.h"
-#include "i915_config.h"
 #include "i915_drv.h"
 #include "i915_reg.h"
 #include "i9xx_plane.h"
@@ -7160,7 +7159,6 @@ static void skl_commit_modeset_enables(struct 
intel_atomic_state *state)
 
 static void intel_atomic_commit_fence_wait(struct intel_atomic_state 
*intel_state)
 {
-       struct drm_i915_private *i915 = to_i915(intel_state->base.dev);
        struct drm_plane *plane;
        struct drm_plane_state *new_plane_state;
        long ret;
@@ -7168,9 +7166,8 @@ static void intel_atomic_commit_fence_wait(struct 
intel_atomic_state *intel_stat
 
        for_each_new_plane_in_state(&intel_state->base, plane, new_plane_state, 
i) {
                if (new_plane_state->fence) {
-                       ret = dma_fence_wait_timeout(new_plane_state->fence, 
false,
-                                                    i915_fence_timeout(i915));
-                       if (ret <= 0)
+                       ret = dma_fence_wait(new_plane_state->fence, false);
+                       if (ret < 0)
                                break;
 
                        dma_fence_put(new_plane_state->fence);
diff --git a/drivers/gpu/drm/xe/compat-i915-headers/i915_config.h 
b/drivers/gpu/drm/xe/compat-i915-headers/i915_config.h
deleted file mode 100644
index e835bea08d1b..000000000000
--- a/drivers/gpu/drm/xe/compat-i915-headers/i915_config.h
+++ /dev/null
@@ -1,19 +0,0 @@
-/* SPDX-License-Identifier: MIT */
-/*
- * Copyright © 2023 Intel Corporation
- */
-
-#ifndef __I915_CONFIG_H__
-#define __I915_CONFIG_H__
-
-#include <linux/sched.h>
-
-struct drm_i915_private;
-
-static inline unsigned long
-i915_fence_timeout(const struct drm_i915_private *i915)
-{
-       return MAX_SCHEDULE_TIMEOUT;
-}
-
-#endif /* __I915_CONFIG_H__ */
-- 
2.47.3

Reply via email to