[PATCH 5/7] drm/amdgpu: manually map the shadow BOs again

Christian König ckoenig.leichtzumerken at gmail.com
Thu Aug 30 12:16:12 UTC 2018


Am 30.08.2018 um 05:29 schrieb Zhang, Jerry (Junwei):
> On 08/29/2018 10:08 PM, Christian König wrote:
>> Otherwise we won't be able to use the AGP aperture.
>
> do you mean we use AGP for GTT shadow only now?

No, on older hw generations the page tables are usually larger than one 
PAGE.

So we need to work a bit more on this,
Christian.

>
> Jerry
>>
>> Signed-off-by: Christian König <christian.koenig at amd.com>
>> ---
>>   drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 5 +----
>>   drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c     | 5 +++++
>>   2 files changed, 6 insertions(+), 4 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c 
>> b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
>> index 0cbf651a88a6..de990bdcdd6c 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
>> @@ -163,10 +163,7 @@ void amdgpu_bo_placement_from_domain(struct 
>> amdgpu_bo *abo, u32 domain)
>>
>>       if (domain & AMDGPU_GEM_DOMAIN_GTT) {
>>           places[c].fpfn = 0;
>> -        if (flags & AMDGPU_GEM_CREATE_SHADOW)
>> -            places[c].lpfn = adev->gmc.gart_size >> PAGE_SHIFT;
>> -        else
>> -            places[c].lpfn = 0;
>> +        places[c].lpfn = 0;
>>           places[c].flags = TTM_PL_FLAG_TT;
>>           if (flags & AMDGPU_GEM_CREATE_CPU_GTT_USWC)
>>               places[c].flags |= TTM_PL_FLAG_WC |
>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c 
>> b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
>> index a3675c7b6190..abe1db4c63f9 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
>> @@ -346,6 +346,11 @@ int amdgpu_vm_validate_pt_bos(struct 
>> amdgpu_device *adev, struct amdgpu_vm *vm,
>>               r = amdgpu_ttm_alloc_gart(&bo->tbo);
>>               if (r)
>>                   break;
>> +            if (bo->shadow) {
>> +                r = amdgpu_ttm_alloc_gart(&bo->shadow->tbo);
>> +                if (r)
>> +                    break;
>> +            }
>>               list_move(&bo_base->vm_status, &vm->relocated);
>>           }
>>       }
>>



More information about the amd-gfx mailing list