[PATCH 3/8] drm/amdgpu: provide the page fault queue to the VM code

Christian König ckoenig.leichtzumerken at gmail.com
Fri Mar 29 14:24:50 UTC 2019


Am 29.03.19 um 15:23 schrieb Alex Deucher:
> On Fri, Mar 29, 2019 at 6:45 AM Christian König
> <ckoenig.leichtzumerken at gmail.com> wrote:
>> We are going to need that for recoverable page faults.
>>
>> Signed-off-by: Christian König <christian.koenig at amd.com>
>> ---
>>   drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h | 1 +
>>   drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c | 1 +
>>   2 files changed, 2 insertions(+)
>>
>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h
>> index beac15bca526..91baf95212a6 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h
>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h
>> @@ -303,6 +303,7 @@ struct amdgpu_vm_manager {
>>          const struct amdgpu_vm_pte_funcs        *vm_pte_funcs;
>>          struct drm_sched_rq                     *vm_pte_rqs[AMDGPU_MAX_RINGS];
>>          unsigned                                vm_pte_num_rqs;
>> +       struct amdgpu_ring                      *page_fault;
>>
>>          /* partial resident texture handling */
>>          spinlock_t                              prt_lock;
>> diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c b/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c
>> index 8691b621148e..44f4845dacf4 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c
>> @@ -2292,6 +2292,7 @@ static void sdma_v4_0_set_vm_pte_funcs(struct amdgpu_device *adev)
>>                                  &sched->sched_rq[DRM_SCHED_PRIORITY_KERNEL];
>>                  }
>>                  adev->vm_manager.vm_pte_num_rqs = adev->sdma.num_instances - 1;
>> +               adev->vm_manager.page_fault = &adev->sdma.instance[0].page;
> What about asics that don't have the page queue?  Shouldn't we handle
> them as well?

In this case the entry should just be NULL indicating that we don't have 
a page fault queue.

I just didn't see the point to explicitly set it to NULL on older ASICs.

Christian.

>
> Alex
>
>>          } else {
>>                  for (i = 0; i < adev->sdma.num_instances; i++) {
>>                          sched = &adev->sdma.instance[i].ring.sched;
>> --
>> 2.17.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