[PATCH 1/3] drm/amdgpu: Keep track of amount of pinned CPU visible VRAM

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2018-07-12 09:38 AM, Christian König wrote:
> Am 11.07.2018 um 18:23 schrieb Michel Dänzer:
>> From: Michel Dänzer <michel.daenzer at amd.com>
>>
>> Instead of CPU invisible VRAM. Preparation for the following, no
>> functional change intended.
>>
>> Cc: stable at vger.kernel.org
>> Signed-off-by: Michel Dänzer <michel.daenzer at amd.com>
>>
>> [...]
>>              
>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
>> b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
>> index 9ee678d63890..752484328665 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
>> @@ -917,7 +917,8 @@ int amdgpu_bo_pin_restricted(struct amdgpu_bo *bo,
>> u32 domain,
>>       domain = amdgpu_mem_type_to_domain(bo->tbo.mem.mem_type);
>>       if (domain == AMDGPU_GEM_DOMAIN_VRAM) {
>>           adev->vram_pin_size += amdgpu_bo_size(bo);
>> -        adev->invisible_pin_size +=
>> amdgpu_vram_mgr_bo_invisible_size(bo);
>> +        adev->visible_pin_size +=
>> +            amdgpu_bo_size(bo) - amdgpu_vram_mgr_bo_invisible_size(bo);
> 
> Any particular reason why we should not invert
> amdgpu_vram_mgr_bo_invisible_size() as well?

Right, that occurred to me as well in the meantime. I was planning to
send a follow-up patch for this, but since patch 3 needs a v2 anyway,
I'll do a v2 of this one as well.


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


[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux