From: Alex Sierra <alex.sierra@amd.com>
To: amd-gfx@lists.freedesktop.org
Cc: Alex Sierra <alex.sierra@amd.com>
Subject: [PATCH 2/4] drm/amdgpu: add macro to get proper ih ring register offset
Date: Thu, 19 Mar 2020 19:22:43 -0500 [thread overview]
Message-ID: <20200320002245.14932-2-alex.sierra@amd.com> (raw)
In-Reply-To: <20200320002245.14932-1-alex.sierra@amd.com>
This macro calculates the IH ring register offset based on
the three ring numbers and asic type.
The parameters needed are the register's name without the prefix mmIH
and the ring number taken from RING0, RING1 or RING2 macros.
Signed-off-by: Alex Sierra <alex.sierra@amd.com>
---
drivers/gpu/drm/amd/amdgpu/vega10_ih.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/gpu/drm/amd/amdgpu/vega10_ih.c b/drivers/gpu/drm/amd/amdgpu/vega10_ih.c
index 407c6093c2ec..5bd9bc37fadf 100644
--- a/drivers/gpu/drm/amd/amdgpu/vega10_ih.c
+++ b/drivers/gpu/drm/amd/amdgpu/vega10_ih.c
@@ -34,6 +34,11 @@
#include "vega10_ih.h"
#define MAX_REARM_RETRY 10
+#define RING0 0
+#define RING1 (RING0 + 4)
+#define RING2 (RING1 + 4)
+
+#define mmIH_RING_REG(reg, ring) (SOC15_REG_OFFSET(OSSSYS, 0, mmIH_##reg) + (ring) * adev->irq.ring_stride)
static void vega10_ih_set_interrupt_funcs(struct amdgpu_device *adev);
--
2.17.1
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
next prev parent reply other threads:[~2020-03-20 0:23 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-20 0:22 [PATCH 1/4] drm/amdgpu: add stride to calculate oss ring offsets Alex Sierra
2020-03-20 0:22 ` Alex Sierra [this message]
2020-03-20 14:30 ` [PATCH 2/4] drm/amdgpu: add macro to get proper ih ring register offset Felix Kuehling
2020-03-22 19:55 ` Sierra Guiza, Alejandro (Alex)
2020-03-20 0:22 ` [PATCH 3/4] drm/amdgpu: replace rd/wr IH ring registers using mmIH_RING_REG macro Alex Sierra
2020-03-20 0:22 ` [PATCH 4/4] drm/amdgpu: reroute VMC and UMD to IH ring 1 for arcturus Alex Sierra
2020-03-20 14:06 ` [PATCH 1/4] drm/amdgpu: add stride to calculate oss ring offsets Deucher, Alexander
2020-03-20 14:20 ` Felix Kuehling
2020-03-20 14:39 ` Deucher, Alexander
2020-03-20 14:47 ` Felix Kuehling
2020-03-20 14:57 ` Deucher, Alexander
2020-03-20 18:53 ` Christian König
2020-03-20 14:30 ` Felix Kuehling
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=20200320002245.14932-2-alex.sierra@amd.com \
--to=alex.sierra@amd.com \
--cc=amd-gfx@lists.freedesktop.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