All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 01/12] drm/amdgpu: move ring helpers to amdgpu_ring.h
@ 2017-06-30 11:22 Christian König
       [not found] ` <1498821733-1545-1-git-send-email-deathsimple-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org>
  0 siblings, 1 reply; 27+ messages in thread
From: Christian König @ 2017-06-30 11:22 UTC (permalink / raw)
  To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

From: Christian König <christian.koenig@amd.com>

Keep them where they belong.

Signed-off-by: Christian König <christian.koenig@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu.h      | 44 --------------------------------
 drivers/gpu/drm/amd/amdgpu/amdgpu_ring.h | 42 ++++++++++++++++++++++++++++++
 2 files changed, 42 insertions(+), 44 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
index ab1dad2..810796a 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
@@ -1801,50 +1801,6 @@ bool amdgpu_device_has_dc_support(struct amdgpu_device *adev);
 #define RBIOS16(i) (RBIOS8(i) | (RBIOS8((i)+1) << 8))
 #define RBIOS32(i) ((RBIOS16(i)) | (RBIOS16((i)+2) << 16))
 
-/*
- * RING helpers.
- */
-static inline void amdgpu_ring_write(struct amdgpu_ring *ring, uint32_t v)
-{
-	if (ring->count_dw <= 0)
-		DRM_ERROR("amdgpu: writing more dwords to the ring than expected!\n");
-	ring->ring[ring->wptr++ & ring->buf_mask] = v;
-	ring->wptr &= ring->ptr_mask;
-	ring->count_dw--;
-}
-
-static inline void amdgpu_ring_write_multiple(struct amdgpu_ring *ring, void *src, int count_dw)
-{
-	unsigned occupied, chunk1, chunk2;
-	void *dst;
-
-	if (unlikely(ring->count_dw < count_dw)) {
-		DRM_ERROR("amdgpu: writing more dwords to the ring than expected!\n");
-		return;
-	}
-
-	occupied = ring->wptr & ring->buf_mask;
-	dst = (void *)&ring->ring[occupied];
-	chunk1 = ring->buf_mask + 1 - occupied;
-	chunk1 = (chunk1 >= count_dw) ? count_dw: chunk1;
-	chunk2 = count_dw - chunk1;
-	chunk1 <<= 2;
-	chunk2 <<= 2;
-
-	if (chunk1)
-		memcpy(dst, src, chunk1);
-
-	if (chunk2) {
-		src += chunk1;
-		dst = (void *)ring->ring;
-		memcpy(dst, src, chunk2);
-	}
-
-	ring->wptr += count_dw;
-	ring->wptr &= ring->ptr_mask;
-	ring->count_dw -= count_dw;
-}
-
 static inline struct amdgpu_sdma_instance *
 amdgpu_get_sdma_instance(struct amdgpu_ring *ring)
 {
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.h
index bc8dec9..04cbc3a 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.h
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.h
@@ -212,4 +212,46 @@ static inline void amdgpu_ring_clear_ring(struct amdgpu_ring *ring)
 
 }
 
+static inline void amdgpu_ring_write(struct amdgpu_ring *ring, uint32_t v)
+{
+	if (ring->count_dw <= 0)
+		DRM_ERROR("amdgpu: writing more dwords to the ring than expected!\n");
+	ring->ring[ring->wptr++ & ring->buf_mask] = v;
+	ring->wptr &= ring->ptr_mask;
+	ring->count_dw--;
+}
+
+static inline void amdgpu_ring_write_multiple(struct amdgpu_ring *ring,
+					      void *src, int count_dw)
+{
+	unsigned occupied, chunk1, chunk2;
+	void *dst;
+
+	if (unlikely(ring->count_dw < count_dw)) {
+		DRM_ERROR("amdgpu: writing more dwords to the ring than expected!\n");
+		return;
+	}
+
+	occupied = ring->wptr & ring->buf_mask;
+	dst = (void *)&ring->ring[occupied];
+	chunk1 = ring->buf_mask + 1 - occupied;
+	chunk1 = (chunk1 >= count_dw) ? count_dw: chunk1;
+	chunk2 = count_dw - chunk1;
+	chunk1 <<= 2;
+	chunk2 <<= 2;
+
+	if (chunk1)
+		memcpy(dst, src, chunk1);
+
+	if (chunk2) {
+		src += chunk1;
+		dst = (void *)ring->ring;
+		memcpy(dst, src, chunk2);
+	}
+
+	ring->wptr += count_dw;
+	ring->wptr &= ring->ptr_mask;
+	ring->count_dw -= count_dw;
+}
+
 #endif
-- 
2.7.4

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

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

end of thread, other threads:[~2017-07-03  3:14 UTC | newest]

Thread overview: 27+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-30 11:22 [PATCH 01/12] drm/amdgpu: move ring helpers to amdgpu_ring.h Christian König
     [not found] ` <1498821733-1545-1-git-send-email-deathsimple-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org>
2017-06-30 11:22   ` [PATCH 02/12] drm/amdgpu: fix amdgpu_ring_write_multiple Christian König
     [not found]     ` <1498821733-1545-2-git-send-email-deathsimple-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org>
2017-06-30 16:16       ` Alex Deucher
2017-06-30 11:22   ` [PATCH 03/12] drm/amdgpu: allow flushing VMID0 before IB execution as well Christian König
     [not found]     ` <1498821733-1545-3-git-send-email-deathsimple-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org>
2017-06-30 16:20       ` Alex Deucher
2017-06-30 11:22   ` [PATCH 04/12] drm/amdgpu: add vm_needs_flush parameter to amdgpu_copy_buffer Christian König
     [not found]     ` <1498821733-1545-4-git-send-email-deathsimple-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org>
2017-06-30 16:22       ` Alex Deucher
2017-06-30 11:22   ` [PATCH 05/12] drm/amdgpu: bind BOs to TTM only once Christian König
     [not found]     ` <1498821733-1545-5-git-send-email-deathsimple-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org>
2017-06-30 16:25       ` Alex Deucher
2017-06-30 11:22   ` [PATCH 06/12] drm/amdgpu: bind BOs with GTT space allocated directly Christian König
     [not found]     ` <1498821733-1545-6-git-send-email-deathsimple-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org>
2017-06-30 16:32       ` Alex Deucher
2017-06-30 11:22   ` [PATCH 07/12] drm/amdgpu: reserve the first 2x2MB of GART Christian König
     [not found]     ` <1498821733-1545-7-git-send-email-deathsimple-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org>
2017-06-30 16:41       ` Alex Deucher
2017-06-30 11:22   ` [PATCH 08/12] drm/amdgpu: add amdgpu_gart_map function Christian König
     [not found]     ` <1498821733-1545-8-git-send-email-deathsimple-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org>
2017-06-30 16:43       ` Alex Deucher
2017-07-01 11:37       ` Nils Wallménius
2017-06-30 11:22   ` [PATCH 09/12] drm/amdgpu: use the GTT windows for BO moves Christian König
     [not found]     ` <1498821733-1545-9-git-send-email-deathsimple-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org>
2017-06-30 16:47       ` Alex Deucher
2017-06-30 11:22   ` [PATCH 10/12] drm/amdgpu: stop mapping BOs to GTT Christian König
     [not found]     ` <1498821733-1545-10-git-send-email-deathsimple-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org>
2017-06-30 16:49       ` Alex Deucher
2017-06-30 11:22   ` [PATCH 11/12] drm/amdgpu: remove maximum BO size limitation Christian König
     [not found]     ` <1498821733-1545-11-git-send-email-deathsimple-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org>
2017-06-30 16:49       ` Alex Deucher
2017-07-03  3:14       ` Michel Dänzer
2017-06-30 11:22   ` [PATCH 12/12] drm/amdgpu: add gtt_sys_limit Christian König
     [not found]     ` <1498821733-1545-12-git-send-email-deathsimple-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org>
2017-06-30 16:54       ` Alex Deucher
2017-06-30 16:15   ` [PATCH 01/12] drm/amdgpu: move ring helpers to amdgpu_ring.h Alex Deucher
2017-06-30 22:40   ` Felix Kuehling

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.