]> www.infradead.org Git - users/hch/misc.git/commitdiff
drm/i915/dsb: use generic poll_timeout_us() instead of wait_for()
authorJani Nikula <jani.nikula@intel.com>
Thu, 28 Aug 2025 12:20:58 +0000 (15:20 +0300)
committerJani Nikula <jani.nikula@intel.com>
Thu, 4 Sep 2025 11:02:59 +0000 (14:02 +0300)
Prefer generic poll helpers over i915 custom helpers.

The functional change is losing the exponentially growing sleep of
wait_for(), which used to be 10, 20, 40, ..., 640, and 1280 us.

Use an arbitrary constant 100 us sleep instead. The timeout remains at 1
ms.

Reviewed-by: Jouni Högander <jouni.hogander@intel.com>
Link: https://lore.kernel.org/r/979eae02af1184b3756746ace61379dd1947a79b.1756383233.git.jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
drivers/gpu/drm/i915/display/intel_dsb.c

index 53d8ae3a70e90d73a7613c8ad1f4712cfea92bcd..dee44d45b66873bc42d12a92ad83ab5a9ad673c9 100644 (file)
@@ -4,10 +4,11 @@
  *
  */
 
+#include <linux/iopoll.h>
+
 #include <drm/drm_print.h>
 #include <drm/drm_vblank.h>
 
-#include "i915_utils.h"
 #include "intel_crtc.h"
 #include "intel_de.h"
 #include "intel_display_regs.h"
@@ -871,8 +872,13 @@ void intel_dsb_wait(struct intel_dsb *dsb)
        struct intel_crtc *crtc = dsb->crtc;
        struct intel_display *display = to_intel_display(crtc->base.dev);
        enum pipe pipe = crtc->pipe;
+       bool is_busy;
+       int ret;
 
-       if (wait_for(!is_dsb_busy(display, pipe, dsb->id), 1)) {
+       ret = poll_timeout_us(is_busy = is_dsb_busy(display, pipe, dsb->id),
+                             !is_busy,
+                             100, 1000, false);
+       if (ret) {
                u32 offset = intel_dsb_buffer_ggtt_offset(&dsb->dsb_buf);
 
                intel_de_write_fw(display, DSB_CTRL(pipe, dsb->id),