aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/msm/msm_ringbuffer.c
diff options
context:
space:
mode:
authorRob Clark <[email protected]>2022-09-23 22:40:44 +0000
committerRob Clark <[email protected]>2022-09-30 16:01:33 +0000
commit084b9e1732f71e36c21a820162c9f601577932c6 (patch)
tree1f26b8bcf169b3b871ed01f4dca5e5e4915bb6a4 /drivers/gpu/drm/msm/msm_ringbuffer.c
parentdrm/msm/hdmi: make hdmi_phy_8996 OF clk provider (diff)
downloadkernel-084b9e1732f71e36c21a820162c9f601577932c6.tar.gz
kernel-084b9e1732f71e36c21a820162c9f601577932c6.zip
drm/msm/gem: Unpin objects slightly later
The introduction of "drm/msm/gem: Evict active GEM objects when necessary" exposes a problem with "drm/msm/gem: Unpin buffers earlier", in that we need to keep the object pinned in the time the submit is queued up in the gpu scheduler. Otherwise the shrinker will see it as a thing that can be evicted if we wait for it to be signaled. But if the shrinker path is waiting on it with the obj lock held, the job cannot be scheduled, as that also requires briefly grabbing the obj lock, leading to deadlock. (Not to mention, we don't want the shrinker to evict an obj queued up in gpu scheduler.) Fixes: f371bcc0c2ac ("drm/msm/gem: Unpin buffers earlier") Fixes: 025d27239a2f ("drm/msm/gem: Evict active GEM objects when necessary") Closes: https://gitlab.freedesktop.org/drm/msm/-/issues/19 Signed-off-by: Rob Clark <[email protected]> Tested-by: Chia-I Wu <[email protected]> Patchwork: https://patchwork.freedesktop.org/patch/504528/ Link: https://lore.kernel.org/r/[email protected]
Diffstat (limited to 'drivers/gpu/drm/msm/msm_ringbuffer.c')
-rw-r--r--drivers/gpu/drm/msm/msm_ringbuffer.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/gpu/drm/msm/msm_ringbuffer.c b/drivers/gpu/drm/msm/msm_ringbuffer.c
index cad4c3525f0b..57a8e9564540 100644
--- a/drivers/gpu/drm/msm/msm_ringbuffer.c
+++ b/drivers/gpu/drm/msm/msm_ringbuffer.c
@@ -25,7 +25,8 @@ static struct dma_fence *msm_job_run(struct drm_sched_job *job)
msm_gem_lock(obj);
msm_gem_unpin_vma_fenced(submit->bos[i].vma, fctx);
- submit->bos[i].flags &= ~BO_VMA_PINNED;
+ msm_gem_unpin_locked(obj);
+ submit->bos[i].flags &= ~(BO_VMA_PINNED | BO_OBJ_PINNED);
msm_gem_unlock(obj);
}