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.

This should be possible now that commit 3aef9c94c02b ("drm/i915: Perform
full wedge on display reset") has been merged, and we no longer rely on
the timeout.

v3: Try this again with full wedge

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]>
---
 drivers/gpu/drm/i915/display/intel_display.c     |  6 ++----
 .../gpu/drm/xe/compat-i915-headers/i915_config.h | 16 ----------------
 2 files changed, 2 insertions(+), 20 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 9151ea6c15ab..579b03034c46 100644
--- a/drivers/gpu/drm/i915/display/intel_display.c
+++ b/drivers/gpu/drm/i915/display/intel_display.c
@@ -50,7 +50,6 @@
 #include "g4x_dp.h"
 #include "g4x_hdmi.h"
 #include "hsw_ips.h"
-#include "i915_config.h"
 #include "i9xx_plane.h"
 #include "i9xx_plane_regs.h"
 #include "i9xx_wm.h"
@@ -7298,9 +7297,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());
-                       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 d4522203e2dd..000000000000
--- a/drivers/gpu/drm/xe/compat-i915-headers/i915_config.h
+++ /dev/null
@@ -1,16 +0,0 @@
-/* SPDX-License-Identifier: MIT */
-/*
- * Copyright © 2023 Intel Corporation
- */
-
-#ifndef __I915_CONFIG_H__
-#define __I915_CONFIG_H__
-
-#include <linux/sched.h>
-
-static inline unsigned long i915_fence_timeout(void)
-{
-       return MAX_SCHEDULE_TIMEOUT;
-}
-
-#endif /* __I915_CONFIG_H__ */
-- 
2.47.3

Reply via email to