[PATCH] drm/amdgpu: Fix a false positive when pin non-VRAM memory

Felix Kuehling felix.kuehling at amd.com
Tue Feb 2 16:31:28 UTC 2021


Am 2021-02-02 um 11:17 a.m. schrieb Alex Deucher:
> On Fri, Jan 29, 2021 at 8:00 PM xinhui pan <xinhui.pan at amd.com> wrote:
>> Flag TTM_PL_FLAG_CONTIGUOUS is only valid for VRAM domain. So fix the
>> false positive by checking memory type too.
>>
>> Suggested-by: Felix Kuehling <Felix.Kuehling at amd.com>
>> Acked-by: Christian König <christian.koenig at amd.com>
>> Signed-off-by: xinhui pan <xinhui.pan at amd.com>
> @Kuehling, Felix I presume this fixes the regression you noted last week?

Yes. This is the fix I mentioned.

Thanks,
  Felix


>
> Alex
>
>
>> ---
>>  drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 3 ++-
>>  1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
>> index 137f275f90ee..56854a3ee19c 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
>> @@ -919,7 +919,8 @@ int amdgpu_bo_pin_restricted(struct amdgpu_bo *bo, u32 domain,
>>                 if (!(domain & amdgpu_mem_type_to_domain(mem_type)))
>>                         return -EINVAL;
>>
>> -               if ((bo->flags & AMDGPU_GEM_CREATE_VRAM_CONTIGUOUS) &&
>> +               if ((mem_type == TTM_PL_VRAM) &&
>> +                   (bo->flags & AMDGPU_GEM_CREATE_VRAM_CONTIGUOUS) &&
>>                     !(mem_flags & TTM_PL_FLAG_CONTIGUOUS))
>>                         return -EINVAL;
>>
>> --
>> 2.25.1
>>
>> _______________________________________________
>> amd-gfx mailing list
>> amd-gfx at lists.freedesktop.org
>> https://lists.freedesktop.org/mailman/listinfo/amd-gfx


More information about the amd-gfx mailing list