Revert "drm/amdgpu: free up the first paging queue v2"

Submitted by Gang Ba on Aug. 23, 2019, 8:01 p.m.

Details

Message ID 1566590496-27967-1-git-send-email-gaba@amd.com
State Accepted
Commit 250af743c044c342916a36517187e6e42a281efe
Headers show
Series "Revert "drm/amdgpu: free up the first paging queue v2"" ( rev: 1 ) in AMD X.Org drivers

Not browsing as part of any series.

Commit Message

Gang Ba Aug. 23, 2019, 8:01 p.m.
This reverts commit 4f8bc72fbf10f2dc8bca74d5da08b3a981b2e5cd.

Change-Id: I577ba236e0571d11400a51f9d95840234aef678a
---
 drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c | 23 ++++++++---------------
 1 file changed, 8 insertions(+), 15 deletions(-)

Patch hide | download patch | download mbox

diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c b/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c
index b3b2c21..7750b37 100644
--- a/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c
@@ -2500,8 +2500,8 @@  static const struct amdgpu_buffer_funcs sdma_v4_0_buffer_funcs = {
 static void sdma_v4_0_set_buffer_funcs(struct amdgpu_device *adev)
 {
 	adev->mman.buffer_funcs = &sdma_v4_0_buffer_funcs;
-	if (adev->sdma.has_page_queue && adev->sdma.num_instances > 1)
-		adev->mman.buffer_funcs_ring = &adev->sdma.instance[1].page;
+	if (adev->sdma.has_page_queue)
+		adev->mman.buffer_funcs_ring = &adev->sdma.instance[0].page;
 	else
 		adev->mman.buffer_funcs_ring = &adev->sdma.instance[0].ring;
 }
@@ -2520,22 +2520,15 @@  static void sdma_v4_0_set_vm_pte_funcs(struct amdgpu_device *adev)
 	unsigned i;
 
 	adev->vm_manager.vm_pte_funcs = &sdma_v4_0_vm_pte_funcs;
-	if (adev->sdma.has_page_queue && adev->sdma.num_instances > 1) {
-		for (i = 1; i < adev->sdma.num_instances; i++) {
+	for (i = 0; i < adev->sdma.num_instances; i++) {
+		if (adev->sdma.has_page_queue)
 			sched = &adev->sdma.instance[i].page.sched;
-			adev->vm_manager.vm_pte_rqs[i - 1] =
-				&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;
-	} else {
-		for (i = 0; i < adev->sdma.num_instances; i++) {
+		else
 			sched = &adev->sdma.instance[i].ring.sched;
-			adev->vm_manager.vm_pte_rqs[i] =
-				&sched->sched_rq[DRM_SCHED_PRIORITY_KERNEL];
-		}
-		adev->vm_manager.vm_pte_num_rqs = adev->sdma.num_instances;
+		adev->vm_manager.vm_pte_rqs[i] =
+			&sched->sched_rq[DRM_SCHED_PRIORITY_KERNEL];
 	}
+	adev->vm_manager.vm_pte_num_rqs = adev->sdma.num_instances;
 }
 
 const struct amdgpu_ip_block_version sdma_v4_0_ip_block = {

Comments

Am 23.08.19 um 22:01 schrieb Gang Ba:
> This reverts commit 4f8bc72fbf10f2dc8bca74d5da08b3a981b2e5cd.
>
> Change-Id: I577ba236e0571d11400a51f9d95840234aef678a

Missing Signed-of-by line here. With that fixed Reviewed-by: Christian 
König <christian.koenig@amd.com>

> ---
>   drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c | 23 ++++++++---------------
>   1 file changed, 8 insertions(+), 15 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c b/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c
> index b3b2c21..7750b37 100644
> --- a/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c
> @@ -2500,8 +2500,8 @@ static const struct amdgpu_buffer_funcs sdma_v4_0_buffer_funcs = {
>   static void sdma_v4_0_set_buffer_funcs(struct amdgpu_device *adev)
>   {
>   	adev->mman.buffer_funcs = &sdma_v4_0_buffer_funcs;
> -	if (adev->sdma.has_page_queue && adev->sdma.num_instances > 1)
> -		adev->mman.buffer_funcs_ring = &adev->sdma.instance[1].page;
> +	if (adev->sdma.has_page_queue)
> +		adev->mman.buffer_funcs_ring = &adev->sdma.instance[0].page;
>   	else
>   		adev->mman.buffer_funcs_ring = &adev->sdma.instance[0].ring;
>   }
> @@ -2520,22 +2520,15 @@ static void sdma_v4_0_set_vm_pte_funcs(struct amdgpu_device *adev)
>   	unsigned i;
>   
>   	adev->vm_manager.vm_pte_funcs = &sdma_v4_0_vm_pte_funcs;
> -	if (adev->sdma.has_page_queue && adev->sdma.num_instances > 1) {
> -		for (i = 1; i < adev->sdma.num_instances; i++) {
> +	for (i = 0; i < adev->sdma.num_instances; i++) {
> +		if (adev->sdma.has_page_queue)
>   			sched = &adev->sdma.instance[i].page.sched;
> -			adev->vm_manager.vm_pte_rqs[i - 1] =
> -				&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;
> -	} else {
> -		for (i = 0; i < adev->sdma.num_instances; i++) {
> +		else
>   			sched = &adev->sdma.instance[i].ring.sched;
> -			adev->vm_manager.vm_pte_rqs[i] =
> -				&sched->sched_rq[DRM_SCHED_PRIORITY_KERNEL];
> -		}
> -		adev->vm_manager.vm_pte_num_rqs = adev->sdma.num_instances;
> +		adev->vm_manager.vm_pte_rqs[i] =
> +			&sched->sched_rq[DRM_SCHED_PRIORITY_KERNEL];
>   	}
> +	adev->vm_manager.vm_pte_num_rqs = adev->sdma.num_instances;
>   }
>   
>   const struct amdgpu_ip_block_version sdma_v4_0_ip_block = {
On 2019-08-24 1:10 p.m., Christian König wrote:
> Am 23.08.19 um 22:01 schrieb Gang Ba:
>> This reverts commit 4f8bc72fbf10f2dc8bca74d5da08b3a981b2e5cd.
>>
>> Change-Id: I577ba236e0571d11400a51f9d95840234aef678a
> 
> Missing Signed-of-by line here. With that fixed Reviewed-by: Christian
> König <christian.koenig@amd.com>

Every revert needs to explain in the commit log why the commit is being
reverted.
Am 25.08.19 um 17:29 schrieb Michel Dänzer:
> On 2019-08-24 1:10 p.m., Christian König wrote:
>> Am 23.08.19 um 22:01 schrieb Gang Ba:
>>> This reverts commit 4f8bc72fbf10f2dc8bca74d5da08b3a981b2e5cd.
>>>
>>> Change-Id: I577ba236e0571d11400a51f9d95840234aef678a
>> Missing Signed-of-by line here. With that fixed Reviewed-by: Christian
>> König <christian.koenig@amd.com>
> Every revert needs to explain in the commit log why the commit is being
> reverted.

Something like: It turned out that a single reserved queue wouldn't be 
sufficient for page fault handling.

Christian.