diff options
author | Dmitry Baryshkov <dmitry.baryshkov@linaro.org> | 2023-02-14 05:09:55 +0300 |
---|---|---|
committer | Rob Clark <robdclark@chromium.org> | 2023-02-22 11:22:03 -0800 |
commit | b4fb748f0b734ce1d2e7834998cc599fcbd25d67 (patch) | |
tree | 0ed1e7d8965bf55f2d7184f69cd9778a1cef3873 /drivers | |
parent | 141f66ebbfa17cc7e2075f06c50107da978c965b (diff) | |
download | linux-stable-b4fb748f0b734ce1d2e7834998cc599fcbd25d67.tar.gz linux-stable-b4fb748f0b734ce1d2e7834998cc599fcbd25d67.tar.bz2 linux-stable-b4fb748f0b734ce1d2e7834998cc599fcbd25d67.zip |
drm/msm/a5xx: fix the emptyness check in the preempt code
Quoting Yassine: ring->memptrs->rptr is never updated and stays 0, so
the comparison always evaluates to false and get_next_ring always
returns ring 0 thinking it isn't empty.
Fix this by calling get_rptr() instead of reading rptr directly.
Reported-by: Yassine Oudjana <y.oudjana@protonmail.com>
Fixes: b1fc2839d2f9 ("drm/msm: Implement preemption for A5XX targets")
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Patchwork: https://patchwork.freedesktop.org/patch/522642/
Link: https://lore.kernel.org/r/20230214020956.164473-4-dmitry.baryshkov@linaro.org
Signed-off-by: Rob Clark <robdclark@chromium.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/gpu/drm/msm/adreno/a5xx_preempt.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpu/drm/msm/adreno/a5xx_preempt.c b/drivers/gpu/drm/msm/adreno/a5xx_preempt.c index 7658e89844b4..7e0affd60993 100644 --- a/drivers/gpu/drm/msm/adreno/a5xx_preempt.c +++ b/drivers/gpu/drm/msm/adreno/a5xx_preempt.c @@ -63,7 +63,7 @@ static struct msm_ringbuffer *get_next_ring(struct msm_gpu *gpu) struct msm_ringbuffer *ring = gpu->rb[i]; spin_lock_irqsave(&ring->preempt_lock, flags); - empty = (get_wptr(ring) == ring->memptrs->rptr); + empty = (get_wptr(ring) == gpu->funcs->get_rptr(gpu, ring)); spin_unlock_irqrestore(&ring->preempt_lock, flags); if (!empty) |