On Mon, Jun 24, 2024 at 5:17 AM Christian König <ckoenig.leichtzumerken@xxxxxxxxx> wrote: > > This reverts commit 358c258a816baed4c6997b59c2117578a1360498. > > Jerome actually pointed out why that stuff doesn't work in 2016: > https://lists.freedesktop.org/archives/dri-devel/2016-March/103062.html > > Unfortunately the revert somehow got lost. > > Signed-off-by: Christian König <christian.koenig@xxxxxxx> > Fixes: 358c258a816baed4c6997b59c2117578a1360498 Fixes: 358c258a816b ("drm/amdgpu: allow write access to mapped userptrs") Acked-by: Alex Deucher <alexander.deucher@xxxxxxx> > --- > drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c | 8 +++++--- > 1 file changed, 5 insertions(+), 3 deletions(-) > > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c > index 3adaa4670103..331969b96a5a 100644 > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c > @@ -433,10 +433,12 @@ int amdgpu_gem_userptr_ioctl(struct drm_device *dev, void *data, > AMDGPU_GEM_USERPTR_REGISTER)) > return -EINVAL; > > - if (!(args->flags & AMDGPU_GEM_USERPTR_READONLY) && > - !(args->flags & AMDGPU_GEM_USERPTR_REGISTER)) { > + if (!(args->flags & AMDGPU_GEM_USERPTR_READONLY) && ( > + !(args->flags & AMDGPU_GEM_USERPTR_ANONONLY) || > + !(args->flags & AMDGPU_GEM_USERPTR_REGISTER))) { > > - /* if we want to write to it we must install a MMU notifier */ > + /* if we want to write to it we must require anonymous > + memory and install a MMU notifier */ > return -EACCES; > } > > -- > 2.34.1 >