All of lore.kernel.org
 help / color / mirror / Atom feed
* Clean up indirect SQ register accessors for gfx7/8
@ 2016-11-07 15:35 Tom St Denis
       [not found] ` <20161107153550.15344-1-tom.stdenis-5C7GfCeVMHo@public.gmane.org>
  0 siblings, 1 reply; 4+ messages in thread
From: Tom St Denis @ 2016-11-07 15:35 UTC (permalink / raw)
  To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

Denumberify the two indirect accessors to make the code cleaner.

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

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

* [PATCH 1/2] drm/amd/amdgpu: Clean up wave gfx7 helper
       [not found] ` <20161107153550.15344-1-tom.stdenis-5C7GfCeVMHo@public.gmane.org>
@ 2016-11-07 15:35   ` Tom St Denis
  2016-11-07 15:35   ` [PATCH 2/2] drm/amd/amdgpu: Clean up wave gfx8 helper Tom St Denis
  2016-11-07 16:50   ` Clean up indirect SQ register accessors for gfx7/8 Deucher, Alexander
  2 siblings, 0 replies; 4+ messages in thread
From: Tom St Denis @ 2016-11-07 15:35 UTC (permalink / raw)
  To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW; +Cc: Tom St Denis

De-numberify indirect register access for gfx v7.

Signed-off-by: Tom St Denis <tom.stdenis@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c
index 4dda3ddb3fec..bd9a6c8c7dc5 100644
--- a/drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c
@@ -4353,7 +4353,11 @@ static void gfx_v7_0_ring_emit_gds_switch(struct amdgpu_ring *ring,
 
 static uint32_t wave_read_ind(struct amdgpu_device *adev, uint32_t simd, uint32_t wave, uint32_t address)
 {
-	WREG32(mmSQ_IND_INDEX, (wave & 0xF) | ((simd & 0x3) << 4) | (address << 16) | (1 << 13));
+	WREG32(mmSQ_IND_INDEX,
+		(wave << SQ_IND_INDEX__WAVE_ID__SHIFT) |
+		(simd << SQ_IND_INDEX__SIMD_ID__SHIFT) |
+		(address << SQ_IND_INDEX__INDEX__SHIFT) |
+		(SQ_IND_INDEX__FORCE_READ_MASK));
 	return RREG32(mmSQ_IND_DATA);
 }
 
-- 
2.10.0

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

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

* [PATCH 2/2] drm/amd/amdgpu: Clean up wave gfx8 helper
       [not found] ` <20161107153550.15344-1-tom.stdenis-5C7GfCeVMHo@public.gmane.org>
  2016-11-07 15:35   ` [PATCH 1/2] drm/amd/amdgpu: Clean up wave gfx7 helper Tom St Denis
@ 2016-11-07 15:35   ` Tom St Denis
  2016-11-07 16:50   ` Clean up indirect SQ register accessors for gfx7/8 Deucher, Alexander
  2 siblings, 0 replies; 4+ messages in thread
From: Tom St Denis @ 2016-11-07 15:35 UTC (permalink / raw)
  To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW; +Cc: Tom St Denis

De-numberify indirect register access for gfx v8.

Signed-off-by: Tom St Denis <tom.stdenis@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
index 4f46d706675b..8d166899dd70 100644
--- a/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
@@ -5443,7 +5443,11 @@ static void gfx_v8_0_ring_emit_gds_switch(struct amdgpu_ring *ring,
 
 static uint32_t wave_read_ind(struct amdgpu_device *adev, uint32_t simd, uint32_t wave, uint32_t address)
 {
-	WREG32(mmSQ_IND_INDEX, (wave & 0xF) | ((simd & 0x3) << 4) | (address << 16) | (1 << 13));
+	WREG32(mmSQ_IND_INDEX,
+		(wave << SQ_IND_INDEX__WAVE_ID__SHIFT) |
+		(simd << SQ_IND_INDEX__SIMD_ID__SHIFT) |
+		(address << SQ_IND_INDEX__INDEX__SHIFT) |
+		(SQ_IND_INDEX__FORCE_READ_MASK));
 	return RREG32(mmSQ_IND_DATA);
 }
 
-- 
2.10.0

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

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

* RE: Clean up indirect SQ register accessors for gfx7/8
       [not found] ` <20161107153550.15344-1-tom.stdenis-5C7GfCeVMHo@public.gmane.org>
  2016-11-07 15:35   ` [PATCH 1/2] drm/amd/amdgpu: Clean up wave gfx7 helper Tom St Denis
  2016-11-07 15:35   ` [PATCH 2/2] drm/amd/amdgpu: Clean up wave gfx8 helper Tom St Denis
@ 2016-11-07 16:50   ` Deucher, Alexander
  2 siblings, 0 replies; 4+ messages in thread
From: Deucher, Alexander @ 2016-11-07 16:50 UTC (permalink / raw)
  To: 'Tom St Denis', amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

For the series:
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>

> -----Original Message-----
> From: amd-gfx [mailto:amd-gfx-bounces@lists.freedesktop.org] On Behalf
> Of Tom St Denis
> Sent: Monday, November 07, 2016 10:36 AM
> To: amd-gfx@lists.freedesktop.org
> Subject: Clean up indirect SQ register accessors for gfx7/8
> 
> Denumberify the two indirect accessors to make the code cleaner.
> 
> _______________________________________________
> 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] 4+ messages in thread

end of thread, other threads:[~2016-11-07 16:50 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-07 15:35 Clean up indirect SQ register accessors for gfx7/8 Tom St Denis
     [not found] ` <20161107153550.15344-1-tom.stdenis-5C7GfCeVMHo@public.gmane.org>
2016-11-07 15:35   ` [PATCH 1/2] drm/amd/amdgpu: Clean up wave gfx7 helper Tom St Denis
2016-11-07 15:35   ` [PATCH 2/2] drm/amd/amdgpu: Clean up wave gfx8 helper Tom St Denis
2016-11-07 16:50   ` Clean up indirect SQ register accessors for gfx7/8 Deucher, Alexander

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.