From: Tom St Denis <tstdenis82-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
Cc: Tom St Denis <tom.stdenis-5C7GfCeVMHo@public.gmane.org>
Subject: [PATCH 5/6] drm/amd/amdgpu: Merge get_wptr functions in gfx7
Date: Fri, 2 Sep 2016 08:49:07 -0400 [thread overview]
Message-ID: <20160902124908.18360-6-tom.stdenis@amd.com> (raw)
In-Reply-To: <20160902124908.18360-1-tom.stdenis-5C7GfCeVMHo@public.gmane.org>
Signed-off-by: Tom St Denis <tom.stdenis@amd.com>
---
drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c | 17 +++++++----------
1 file changed, 7 insertions(+), 10 deletions(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c
index 84ad13ec3771..926fd570f0ed 100644
--- a/drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c
@@ -2448,11 +2448,14 @@ static u32 gfx_v7_0_ring_get_rptr(struct amdgpu_ring *ring)
return ring->adev->wb.wb[ring->rptr_offs];
}
-static u32 gfx_v7_0_ring_get_wptr_gfx(struct amdgpu_ring *ring)
+static u32 gfx_v7_0_ring_get_wptr(struct amdgpu_ring *ring)
{
struct amdgpu_device *adev = ring->adev;
- return RREG32(mmCP_RB0_WPTR);
+ if (ring == &adev->gfx.gfx_ring[0])
+ return RREG32(mmCP_RB0_WPTR);
+ else
+ return ring->adev->wb.wb[ring->wptr_offs];
}
static void gfx_v7_0_ring_set_wptr_gfx(struct amdgpu_ring *ring)
@@ -2463,12 +2466,6 @@ static void gfx_v7_0_ring_set_wptr_gfx(struct amdgpu_ring *ring)
(void)RREG32(mmCP_RB0_WPTR);
}
-static u32 gfx_v7_0_ring_get_wptr_compute(struct amdgpu_ring *ring)
-{
- /* XXX check if swapping is necessary on BE */
- return ring->adev->wb.wb[ring->wptr_offs];
-}
-
static void gfx_v7_0_ring_set_wptr_compute(struct amdgpu_ring *ring)
{
struct amdgpu_device *adev = ring->adev;
@@ -4916,7 +4913,7 @@ const struct amd_ip_funcs gfx_v7_0_ip_funcs = {
static const struct amdgpu_ring_funcs gfx_v7_0_ring_funcs_gfx = {
.get_rptr = gfx_v7_0_ring_get_rptr,
- .get_wptr = gfx_v7_0_ring_get_wptr_gfx,
+ .get_wptr = gfx_v7_0_ring_get_wptr,
.set_wptr = gfx_v7_0_ring_set_wptr_gfx,
.parse_cs = NULL,
.emit_ib = gfx_v7_0_ring_emit_ib_gfx,
@@ -4934,7 +4931,7 @@ static const struct amdgpu_ring_funcs gfx_v7_0_ring_funcs_gfx = {
static const struct amdgpu_ring_funcs gfx_v7_0_ring_funcs_compute = {
.get_rptr = gfx_v7_0_ring_get_rptr,
- .get_wptr = gfx_v7_0_ring_get_wptr_compute,
+ .get_wptr = gfx_v7_0_ring_get_wptr,
.set_wptr = gfx_v7_0_ring_set_wptr_compute,
.parse_cs = NULL,
.emit_ib = gfx_v7_0_ring_emit_ib_compute,
--
2.9.3
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
next prev parent reply other threads:[~2016-09-02 12:49 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-02 12:49 Merge get_rptr and get_wptr functions Tom St Denis
[not found] ` <20160902124908.18360-1-tom.stdenis-5C7GfCeVMHo@public.gmane.org>
2016-09-02 12:49 ` [PATCH 1/6] drm/amd/amdgpu: Merge get_rptr functions in gfx6 Tom St Denis
2016-09-02 12:49 ` [PATCH 2/6] drm/amd/amdgpu: Merge get_rptr functions in gfx7 Tom St Denis
2016-09-02 12:49 ` [PATCH 3/6] drm/amd/amdgpu: Merge get_rptr functions in gfx8 Tom St Denis
2016-09-02 12:49 ` [PATCH 4/6] drm/amd/amdgpu: Merge get_wptr functions in gfx6 Tom St Denis
2016-09-02 12:49 ` Tom St Denis [this message]
2016-09-02 12:49 ` [PATCH 6/6] drm/amd/amdgpu: Merge get_wptr functions in gfx8 Tom St Denis
2016-09-02 13:58 ` Merge get_rptr and get_wptr functions Deucher, Alexander
[not found] ` <MWHPR12MB16944757DF4E9517905BDDC6F7E50-Gy0DoCVfaSW4WA4dJ5YXGAdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2016-09-02 14:02 ` 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=20160902124908.18360-6-tom.stdenis@amd.com \
--to=tstdenis82-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
--cc=amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
--cc=tom.stdenis-5C7GfCeVMHo@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