AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Huang Rui <ray.huang@amd.com>
To: amd-gfx@lists.freedesktop.org
Cc: "AnZhong Huang" <anzhong.huang@amd.com>,
	"Aaron Liu" <aaron.liu@amd.com>, "Huang Rui" <ray.huang@amd.com>,
	"Alex Deucher" <alexander.deucher@amd.com>,
	"Leo Liu" <leo.liu@amd.com>,
	"Christian König" <christian.koenig@amd.com>
Subject: [PATCH 04/12] drm/amdgpu: use register distance member instead of hardcode in VCN1/JEPG1
Date: Mon,  6 Jul 2020 13:05:01 +0800	[thread overview]
Message-ID: <20200706050509.714975-5-ray.huang@amd.com> (raw)
In-Reply-To: <20200706050509.714975-1-ray.huang@amd.com>

This patch updates to use register distance member instead of
hardcode in VCN1/JEPG1. They are for the same ASIC.

Signed-off-by: Huang Rui <ray.huang@amd.com>
Tested-by: AnZhong Huang <anzhong.huang@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/jpeg_v1_0.c | 2 +-
 drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c  | 5 +++--
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/jpeg_v1_0.c b/drivers/gpu/drm/amd/amdgpu/jpeg_v1_0.c
index 4c6c7544b400..bc300283b6ab 100644
--- a/drivers/gpu/drm/amd/amdgpu/jpeg_v1_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/jpeg_v1_0.c
@@ -377,7 +377,7 @@ static void jpeg_v1_0_decode_ring_emit_vm_flush(struct amdgpu_ring *ring,
 	pd_addr = amdgpu_gmc_emit_flush_gpu_tlb(ring, vmid, pd_addr);
 
 	/* wait for register write */
-	data0 = hub->ctx0_ptb_addr_lo32 + vmid * 2;
+	data0 = hub->ctx0_ptb_addr_lo32 + vmid * hub->ctx_addr_distance;
 	data1 = lower_32_bits(pd_addr);
 	mask = 0xffffffff;
 	jpeg_v1_0_decode_ring_emit_reg_wait(ring, data0, data1, mask);
diff --git a/drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c b/drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c
index 6dcc3ce0c00a..927c330fad21 100644
--- a/drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c
@@ -1539,7 +1539,7 @@ static void vcn_v1_0_dec_ring_emit_vm_flush(struct amdgpu_ring *ring,
 	pd_addr = amdgpu_gmc_emit_flush_gpu_tlb(ring, vmid, pd_addr);
 
 	/* wait for register write */
-	data0 = hub->ctx0_ptb_addr_lo32 + vmid * 2;
+	data0 = hub->ctx0_ptb_addr_lo32 + vmid * hub->ctx_addr_distance;
 	data1 = lower_32_bits(pd_addr);
 	mask = 0xffffffff;
 	vcn_v1_0_dec_ring_emit_reg_wait(ring, data0, data1, mask);
@@ -1679,7 +1679,8 @@ static void vcn_v1_0_enc_ring_emit_vm_flush(struct amdgpu_ring *ring,
 	pd_addr = amdgpu_gmc_emit_flush_gpu_tlb(ring, vmid, pd_addr);
 
 	/* wait for reg writes */
-	vcn_v1_0_enc_ring_emit_reg_wait(ring, hub->ctx0_ptb_addr_lo32 + vmid * 2,
+	vcn_v1_0_enc_ring_emit_reg_wait(ring, hub->ctx0_ptb_addr_lo32 +
+					vmid * hub->ctx_addr_distance,
 					lower_32_bits(pd_addr), 0xffffffff);
 }
 
-- 
2.25.1

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

  parent reply	other threads:[~2020-07-06  5:05 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-06  5:04 [PATCH 00/12] drm/amdgpu: add register distance Huang Rui
2020-07-06  5:04 ` [PATCH 01/12] drm/amdgpu: add register distance members into vmhub structure Huang Rui
2020-07-06  5:04 ` [PATCH 02/12] drm/amdgpu: use register distance member instead of hardcode in GMC9 Huang Rui
2020-07-06  5:05 ` [PATCH 03/12] drm/amdgpu: use register distance member instead of hardcode in GMC10 Huang Rui
2020-07-06  5:05 ` Huang Rui [this message]
2020-07-06  5:05 ` [PATCH 05/12] drm/amdgpu: use register distance member instead of hardcode in UVD7/VCE4 Huang Rui
2020-07-06  5:05 ` [PATCH 06/12] drm/amdgpu: use register distance member instead of hardcode in VCN2/JEPG2 Huang Rui
2020-07-06  5:05 ` [PATCH 07/12] drm/amdgpu: use register distance member instead of hardcode in gfxhub v1 Huang Rui
2020-07-06  5:05 ` [PATCH 08/12] drm/amdgpu: use register distance member instead of hardcode in gfxhub v2 Huang Rui
2020-07-06  5:05 ` [PATCH 09/12] drm/amdgpu: use register distance member instead of hardcode in gfxhub v2.1 Huang Rui
2020-07-06  5:05 ` [PATCH 10/12] drm/amdgpu: use register distance member instead of hardcode in mmhub v1 Huang Rui
2020-07-06  5:05 ` [PATCH 11/12] drm/amdgpu: use register distance member instead of hardcode in mmhub v2 Huang Rui
2020-07-06  5:05 ` [PATCH 12/12] drm/amdgpu: use register distance member instead of hardcode in mmhub v9.4 Huang Rui
2020-07-06 10:39 ` [PATCH 00/12] drm/amdgpu: add register distance 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=20200706050509.714975-5-ray.huang@amd.com \
    --to=ray.huang@amd.com \
    --cc=aaron.liu@amd.com \
    --cc=alexander.deucher@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=anzhong.huang@amd.com \
    --cc=christian.koenig@amd.com \
    --cc=leo.liu@amd.com \
    /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