]> git.baikalelectronics.ru Git - kernel.git/commit
drm/msm/gem: Separate object and vma unpin
authorRob Clark <robdclark@chromium.org>
Fri, 27 May 2022 17:23:40 +0000 (10:23 -0700)
committerRob Clark <robdclark@chromium.org>
Wed, 15 Jun 2022 20:06:54 +0000 (13:06 -0700)
commit22aa7de70109968ee0fc959500533413f30f60c8
treefa4d43dcbc75e0e27d23ca154f7ea50626dec28a
parentc43d9f73c6dee578eee432663efa812033bfae27
drm/msm/gem: Separate object and vma unpin

Previously the BO_PINNED state in the submit was tracking two related
but different things: (1) that the buffer object was pinned, and (2)
that the vma (mapping within a set of pagetables) was pinned.  But with
fenced vma unpin (needed so that userspace couldn't race with retire
path for releasing a vma) these two were decoupled.  The fact that the
BO_PINNED flag was already cleared meant that we leaked the bo pin count
which should have been dropped when the submit was retired.

So split this state into BO_OBJ_PINNED and BO_VMA_PINNED, so they can be
dropped independently.

Fixes: bbbf177d61af ("drm/msm/gem: Add fenced vma unpin")
Signed-off-by: Rob Clark <robdclark@chromium.org>
Patchwork: https://patchwork.freedesktop.org/patch/487559/
Link: https://lore.kernel.org/r/20220527172341.2151005-1-robdclark@gmail.com
drivers/gpu/drm/msm/msm_gem.c
drivers/gpu/drm/msm/msm_gem.h
drivers/gpu/drm/msm/msm_gem_submit.c
drivers/gpu/drm/msm/msm_ringbuffer.c