mirror of
https://github.com/torvalds/linux.git
synced 2026-09-24 06:24:02 +02:00
drm/msm: Add helper to check for per-process pgtables VM
This will simplify a following commit to allow lazy VM creation to fail. Signed-off-by: Rob Clark <robin.clark@oss.qualcomm.com> Patchwork: https://patchwork.freedesktop.org/patch/743103/ Message-ID: <20260729155609.20190-9-robin.clark@oss.qualcomm.com>
This commit is contained in:
parent
b87c50d2ca
commit
517ca9a86a
|
|
@ -356,6 +356,12 @@ int adreno_fault_handler(struct msm_gpu *gpu, unsigned long iova, int flags,
|
|||
return 0;
|
||||
}
|
||||
|
||||
static bool
|
||||
valid_per_process_vm(struct msm_gpu *gpu, struct drm_gpuvm *vm)
|
||||
{
|
||||
return (vm != gpu->vm);
|
||||
}
|
||||
|
||||
int adreno_get_param(struct msm_gpu *gpu, struct msm_context *ctx,
|
||||
uint32_t param, uint64_t *value, uint32_t *len)
|
||||
{
|
||||
|
|
@ -414,12 +420,12 @@ int adreno_get_param(struct msm_gpu *gpu, struct msm_context *ctx,
|
|||
*value = gpu->suspend_count;
|
||||
return 0;
|
||||
case MSM_PARAM_VA_START:
|
||||
if (vm == gpu->vm)
|
||||
if (!valid_per_process_vm(gpu, vm))
|
||||
return UERR(EINVAL, drm, "requires per-process pgtables");
|
||||
*value = vm->mm_start;
|
||||
return 0;
|
||||
case MSM_PARAM_VA_SIZE:
|
||||
if (vm == gpu->vm)
|
||||
if (!valid_per_process_vm(gpu, vm))
|
||||
return UERR(EINVAL, drm, "requires per-process pgtables");
|
||||
*value = vm->mm_range;
|
||||
return 0;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user