AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Emily Deng <Emily.Deng-5C7GfCeVMHo@public.gmane.org>
To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
Cc: Alex Deucher <alexander.deucher-5C7GfCeVMHo@public.gmane.org>,
	Emily Deng <Emily.Deng-5C7GfCeVMHo@public.gmane.org>
Subject: [PATCH 8/8] drm/amdgpu/gfx9: add emit_reg_write_reg_wait ring callback
Date: Tue, 3 Apr 2018 17:08:02 +0800	[thread overview]
Message-ID: <1522746482-31353-9-git-send-email-Emily.Deng@amd.com> (raw)
In-Reply-To: <1522746482-31353-1-git-send-email-Emily.Deng-5C7GfCeVMHo@public.gmane.org>

This adds support for writing and reading back in a single
oneshot packet.  This is needed to send a tlb invalidation
and wait for ack in a single operation.

Signed-off-by: Emily Deng <Emily.Deng@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
index 9d39fd5..e699b9e 100644
--- a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
@@ -4137,6 +4137,18 @@ static void gfx_v9_0_ring_emit_reg_wait(struct amdgpu_ring *ring, uint32_t reg,
 	gfx_v9_0_wait_reg_mem(ring, 0, 0, 0, reg, 0, val, mask, 0x20);
 }
 
+static void gfx_v9_0_ring_emit_reg_write_reg_wait(struct amdgpu_ring *ring,
+						  uint32_t reg0, uint32_t reg1,
+						  uint32_t ref, uint32_t mask)
+{
+	if (amdgpu_sriov_vf(ring->adev) && (ring->adev->asic_type == CHIP_VEGA10)) {
+		int usepfp = (ring->funcs->type == AMDGPU_RING_TYPE_GFX);
+		gfx_v9_0_wait_reg_mem(ring, usepfp, 0, 1, reg0, reg1, ref, mask, 0x20);
+	} else {
+		amdgpu_ring_emit_reg_write_reg_wait_helper(ring, reg0, reg1, ref, mask);
+	}
+}
+
 static void gfx_v9_0_set_gfx_eop_interrupt_state(struct amdgpu_device *adev,
 						 enum amdgpu_interrupt_state state)
 {
@@ -4458,6 +4470,7 @@ static const struct amdgpu_ring_funcs gfx_v9_0_ring_funcs_gfx = {
 	.emit_tmz = gfx_v9_0_ring_emit_tmz,
 	.emit_wreg = gfx_v9_0_ring_emit_wreg,
 	.emit_reg_wait = gfx_v9_0_ring_emit_reg_wait,
+	.emit_reg_write_reg_wait = gfx_v9_0_ring_emit_reg_write_reg_wait,
 };
 
 static const struct amdgpu_ring_funcs gfx_v9_0_ring_funcs_compute = {
@@ -4492,6 +4505,7 @@ static const struct amdgpu_ring_funcs gfx_v9_0_ring_funcs_compute = {
 	.set_priority = gfx_v9_0_ring_set_priority_compute,
 	.emit_wreg = gfx_v9_0_ring_emit_wreg,
 	.emit_reg_wait = gfx_v9_0_ring_emit_reg_wait,
+	.emit_reg_write_reg_wait = gfx_v9_0_ring_emit_reg_write_reg_wait,
 };
 
 static const struct amdgpu_ring_funcs gfx_v9_0_ring_funcs_kiq = {
@@ -4522,6 +4536,7 @@ static const struct amdgpu_ring_funcs gfx_v9_0_ring_funcs_kiq = {
 	.emit_rreg = gfx_v9_0_ring_emit_rreg,
 	.emit_wreg = gfx_v9_0_ring_emit_wreg,
 	.emit_reg_wait = gfx_v9_0_ring_emit_reg_wait,
+	.emit_reg_write_reg_wait = gfx_v9_0_ring_emit_reg_write_reg_wait,
 };
 
 static void gfx_v9_0_set_ring_funcs(struct amdgpu_device *adev)
-- 
2.7.4

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

  parent reply	other threads:[~2018-04-03  9:08 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-03  9:07 [PATCH 0/8] The vega10 sriov still need those patches Emily Deng
     [not found] ` <1522746482-31353-1-git-send-email-Emily.Deng-5C7GfCeVMHo@public.gmane.org>
2018-04-03  9:07   ` [PATCH 1/8] Revert "Revert "drm/amdgpu: add emit_reg_write_reg_wait ring callback"" Emily Deng
2018-04-03  9:07   ` [PATCH 2/8] Revert "Revert "drm/amdgpu/sdma4: " Emily Deng
2018-04-03  9:07   ` [PATCH 3/8] Revert "Revert "drm/amdgpu/uvd7: " Emily Deng
2018-04-03  9:07   ` [PATCH 4/8] Revert "Revert "drm/amdgpu/vce4: " Emily Deng
2018-04-03  9:07   ` [PATCH 5/8] Revert "Revert "drm/amdgpu/vcn1: " Emily Deng
2018-04-03  9:08   ` [PATCH 6/8] Revert "Revert "drm/amdgpu/gmc9: use amdgpu_ring_emit_reg_write_reg_wait in gpu tlb flush"" Emily Deng
2018-04-03  9:08   ` [PATCH 7/8] Revert "Revert "drm/amdgpu/sdma4:fix sdma engine hang"" Emily Deng
2018-04-03  9:08   ` Emily Deng [this message]
     [not found]     ` <1522746482-31353-9-git-send-email-Emily.Deng-5C7GfCeVMHo@public.gmane.org>
2018-04-03 10:55       ` [PATCH 8/8] drm/amdgpu/gfx9: add emit_reg_write_reg_wait ring callback Huang Rui
2018-04-03 10:56         ` Christian König
2018-04-03 13:06   ` [PATCH 0/8] The vega10 sriov still need those patches Michel Dänzer
     [not found]     ` <8abf4f42-54be-4b1c-6208-80ab8c40fe0a-otUistvHUpPR7s880joybQ@public.gmane.org>
2018-04-03 15:07       ` Alex Deucher
     [not found]         ` <CADnq5_OLEhT1qA6iDHx6NpKfkCAnAgL=GA0LZ-=NhXt1idO0Mg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2018-04-04  2:03           ` Deng, Emily

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=1522746482-31353-9-git-send-email-Emily.Deng@amd.com \
    --to=emily.deng-5c7gfcevmho@public.gmane.org \
    --cc=alexander.deucher-5C7GfCeVMHo@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