summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/msm/msm_ringbuffer.c
diff options
context:
space:
mode:
authorRob Clark <robdclark@chromium.org>2023-08-03 01:21:49 +0300
committerRob Clark <robdclark@chromium.org>2023-08-10 20:44:01 +0300
commit1a8b612ef09bcba3708443339adfad9802d3e9d8 (patch)
tree0a9bce8322c7cec720cf878ba323c07d652dce2e /drivers/gpu/drm/msm/msm_ringbuffer.c
parenta895037e1e98cd71f31ef3e4f266fb19d577b621 (diff)
downloadlinux-1a8b612ef09bcba3708443339adfad9802d3e9d8.tar.xz
drm/msm: Take lru lock once per job_run
Rather than acquiring it and dropping it for each individual obj. Signed-off-by: Rob Clark <robdclark@chromium.org> Patchwork: https://patchwork.freedesktop.org/patch/551019/
Diffstat (limited to 'drivers/gpu/drm/msm/msm_ringbuffer.c')
-rw-r--r--drivers/gpu/drm/msm/msm_ringbuffer.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/gpu/drm/msm/msm_ringbuffer.c b/drivers/gpu/drm/msm/msm_ringbuffer.c
index b60199184409..8b8353dcde9f 100644
--- a/drivers/gpu/drm/msm/msm_ringbuffer.c
+++ b/drivers/gpu/drm/msm/msm_ringbuffer.c
@@ -16,10 +16,13 @@ static struct dma_fence *msm_job_run(struct drm_sched_job *job)
struct msm_gem_submit *submit = to_msm_submit(job);
struct msm_fence_context *fctx = submit->ring->fctx;
struct msm_gpu *gpu = submit->gpu;
+ struct msm_drm_private *priv = gpu->dev->dev_private;
int i;
msm_fence_init(submit->hw_fence, fctx);
+ mutex_lock(&priv->lru.lock);
+
for (i = 0; i < submit->nr_bos; i++) {
struct drm_gem_object *obj = &submit->bos[i].obj->base;
@@ -28,6 +31,8 @@ static struct dma_fence *msm_job_run(struct drm_sched_job *job)
submit->bos[i].flags &= ~(BO_VMA_PINNED | BO_OBJ_PINNED);
}
+ mutex_unlock(&priv->lru.lock);
+
/* TODO move submit path over to using a per-ring lock.. */
mutex_lock(&gpu->lock);