All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/4] drm/amdgpu/jpeg_v1_0: allow type4 commands
@ 2026-10-19 20:07 Benjamin Cheng
  2026-10-19 20:07 ` [PATCH 2/4] drm/amdgpu/jpeg_v2_0: set only IB_RD_VMID to 0 Benjamin Cheng
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Benjamin Cheng @ 2026-10-19 20:07 UTC (permalink / raw)
  To: Alex Deucher, Christian König, amd-gfx
  Cc: Leo Liu, Ruijing Dong, David Rosca, Boyuan Zhang, Benjamin Cheng

Packet type 4 is used for conditional memory write and can be used to
allow a memory write from within the IB.

This write is done through IB_WR_VMID, which previously was set to 0 if
we do IB parsing. After programming the VMIDs correctly we can enable
packet type 4 with no issues.

Signed-off-by: Benjamin Cheng <benjamin.cheng@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/jpeg_v1_0.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/jpeg_v1_0.c b/drivers/gpu/drm/amd/amdgpu/jpeg_v1_0.c
index b5bb7f4d607c..81facb99d885 100644
--- a/drivers/gpu/drm/amd/amdgpu/jpeg_v1_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/jpeg_v1_0.c
@@ -301,13 +301,14 @@ static void jpeg_v1_0_decode_ring_emit_ib(struct amdgpu_ring *ring,
 {
 	struct amdgpu_device *adev = ring->adev;
 	unsigned vmid = AMDGPU_JOB_GET_VMID(job);
+	uint32_t reg;
 
+	reg = vmid << UVD_LMI_JRBC_IB_VMID__IB_WR_VMID__SHIFT;
+	if (!ring->funcs->parse_cs)
+		reg |= (vmid << UVD_LMI_JRBC_IB_VMID__IB_RD_VMID__SHIFT);
 	amdgpu_ring_write(ring,
 		PACKETJ(SOC15_REG_OFFSET(JPEG, 0, mmUVD_LMI_JRBC_IB_VMID), 0, 0, PACKETJ_TYPE0));
-	if (ring->funcs->parse_cs)
-		amdgpu_ring_write(ring, 0);
-	else
-		amdgpu_ring_write(ring, (vmid | (vmid << 4)));
+	amdgpu_ring_write(ring, reg);
 
 	amdgpu_ring_write(ring,
 		PACKETJ(SOC15_REG_OFFSET(JPEG, 0, mmUVD_LMI_JPEG_VMID), 0, 0, PACKETJ_TYPE0));
@@ -669,6 +670,9 @@ static int jpeg_v1_dec_ring_parse_cs(struct amdgpu_cs_parser *parser,
 			if (reg != JPEG_V1_REG_SOFT_RESET)
 				ret = -EINVAL;
 			break;
+		case PACKETJ_TYPE4:
+			/* Allow any wait reg */
+			break;
 		case PACKETJ_TYPE6:
 			if (ib->ptr[i] != CP_PACKETJ_NOP)
 				ret = -EINVAL;
-- 
2.56.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-10-19 20:55 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-19 20:07 [PATCH 1/4] drm/amdgpu/jpeg_v1_0: allow type4 commands Benjamin Cheng
2026-10-19 20:07 ` [PATCH 2/4] drm/amdgpu/jpeg_v2_0: set only IB_RD_VMID to 0 Benjamin Cheng
2026-10-19 20:07 ` [PATCH 3/4] drm/amdgpu/jpeg_v4_0_3: " Benjamin Cheng
2026-10-19 20:55   ` David Wu
2026-10-19 20:07 ` [PATCH 4/4] drm/amdgpu/jpeg: allow type 4 commands Benjamin Cheng

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.