Skip to contentSkip to conversation

drm/amd/amdgpu: gfx9 tidy ups

PATCH In review Tom St Denis 3 participants 4 messages Jun 12, 2017 – Jun 13, 2017 3 messages not in the archive

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

PATCH 1/2 drm/amd/amdgpu: gfx9 tidy ups

A couple of simple tidy ups to register programming.

---
 drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 26 +++++++-------------------
 1 file changed, 7 insertions(+), 19 deletions(-)
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +7 -19
index c1e9756dd975..4f4aed4450fa 100644
@@ -635,7 +635,7 @@ static void gfx_v9_0_get_csb_buffer(struct amdgpu_device *adev,
 
 static void gfx_v9_0_init_lbpw(struct amdgpu_device *adev)
 {
-	uint32_t data = 0;
+	uint32_t data;
 
 	/* set mmRLC_LB_THR_CONFIG_1/2/3/4 */
 	WREG32_SOC15(GC, 0, mmRLC_LB_THR_CONFIG_1, 0x0000007F);
@@ -655,12 +655,9 @@ static void gfx_v9_0_init_lbpw(struct amdgpu_device *adev)
 	WREG32_SOC15(GC, 0, mmRLC_LB_INIT_CU_MASK, 0xffffffff);
 
 	/* set mmRLC_LB_PARAMS = 0x003F_1006 */
-	data |= (0x0003 << RLC_LB_PARAMS__FIFO_SAMPLES__SHIFT) &
-		RLC_LB_PARAMS__FIFO_SAMPLES_MASK;
-	data |= (0x0010 << RLC_LB_PARAMS__PG_IDLE_SAMPLES__SHIFT) &
-		RLC_LB_PARAMS__PG_IDLE_SAMPLES_MASK;
-	data |= (0x033F << RLC_LB_PARAMS__PG_IDLE_SAMPLE_INTERVAL__SHIFT) &
-		RLC_LB_PARAMS__PG_IDLE_SAMPLE_INTERVAL_MASK;
+	data = REG_SET_FIELD(data, RLC_LB_PARAMS, FIFO_SAMPLES, 0x0003);
+	data |= REG_SET_FIELD(data, RLC_LB_PARAMS, PG_IDLE_SAMPLES, 0x0010);
+	data |= REG_SET_FIELD(data, RLC_LB_PARAMS, PG_IDLE_SAMPLE_INTERVAL, 0x033F);
 	WREG32_SOC15(GC, 0, mmRLC_LB_PARAMS, data);
 
 	/* set mmRLC_GPM_GENERAL_7[31-16] = 0x00C0 */
@@ -675,24 +672,15 @@ static void gfx_v9_0_init_lbpw(struct amdgpu_device *adev)
 	/* set RLC_LB_CNTL = 0x8000_0095, 31 bit is reserved,
 	 * but used for RLC_LB_CNTL configuration */
 	data = RLC_LB_CNTL__LB_CNT_SPIM_ACTIVE_MASK;
-	data |= (0x09 << RLC_LB_CNTL__CU_MASK_USED_OFF_HYST__SHIFT) &
-		RLC_LB_CNTL__CU_MASK_USED_OFF_HYST_MASK;
-	data |= (0x80000 << RLC_LB_CNTL__RESERVED__SHIFT) &
-		RLC_LB_CNTL__RESERVED_MASK;
+	data |= REG_SET_FIELD(data, RLC_LB_CNTL, CU_MASK_USED_OFF_HYST, 0x09);
+	data |= REG_SET_FIELD(data, RLC_LB_CNTL, RESERVED, 0x80000);
 	WREG32_SOC15(GC, 0, mmRLC_LB_CNTL, data);
 	mutex_unlock(&adev->grbm_idx_mutex);
 }
 
 static void gfx_v9_0_enable_lbpw(struct amdgpu_device *adev, bool enable)
 {
-        uint32_t data = 0;
-
-        data = RREG32_SOC15(GC, 0, mmRLC_LB_CNTL);
-        if (enable)
-                data |= RLC_LB_CNTL__LOAD_BALANCE_ENABLE_MASK;
-        else
-                data &= ~RLC_LB_CNTL__LOAD_BALANCE_ENABLE_MASK;
-        WREG32_SOC15(GC, 0, mmRLC_LB_CNTL, data);
+	WREG32_FIELD15(GC, 0, RLC_LB_CNTL, LOAD_BALANCE_ENABLE, enable ? 1 : 0);
 }
 
 static void rv_init_cp_jump_table(struct amdgpu_device *adev)
Signature · 6 lines
2.12.0

_______________________________________________
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): [email protected]

#2 lore raw

PATCH 2/2 drm/amd/amdgpu: Rename KIQ ring to avoid spaces

Swap space for underscore in ring name.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c +1 -1
index dfbf0273585f..e26108aad3fe 100644
@@ -200,7 +200,7 @@ int amdgpu_gfx_kiq_init_ring(struct amdgpu_device *adev,
 		return r;
 
 	ring->eop_gpu_addr = kiq->eop_gpu_addr;
-	sprintf(ring->name, "kiq %d.%d.%d", ring->me, ring->pipe, ring->queue);
+	sprintf(ring->name, "kiq_%d.%d.%d", ring->me, ring->pipe, ring->queue);
 	r = amdgpu_ring_init(adev, ring, 1024,
 			     irq, AMDGPU_CP_KIQ_IRQ_DRIVER0);
 	if (r)
Signature · 6 lines
2.12.0

_______________________________________________
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): [email protected]

Reviewed-by Alex Deucher
#4 lore raw

RE: [PATCH 2/2] drm/amd/amdgpu: Rename KIQ ring to avoid spaces

Quoted 11 lines

-----Original Message-----
From: amd-gfx [mailto:[email protected]] On Behalf Of Tom St Denis
Sent: Monday, June 12, 2017 9:06 AM
To: [email protected]
Cc: StDenis, Tom
Subject: [PATCH 2/2] drm/amd/amdgpu: Rename KIQ ring to avoid spaces

Swap space for underscore in ring name.

Series is:

Quoted 24 lines
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c +1 -1
index dfbf0273585f..e26108aad3fe 100644
@@ -200,7 +200,7 @@ int amdgpu_gfx_kiq_init_ring(struct amdgpu_device
 *adev,
 		return r;
 
 	ring->eop_gpu_addr = kiq->eop_gpu_addr;
-	sprintf(ring->name, "kiq %d.%d.%d", ring->me, ring->pipe, ring-
 >queue);
+	sprintf(ring->name, "kiq_%d.%d.%d", ring->me, ring->pipe, ring-
 >queue);
drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c +0 -1
 	r = amdgpu_ring_init(adev, ring, 1024,
 			     irq, AMDGPU_CP_KIQ_IRQ_DRIVER0);
 	if (r)
--

2.12.0

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

A message that is not in the archive (sent off-list or not yet received): BN6PR12MB16523A24BF51ED3C321FEA79F7CD0-/b2+HYfkarQqUD6E6FAiowdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org

Reviewed-by
#6 lore raw

Re: [PATCH 2/2] drm/amd/amdgpu: Rename KIQ ring to avoid spaces

Am 12.06.2017 um 17:54 schrieb Deucher, Alexander:

Quoted 8 lines
Quoted 8 lines

-----Original Message-----
From: amd-gfx [mailto:[email protected]] On Behalf Of Tom St Denis
Sent: Monday, June 12, 2017 9:06 AM
To: [email protected]
Cc: StDenis, Tom
Subject: [PATCH 2/2] drm/amd/amdgpu: Rename KIQ ring to avoid spaces

Quoted 5 lines
Quoted 3 lines

Swap space for underscore in ring name.

Series is:

Quoted 25 lines
Quoted 25 lines
---
  drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c +1 -1
index dfbf0273585f..e26108aad3fe 100644
@@ -200,7 +200,7 @@ int amdgpu_gfx_kiq_init_ring(struct amdgpu_device
 *adev,
  		return r;
 
  	ring->eop_gpu_addr = kiq->eop_gpu_addr;
-	sprintf(ring->name, "kiq %d.%d.%d", ring->me, ring->pipe, ring-
 > queue);
+	sprintf(ring->name, "kiq_%d.%d.%d", ring->me, ring->pipe, ring-
 > queue);

r = amdgpu_ring_init(adev, ring, 1024,
irq, AMDGPU_CP_KIQ_IRQ_DRIVER0);
if (r)
--
2.12.0

Quoted 8 lines
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

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