[PATCH] drm/amdgpu: fix userptr flags check

Alex Deucher alexdeucher at gmail.com
Mon Nov 30 11:40:17 PST 2015


On Thu, Nov 26, 2015 at 9:42 PM, Michel Dänzer <michel at daenzer.net> wrote:
> On 26.11.2015 19:06, Christian König wrote:
>> From: Christian König <christian.koenig at amd.com>
>>
>> That got messed up while porting it from Radeon.
>>
>> Signed-off-by: Christian König <christian.koenig at amd.com>
>> Cc: stable at vger.kernel.org
>> ---
>>  drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c | 5 +++--
>>  1 file changed, 3 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
>> index 00c5b58..af53215 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
>> @@ -242,8 +242,9 @@ int amdgpu_gem_userptr_ioctl(struct drm_device *dev, void *data,
>>           AMDGPU_GEM_USERPTR_REGISTER))
>>               return -EINVAL;
>>
>> -     if (!(args->flags & AMDGPU_GEM_USERPTR_ANONONLY) ||
>> -                !(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 require anonymous
>>                  memory and install a MMU notifier */
>>
>
> Reviewed-by: Michel Dänzer <michel.daenzer at amd.com>


Applied.  thanks!

Alex

>
>
> --
> Earthling Michel Dänzer               |               http://www.amd.com
> Libre software enthusiast             |             Mesa and X developer


More information about the dri-devel mailing list