Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] drm/xe/guc: Use proper definitions while processing G2H events
@ 2024-01-09 23:00 Michal Wajdeczko
  2024-01-09 23:00 ` [PATCH 2/2] drm/xe/guc: Fix arguments passed to relay G2H handlers Michal Wajdeczko
                   ` (8 more replies)
  0 siblings, 9 replies; 13+ messages in thread
From: Michal Wajdeczko @ 2024-01-09 23:00 UTC (permalink / raw)
  To: intel-xe

While dispatching G2H events we should use HXG EVENT definitions,
no need to rely on outer CTB layer definitions that forced us to
use shifted offsets:

	FIELD_GET(GUC_HXG_MSG_0_xxx, msg[1])
vs
	FIELD_GET(GUC_HXG_MSG_0_xxx, hxg[0])

Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
Cc: Matthew Brost <matthew.brost@intel.com>
---
 drivers/gpu/drm/xe/xe_guc_ct.c | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/xe/xe_guc_ct.c b/drivers/gpu/drm/xe/xe_guc_ct.c
index c29f095aa1b9..9d1d855da229 100644
--- a/drivers/gpu/drm/xe/xe_guc_ct.c
+++ b/drivers/gpu/drm/xe/xe_guc_ct.c
@@ -923,18 +923,21 @@ static int parse_g2h_msg(struct xe_guc_ct *ct, u32 *msg, u32 len)
 	return ret;
 }
 
-static int process_g2h_msg(struct xe_guc_ct *ct, u32 *msg, u32 len)
+static int process_g2h_msg(struct xe_guc_ct *ct, u32 *hxg, u32 len)
 {
 	struct xe_device *xe = ct_to_xe(ct);
 	struct xe_guc *guc = ct_to_guc(ct);
-	u32 action = FIELD_GET(GUC_HXG_EVENT_MSG_0_ACTION, msg[1]);
-	u32 *payload = msg + GUC_CTB_HXG_MSG_MIN_LEN;
-	u32 adj_len = len - GUC_CTB_HXG_MSG_MIN_LEN;
+	u32 action, adj_len;
+	u32 *payload;
 	int ret = 0;
 
-	if (FIELD_GET(GUC_HXG_MSG_0_TYPE, msg[1]) != GUC_HXG_TYPE_EVENT)
+	if (FIELD_GET(GUC_HXG_MSG_0_TYPE, hxg[0]) != GUC_HXG_TYPE_EVENT)
 		return 0;
 
+	action = FIELD_GET(GUC_HXG_EVENT_MSG_0_ACTION, hxg[0]);
+	payload = hxg + GUC_HXG_EVENT_MSG_MIN_LEN;
+	adj_len = len - GUC_HXG_EVENT_MSG_MIN_LEN;
+
 	switch (action) {
 	case XE_GUC_ACTION_SCHED_CONTEXT_MODE_DONE:
 		ret = xe_guc_sched_done_handler(guc, payload, adj_len);
@@ -1145,7 +1148,7 @@ static int dequeue_one_g2h(struct xe_guc_ct *ct)
 	if (unlikely(ret < 0))
 		return ret;
 
-	ret = process_g2h_msg(ct, ct->msg, len);
+	ret = process_g2h_msg(ct, ct->msg + GUC_CTB_MSG_MIN_LEN, len - GUC_CTB_MSG_MIN_LEN);
 	if (unlikely(ret < 0))
 		return ret;
 

base-commit: 39df1f6b1259816cc42b5f2451ca5092fad340ce
-- 
2.25.1


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

end of thread, other threads:[~2024-01-10 17:58 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-09 23:00 [PATCH 1/2] drm/xe/guc: Use proper definitions while processing G2H events Michal Wajdeczko
2024-01-09 23:00 ` [PATCH 2/2] drm/xe/guc: Fix arguments passed to relay G2H handlers Michal Wajdeczko
2024-01-10  0:47   ` Matthew Brost
2024-01-10 17:55     ` Michal Wajdeczko
2024-01-09 23:23 ` ✓ CI.Patch_applied: success for series starting with [1/2] drm/xe/guc: Use proper definitions while processing G2H events Patchwork
2024-01-09 23:23 ` ✗ CI.checkpatch: warning " Patchwork
2024-01-09 23:24 ` ✓ CI.KUnit: success " Patchwork
2024-01-09 23:32 ` ✓ CI.Build: " Patchwork
2024-01-09 23:32 ` ✓ CI.Hooks: " Patchwork
2024-01-09 23:33 ` ✓ CI.checksparse: " Patchwork
2024-01-10  0:08 ` ✓ CI.BAT: " Patchwork
2024-01-10  0:44 ` [PATCH 1/2] " Matthew Brost
2024-01-10 17:58   ` Michal Wajdeczko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox