From: Benjamin Cheng <benjamin.cheng@amd.com>
To: "Alex Deucher" <alexander.deucher@amd.com>,
"Christian König" <christian.koenig@amd.com>,
amd-gfx@lists.freedesktop.org
Cc: Leo Liu <leo.liu@amd.com>, Ruijing Dong <ruijing.dong@amd.com>,
"David Rosca" <david.rosca@amd.com>,
Boyuan Zhang <boyuan.zhang@amd.com>,
"Benjamin Cheng" <benjamin.cheng@amd.com>
Subject: [PATCH 3/4] drm/amdgpu/jpeg_v4_0_3: set only IB_RD_VMID to 0
Date: Mon, 19 Oct 2026 16:07:25 -0400 [thread overview]
Message-ID: <20261019200726.15262-3-benjamin.cheng@amd.com> (raw)
In-Reply-To: <20261019200726.15262-1-benjamin.cheng@amd.com>
If IB parsing is done by kernel, the IB will need to be read from VMID 0.
However, memory read/write operations from within the IB should stay in
the job's VMID. This will allow us to enable packet type 4.
Signed-off-by: Benjamin Cheng <benjamin.cheng@amd.com>
---
drivers/gpu/drm/amd/amdgpu/jpeg_v4_0_3.c | 15 ++++++---------
1 file changed, 6 insertions(+), 9 deletions(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/jpeg_v4_0_3.c b/drivers/gpu/drm/amd/amdgpu/jpeg_v4_0_3.c
index 0343a64595f2..0c25ee443fa7 100644
--- a/drivers/gpu/drm/amd/amdgpu/jpeg_v4_0_3.c
+++ b/drivers/gpu/drm/amd/amdgpu/jpeg_v4_0_3.c
@@ -892,18 +892,15 @@ void jpeg_v4_0_3_dec_ring_emit_ib(struct amdgpu_ring *ring,
uint32_t flags)
{
unsigned int vmid = AMDGPU_JOB_GET_VMID(job);
+ uint32_t reg;
+ reg = (vmid << UVD_JMI0_UVD_LMI_JRBC_IB_VMID__IB_WR_VMID_MASK) |
+ (vmid << UVD_JMI0_UVD_LMI_JRBC_IB_VMID__MEM_RD_VMID__SHIFT);
+ if (!ring->funcs->parse_cs)
+ reg |= (vmid << UVD_JMI0_UVD_LMI_JRBC_IB_VMID__IB_RD_VMID__SHIFT);
amdgpu_ring_write(ring, PACKETJ(regUVD_LMI_JRBC_IB_VMID_INTERNAL_OFFSET,
0, 0, PACKETJ_TYPE0));
-
- if (ring->funcs->parse_cs)
- amdgpu_ring_write(ring, 0);
- else
- amdgpu_ring_write(ring, (vmid | (vmid << 4) | (vmid << 8)));
-
- amdgpu_ring_write(ring, PACKETJ(regUVD_LMI_JPEG_VMID_INTERNAL_OFFSET,
- 0, 0, PACKETJ_TYPE0));
- amdgpu_ring_write(ring, (vmid | (vmid << 4) | (vmid << 8)));
+ amdgpu_ring_write(ring, reg);
amdgpu_ring_write(ring, PACKETJ(regUVD_LMI_JRBC_IB_64BIT_BAR_LOW_INTERNAL_OFFSET,
0, 0, PACKETJ_TYPE0));
--
2.56.0
next prev parent reply other threads:[~2026-10-19 20:08 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
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 ` Benjamin Cheng [this message]
2026-10-19 20:55 ` [PATCH 3/4] drm/amdgpu/jpeg_v4_0_3: " David Wu
2026-10-20 11:59 ` [PATCH v2] " Benjamin Cheng
2026-10-19 20:07 ` [PATCH 4/4] drm/amdgpu/jpeg: allow type 4 commands Benjamin Cheng
2026-10-20 15:52 ` [PATCH 1/4] drm/amdgpu/jpeg_v1_0: allow type4 commands David Wu
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=20261019200726.15262-3-benjamin.cheng@amd.com \
--to=benjamin.cheng@amd.com \
--cc=alexander.deucher@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=boyuan.zhang@amd.com \
--cc=christian.koenig@amd.com \
--cc=david.rosca@amd.com \
--cc=leo.liu@amd.com \
--cc=ruijing.dong@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 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.