All of lore.kernel.org
 help / color / mirror / Atom feed
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 4/4] drm/amdgpu/jpeg: allow type 4 commands
Date: Mon, 19 Oct 2026 16:07:26 -0400	[thread overview]
Message-ID: <20261019200726.15262-4-benjamin.cheng@amd.com> (raw)
In-Reply-To: <20261019200726.15262-1-benjamin.cheng@amd.com>

Packet type 4 is used for conditional memory write and can be used to
allow a memory write from within the IB. Now that the vmid's are set up
correctly (IB_WR_VMID is set to the job's vmid), we can enable this with
no issues.

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

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_jpeg.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_jpeg.c
index 87f879a2e4f4..2b0e658b63b6 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_jpeg.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_jpeg.c
@@ -595,6 +595,12 @@ int amdgpu_jpeg_dec_parse_cs(struct amdgpu_cs_parser *parser,
 				return -EINVAL;
 			}
 			break;
+		case PACKETJ_TYPE4:
+			if (!amdgpu_jpeg_reg_valid(reg)) {
+				dev_err(adev->dev, "Invalid packet [0x%08x]!\n", ib->ptr[i]);
+				return -EINVAL;
+			}
+			break;
 		case PACKETJ_TYPE6:
 			if (ib->ptr[i] == CP_PACKETJ_NOP)
 				continue;
-- 
2.56.0


      parent reply	other threads:[~2026-10-19 20:08 UTC|newest]

Thread overview: 5+ 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 ` [PATCH 3/4] drm/amdgpu/jpeg_v4_0_3: " Benjamin Cheng
2026-10-19 20:55   ` David Wu
2026-10-19 20:07 ` Benjamin Cheng [this message]

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-4-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.