Skip to contentSkip to conversation

drm/amdgpu/gfx9: rework lbpw enable code

PATCH In review Alex Deucher 2 participants 2 messages Nov 8, 2018 – Nov 9, 2018 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/amdgpu/gfx9: rework lbpw enable code

To avoid changing the global lbpw module parameter directly.

---
 drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 29 ++++++++++++-----------------
 1 file changed, 12 insertions(+), 17 deletions(-)
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +12 -17
index 7abefb80f93d..138cc6c2caec 100644
@@ -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);
Signature · 6 lines
2.13.6

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): 20181108213804.18912-1-alexander.deucher-5C7GfCeVMHo@public.gmane.org

Reviewed-by Evan Quan
#2 lore raw
Quoted 64 lines

-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Alex Deucher
Sent: 2018年11月9日 5:38
To: [email protected]
Cc: Deucher, Alexander <[email protected]>
Subject: [PATCH] drm/amdgpu/gfx9: rework lbpw enable code

To avoid changing the global lbpw module parameter directly.

---
 drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 29 ++++++++++++---------------
--
 1 file changed, 12 insertions(+), 17 deletions(-)
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +12 -17
index 7abefb80f93d..138cc6c2caec 100644
@@ -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

Quoted 4 lines

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx