drm/v3d: Replace wait_for macros to remove use of msleep (#3510)
authorYukimasa Sugizaki <4298265+Terminus-IMRC@users.noreply.github.com>
Fri, 20 Mar 2020 10:01:23 +0000 (19:01 +0900)
committerGitHub <noreply@github.com>
Fri, 20 Mar 2020 10:01:23 +0000 (10:01 +0000)
commit06606627043f72d22881563d485268fec2acd56d
treee59c1fed9c4a4cbb671804a8543b4be1c05298a4
parent4137a0c092ab26fd3b40f49b321988e99800d085
drm/v3d: Replace wait_for macros to remove use of msleep (#3510)

commit 9daee6141cc9c75b09659b02b1cb9eeb2f5e16cc upstream.

The wait_for macro's for Broadcom V3D driver used msleep, which is
inappropriate due to its inaccuracy at low values (minimum wait time
is about 30ms on the Raspberry Pi).  This sleep was triggering in
v3d_clean_caches(), causing us to only be able to dispatch ~33 compute
jobs per second.

This patch replaces the macro with the one from the Intel i915 version
which uses usleep_range to provide more accurate waits.

v2: Split from the vc4 patch so that we can confidently apply to
    stable (by anholt)

Signed-off-by: James Hughes <james.hughes@raspberrypi.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
Link: https://patchwork.freedesktop.org/patch/msgid/20200217153145.13780-1-james.hughes@raspberrypi.com
Link: https://github.com/raspberrypi/linux/issues/3460
Fixes: 57692c94dcbe ("drm/v3d: Introduce a new DRM driver for Broadcom V3D V3.x+")

Co-authored-by: James Hughes <james.hughes@raspberrypi.com>
drivers/gpu/drm/v3d/v3d_drv.h