AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Christian König" <ckoenig.leichtzumerken-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
Subject: [PATCH 02/21] drm/amdgpu: wire up emit_wreg for gfx v7
Date: Fri, 19 Jan 2018 12:48:06 +0100	[thread overview]
Message-ID: <20180119114825.1336-2-christian.koenig@amd.com> (raw)
In-Reply-To: <20180119114825.1336-1-christian.koenig-5C7GfCeVMHo@public.gmane.org>

Needed for vm_flush unification.

v2: handle compute rings as well

Signed-off-by: Christian König <christian.koenig@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c
index e29c22a72764..fbce0c0fdb14 100644
--- a/drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c
@@ -3290,6 +3290,19 @@ static void gfx_v7_0_ring_emit_vm_flush(struct amdgpu_ring *ring,
 	}
 }
 
+static void gfx_v7_0_ring_emit_wreg(struct amdgpu_ring *ring,
+				    uint32_t reg, uint32_t val)
+{
+	int usepfp = (ring->funcs->type == AMDGPU_RING_TYPE_GFX);
+
+	amdgpu_ring_write(ring, PACKET3(PACKET3_WRITE_DATA, 3));
+	amdgpu_ring_write(ring, (WRITE_DATA_ENGINE_SEL(usepfp) |
+				 WRITE_DATA_DST_SEL(0)));
+	amdgpu_ring_write(ring, reg);
+	amdgpu_ring_write(ring, 0);
+	amdgpu_ring_write(ring, val);
+}
+
 /*
  * RLC
  * The RLC is a multi-purpose microengine that handles a
@@ -5134,6 +5147,7 @@ static const struct amdgpu_ring_funcs gfx_v7_0_ring_funcs_gfx = {
 	.insert_nop = amdgpu_ring_insert_nop,
 	.pad_ib = amdgpu_ring_generic_pad_ib,
 	.emit_cntxcntl = gfx_v7_ring_emit_cntxcntl,
+	.emit_wreg = gfx_v7_0_ring_emit_wreg,
 };
 
 static const struct amdgpu_ring_funcs gfx_v7_0_ring_funcs_compute = {
@@ -5163,6 +5177,7 @@ static const struct amdgpu_ring_funcs gfx_v7_0_ring_funcs_compute = {
 	.test_ib = gfx_v7_0_ring_test_ib,
 	.insert_nop = amdgpu_ring_insert_nop,
 	.pad_ib = amdgpu_ring_generic_pad_ib,
+	.emit_wreg = gfx_v7_0_ring_emit_wreg,
 };
 
 static void gfx_v7_0_set_ring_funcs(struct amdgpu_device *adev)
-- 
2.14.1

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

  parent reply	other threads:[~2018-01-19 11:48 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-19 11:48 [PATCH 01/21] drm/amdgpu: wire up emit_wreg for gfx v6 Christian König
     [not found] ` <20180119114825.1336-1-christian.koenig-5C7GfCeVMHo@public.gmane.org>
2018-01-19 11:48   ` Christian König [this message]
2018-01-19 11:48   ` [PATCH 03/21] drm/amdgpu: wire up emit_wreg for gfx v8 Christian König
2018-01-19 11:48   ` [PATCH 04/21] drm/amdgpu: wire up emit_wreg for gfx v9 Christian König
2018-01-19 11:48   ` [PATCH 05/21] drm/amdgpu: wire up emit_wreg for SI DMA Christian König
2018-01-19 11:48   ` [PATCH 06/21] drm/amdgpu: wire up emit_wreg for CIK SDMA Christian König
2018-01-19 11:48   ` [PATCH 07/21] drm/amdgpu: wire up emit_wreg for SDMA v2.4 Christian König
2018-01-19 11:48   ` [PATCH 08/21] drm/amdgpu: wire up emit_wreg for SDMA v3 Christian König
2018-01-19 11:48   ` [PATCH 09/21] drm/amdgpu: wire up emit_wreg for SDMA v4 Christian König
2018-01-19 11:48   ` [PATCH 10/21] drm/amdgpu: wire up emit_wreg for UVD v6 Christian König
2018-01-19 11:48   ` [PATCH 11/21] drm/amdgpu: wire up emit_wreg for UVD v7 Christian König
2018-01-19 11:48   ` [PATCH 12/21] drm/amdgpu: wire up emit_wreg for VCE v4 Christian König
2018-01-19 11:48   ` [PATCH 13/21] drm/amdgpu: wire up emit_wreg for VCN v1 Christian König
2018-01-19 11:48   ` [PATCH 14/21] drm/amdgpu: add new amdgpu_gmc_emit_flush_gpu_tlb callback Christian König
2018-01-19 11:48   ` [PATCH 15/21] drm/amdgpu: implement gmc_v6_0_emit_flush_gpu_tlb Christian König
2018-01-19 11:48   ` [PATCH 16/21] drm/amdgpu: implement gmc_v7_0_emit_flush_gpu_tlb Christian König
2018-01-19 11:48   ` [PATCH 17/21] drm/amdgpu: implement gmc_v8_0_emit_flush_gpu_tlb Christian König
2018-01-19 11:48   ` [PATCH 18/21] drm/amdgpu: implement gmc_v9_0_emit_flush_gpu_tlb Christian König
2018-01-19 11:48   ` [PATCH 19/21] drm/amdgpu: add PASID mapping for GMC v7 Christian König
2018-01-19 11:48   ` [PATCH 20/21] drm/amdgpu: add PASID mapping for GMC v8 Christian König
2018-01-19 11:48   ` [PATCH 21/21] drm/amdgpu: add PASID mapping for GMC v9 Christian König
2018-01-22  5:27   ` [PATCH 01/21] drm/amdgpu: wire up emit_wreg for gfx v6 Chunming Zhou
  -- strict thread matches above, loose matches on Subject: below --
2018-01-16 19:39 Christian König
     [not found] ` <20180116194017.39067-1-christian.koenig-5C7GfCeVMHo@public.gmane.org>
2018-01-16 19:39   ` [PATCH 02/21] drm/amdgpu: wire up emit_wreg for gfx v7 Christian König

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180119114825.1336-2-christian.koenig@amd.com \
    --to=ckoenig.leichtzumerken-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
    --cc=amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox