All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/amdgpu/gfx9: rework lbpw enable code
@ 2018-11-08 21:38 Alex Deucher
       [not found] ` <20181108213804.18912-1-alexander.deucher-5C7GfCeVMHo@public.gmane.org>
  0 siblings, 1 reply; 2+ messages in thread
From: Alex Deucher @ 2018-11-08 21:38 UTC (permalink / raw)
  To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW; +Cc: Alex Deucher

To avoid changing the global lbpw module parameter directly.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 29 ++++++++++++-----------------
 1 file changed, 12 insertions(+), 17 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
index 7abefb80f93d..138cc6c2caec 100644
--- a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
@@ -2499,26 +2499,21 @@ static int gfx_v9_0_rlc_resume(struct amdgpu_device *adev)
 			return r;
 	}
 
-	if (amdgpu_lbpw == -1) {
-		switch (adev->asic_type) {
-		case CHIP_RAVEN:
-			amdgpu_lbpw = 1;
-			break;
-		case CHIP_VEGA20:
-			amdgpu_lbpw = 0;
-			break;
-		default:
-			amdgpu_lbpw = 0;
-			break;
-		}
-	}
-
-	if (adev->asic_type == CHIP_RAVEN ||
-	    adev->asic_type == CHIP_VEGA20) {
-		if (amdgpu_lbpw != 0)
+	switch (adev->asic_type) {
+	case CHIP_RAVEN:
+		if (amdgpu_lbpw == 0)
+			gfx_v9_0_enable_lbpw(adev, false);
+		else
+			gfx_v9_0_enable_lbpw(adev, true);
+		break;
+	case CHIP_VEGA20:
+		if (amdgpu_lbpw > 0)
 			gfx_v9_0_enable_lbpw(adev, true);
 		else
 			gfx_v9_0_enable_lbpw(adev, false);
+		break;
+	default:
+		break;
 	}
 
 	gfx_v9_0_rlc_start(adev);
-- 
2.13.6

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* RE: [PATCH] drm/amdgpu/gfx9: rework lbpw enable code
       [not found] ` <20181108213804.18912-1-alexander.deucher-5C7GfCeVMHo@public.gmane.org>
@ 2018-11-09  1:45   ` Quan, Evan
  0 siblings, 0 replies; 2+ messages in thread
From: Quan, Evan @ 2018-11-09  1:45 UTC (permalink / raw)
  To: Alex Deucher, amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW; +Cc: Deucher, Alexander

Reviewed-by: Evan Quan <evan.quan@amd.com>

> -----Original Message-----
> From: amd-gfx <amd-gfx-bounces@lists.freedesktop.org> On Behalf Of Alex
> Deucher
> Sent: 2018年11月9日 5:38
> To: amd-gfx@lists.freedesktop.org
> Cc: Deucher, Alexander <Alexander.Deucher@amd.com>
> Subject: [PATCH] drm/amdgpu/gfx9: rework lbpw enable code
> 
> To avoid changing the global lbpw module parameter directly.
> 
> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
> ---
>  drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 29 ++++++++++++---------------
> --
>  1 file changed, 12 insertions(+), 17 deletions(-)
> 
> diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
> b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
> index 7abefb80f93d..138cc6c2caec 100644
> --- a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
> @@ -2499,26 +2499,21 @@ static int gfx_v9_0_rlc_resume(struct
> amdgpu_device *adev)
>  			return r;
>  	}
> 
> -	if (amdgpu_lbpw == -1) {
> -		switch (adev->asic_type) {
> -		case CHIP_RAVEN:
> -			amdgpu_lbpw = 1;
> -			break;
> -		case CHIP_VEGA20:
> -			amdgpu_lbpw = 0;
> -			break;
> -		default:
> -			amdgpu_lbpw = 0;
> -			break;
> -		}
> -	}
> -
> -	if (adev->asic_type == CHIP_RAVEN ||
> -	    adev->asic_type == CHIP_VEGA20) {
> -		if (amdgpu_lbpw != 0)
> +	switch (adev->asic_type) {
> +	case CHIP_RAVEN:
> +		if (amdgpu_lbpw == 0)
> +			gfx_v9_0_enable_lbpw(adev, false);
> +		else
> +			gfx_v9_0_enable_lbpw(adev, true);
> +		break;
> +	case CHIP_VEGA20:
> +		if (amdgpu_lbpw > 0)
>  			gfx_v9_0_enable_lbpw(adev, true);
>  		else
>  			gfx_v9_0_enable_lbpw(adev, false);
> +		break;
> +	default:
> +		break;
>  	}
> 
>  	gfx_v9_0_rlc_start(adev);
> --
> 2.13.6
> 
> _______________________________________________
> amd-gfx mailing list
> amd-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-11-09  1:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-08 21:38 [PATCH] drm/amdgpu/gfx9: rework lbpw enable code Alex Deucher
     [not found] ` <20181108213804.18912-1-alexander.deucher-5C7GfCeVMHo@public.gmane.org>
2018-11-09  1:45   ` Quan, Evan

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.