public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
From: <vitaly.prosyak@amd.com>
To: <igt-dev@lists.freedesktop.org>
Cc: Pierre-eric Pelloux-prayer <Pierre-eric.Pelloux-prayer@amd.com>,
	marek.olsak@amd.com, christian.koenig@amd.com
Subject: [igt-dev] [PATCH 2/9] lib/amdgpu: add predefined constants for PM4 and SDMA
Date: Fri, 11 Nov 2022 16:52:06 -0500	[thread overview]
Message-ID: <20221111215213.48679-2-vitaly.prosyak@amd.com> (raw)
In-Reply-To: <20221111215213.48679-1-vitaly.prosyak@amd.com>

From: Vitaly Prosyak <vitaly.prosyak@amd.com>

Signed-off-by: Vitaly Prosyak <vitaly.prosyak@amd.com>
Reviewed-by: Pierre-eric Pelloux-prayer <Pierre-eric.Pelloux-prayer@amd.com>
---
 lib/amdgpu/amd_PM4.h  | 43 +++++++++++++++++++++++++++++++++++++++++++
 lib/amdgpu/amd_sdma.h |  3 +++
 2 files changed, 46 insertions(+)

diff --git a/lib/amdgpu/amd_PM4.h b/lib/amdgpu/amd_PM4.h
index ec4de1f62..7672da034 100644
--- a/lib/amdgpu/amd_PM4.h
+++ b/lib/amdgpu/amd_PM4.h
@@ -169,4 +169,47 @@
 #define PACKET3_SET_UCONFIG_REG			0x79
 #define PACKET3_DRAW_INDEX_AUTO			0x2D
 
+#define	PACKET3_WAIT_REG_MEM				0x3C
+#define		WAIT_REG_MEM_FUNCTION(x)                ((x) << 0)
+		/* 0 - always
+		 * 1 - <
+		 * 2 - <=
+		 * 3 - ==
+		 * 4 - !=
+		 * 5 - >=
+		 * 6 - >
+		 */
+#define		WAIT_REG_MEM_MEM_SPACE(x)               ((x) << 4)
+		/* 0 - reg
+		 * 1 - mem
+		 */
+#define		WAIT_REG_MEM_OPERATION(x)               ((x) << 6)
+		/* 0 - wait_reg_mem
+		 * 1 - wr_wait_wr_reg
+		 */
+#define		WAIT_REG_MEM_ENGINE(x)                  ((x) << 8)
+		/* 0 - me
+		 * 1 - pfp
+		 */
+
+#define	PACKET3_WRITE_DATA				0x37
+#define		WRITE_DATA_DST_SEL(x)                   ((x) << 8)
+		/* 0 - register
+		 * 1 - memory (sync - via GRBM)
+		 * 2 - gl2
+		 * 3 - gds
+		 * 4 - reserved
+		 * 5 - memory (async - direct)
+		 */
+#define		WR_ONE_ADDR                             (1 << 16)
+#define		WR_CONFIRM                              (1 << 20)
+#define		WRITE_DATA_CACHE_POLICY(x)              ((x) << 25)
+		/* 0 - LRU
+		 * 1 - Stream
+		 */
+#define		WRITE_DATA_ENGINE_SEL(x)                ((x) << 30)
+		/* 0 - me
+		 * 1 - pfp
+		 * 2 - ce
+		 */
 #endif
diff --git a/lib/amdgpu/amd_sdma.h b/lib/amdgpu/amd_sdma.h
index 630535bb1..102df1024 100644
--- a/lib/amdgpu/amd_sdma.h
+++ b/lib/amdgpu/amd_sdma.h
@@ -35,6 +35,9 @@
 	/* 0 = byte fill
 	 * 2 = DW fill
 	 */
+
+#define SDMA_OP_POLL_REGMEM  8
+
 #define SDMA_PACKET(op, sub_op, e)	((((e) & 0xFFFF) << 16) |	\
 					(((sub_op) & 0xFF) << 8) |	\
 					(((op) & 0xFF) << 0))
-- 
2.25.1

  reply	other threads:[~2022-11-11 21:52 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-11 21:52 [igt-dev] [PATCH 1/9] lib/amdgpu: add SPDX-License-Identifier: MIT vitaly.prosyak
2022-11-11 21:52 ` vitaly.prosyak [this message]
2022-11-11 21:52 ` [igt-dev] [PATCH 3/9] lib/amdgpu: add amdgpu_bo_alloc_and_map_raw helper vitaly.prosyak
2022-11-11 21:52 ` [igt-dev] [PATCH 4/9] lib/amdgpu: add deadlock helper vitaly.prosyak
2022-11-11 21:52 ` [igt-dev] [PATCH 5/9] tests/amdgpu: add GPU reset tests for gfx, compute and sdma vitaly.prosyak
2022-11-11 21:52 ` [igt-dev] [PATCH 6/9] lib/amdgpu: add memory and reg. access helper function vitaly.prosyak
2022-11-11 21:52 ` [igt-dev] [PATCH 7/9] tests/amdgpu: add tests for invalid memory and register access vitaly.prosyak
2022-11-11 21:52 ` [igt-dev] [PATCH 8/9] tests/amdgpu: reuse predefined const GFX_COMPUTE_NOP vitaly.prosyak
2022-11-11 21:52 ` [igt-dev] [PATCH 9/9] tests/amdgpu: PCI unplug 4 tests for different scenario vitaly.prosyak
2022-11-11 22:27 ` [igt-dev] ✓ Fi.CI.BAT: success for series starting with [1/9] lib/amdgpu: add SPDX-License-Identifier: MIT Patchwork
2022-11-12 14:38 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
2022-11-12 18:28 ` [igt-dev] [PATCH 1/9] " Christian König
2022-11-12 18:30   ` vitaly prosyak

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=20221111215213.48679-2-vitaly.prosyak@amd.com \
    --to=vitaly.prosyak@amd.com \
    --cc=Pierre-eric.Pelloux-prayer@amd.com \
    --cc=christian.koenig@amd.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=marek.olsak@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