diff options
| author | Rob Clark <[email protected]> | 2025-06-29 20:12:59 +0000 |
|---|---|---|
| committer | Rob Clark <[email protected]> | 2025-07-05 00:48:35 +0000 |
| commit | 62a28e272b87aee1b225942cf80505da1e220def (patch) | |
| tree | 60065cfb9c03fce87095cc48a35d6d89667b1093 /drivers/gpu/drm/msm/msm_gem.c | |
| parent | drm/msm: Use drm_gpuvm types more (diff) | |
| download | kernel-62a28e272b87aee1b225942cf80505da1e220def.tar.gz kernel-62a28e272b87aee1b225942cf80505da1e220def.zip | |
drm/msm: Split out helper to get iommu prot flags
We'll re-use this in the vm_bind path.
Signed-off-by: Rob Clark <[email protected]>
Signed-off-by: Rob Clark <[email protected]>
Tested-by: Antonino Maniscalco <[email protected]>
Reviewed-by: Antonino Maniscalco <[email protected]>
Patchwork: https://patchwork.freedesktop.org/patch/661484/
Diffstat (limited to 'drivers/gpu/drm/msm/msm_gem.c')
| -rw-r--r-- | drivers/gpu/drm/msm/msm_gem.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/drivers/gpu/drm/msm/msm_gem.c b/drivers/gpu/drm/msm/msm_gem.c index 763bafcff4cc..20d5e4b4d057 100644 --- a/drivers/gpu/drm/msm/msm_gem.c +++ b/drivers/gpu/drm/msm/msm_gem.c @@ -462,10 +462,9 @@ static struct drm_gpuva *get_vma_locked(struct drm_gem_object *obj, return vma; } -int msm_gem_pin_vma_locked(struct drm_gem_object *obj, struct drm_gpuva *vma) +int msm_gem_prot(struct drm_gem_object *obj) { struct msm_gem_object *msm_obj = to_msm_bo(obj); - struct page **pages; int prot = IOMMU_READ; if (!(msm_obj->flags & MSM_BO_GPU_READONLY)) @@ -477,6 +476,15 @@ int msm_gem_pin_vma_locked(struct drm_gem_object *obj, struct drm_gpuva *vma) if (msm_obj->flags & MSM_BO_CACHED_COHERENT) prot |= IOMMU_CACHE; + return prot; +} + +int msm_gem_pin_vma_locked(struct drm_gem_object *obj, struct drm_gpuva *vma) +{ + struct msm_gem_object *msm_obj = to_msm_bo(obj); + struct page **pages; + int prot = msm_gem_prot(obj); + msm_gem_assert_locked(obj); pages = msm_gem_get_pages_locked(obj, MSM_MADV_WILLNEED); |
