[PATCH v3 10/10] drm/msm: Add a way for userspace to allocate GPU iova
Dmitry Osipenko
dmitry.osipenko at collabora.com
Thu Apr 7 09:58:22 UTC 2022
On 4/7/22 00:46, Rob Clark wrote:
> From: Rob Clark <robdclark at chromium.org>
>
> The motivation at this point is mainly native userspace mesa driver in a
> VM guest. The one remaining synchronous "hotpath" is buffer allocation,
> because guest needs to wait to know the bo's iova before it can start
> emitting cmdstream/state that references the new bo. By allocating the
> iova in the guest userspace, we no longer need to wait for a response
> from the host, but can just rely on the allocation request being
> processed before the cmdstream submission. Allocation failures (OoM,
> etc) would just be treated as context-lost (ie. GL_GUILTY_CONTEXT_RESET)
> or subsequent allocations (or readpix, etc) can raise GL_OUT_OF_MEMORY.
>
> v2: Fix inuse check
> v3: Change mismatched iova case to -EBUSY
>
> Signed-off-by: Rob Clark <robdclark at chromium.org>
> Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov at linaro.org>
> ---
> drivers/gpu/drm/msm/adreno/adreno_gpu.c | 10 ++++++
> drivers/gpu/drm/msm/msm_drv.c | 21 +++++++++++
> drivers/gpu/drm/msm/msm_gem.c | 48 +++++++++++++++++++++++++
> drivers/gpu/drm/msm/msm_gem.h | 8 +++++
> drivers/gpu/drm/msm/msm_gem_vma.c | 2 ++
> include/uapi/drm/msm_drm.h | 3 ++
> 6 files changed, 92 insertions(+)
Reviewed-by: Dmitry Osipenko <dmitry.osipenko at collabora.com>
More information about the dri-devel
mailing list