Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] drm/xe/guc: Return CTB HXG response DATA0 if no buffer provided
@ 2024-01-12 10:25 Michal Wajdeczko
  2024-01-12 10:25 ` [PATCH 2/2] drm/xe/guc: Add kernel-doc for xe_guc_ct_send_recv() Michal Wajdeczko
                   ` (8 more replies)
  0 siblings, 9 replies; 13+ messages in thread
From: Michal Wajdeczko @ 2024-01-12 10:25 UTC (permalink / raw)
  To: intel-xe

Most of the synchronous GuC HXG action responses are defined in
such a way that only mandatory DATA0 from the HXG header is used
and only in few cases it is more than MBZ (must be zero).

For those cases where HXG action returns just DATA0, return that
value if caller didn't provide buffer for the full response.

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

diff --git a/drivers/gpu/drm/xe/xe_guc_ct.c b/drivers/gpu/drm/xe/xe_guc_ct.c
index b2cc3f993eb6..4ae1a0cd9537 100644
--- a/drivers/gpu/drm/xe/xe_guc_ct.c
+++ b/drivers/gpu/drm/xe/xe_guc_ct.c
@@ -33,6 +33,7 @@
 struct g2h_fence {
 	u32 *response_buffer;
 	u32 seqno;
+	u32 response_data;
 	u16 response_len;
 	u16 error;
 	u16 hint;
@@ -45,6 +46,7 @@ struct g2h_fence {
 static void g2h_fence_init(struct g2h_fence *g2h_fence, u32 *response_buffer)
 {
 	g2h_fence->response_buffer = response_buffer;
+	g2h_fence->response_data = 0;
 	g2h_fence->response_len = 0;
 	g2h_fence->fail = false;
 	g2h_fence->retry = false;
@@ -780,7 +782,7 @@ static int guc_ct_send_recv(struct xe_guc_ct *ct, const u32 *action, u32 len,
 		ret = -EIO;
 	}
 
-	return ret > 0 ? response_buffer ? g2h_fence.response_len : 0 : ret;
+	return ret > 0 ? response_buffer ? g2h_fence.response_len : g2h_fence.response_data : ret;
 }
 
 int xe_guc_ct_send_recv(struct xe_guc_ct *ct, const u32 *action, u32 len,
@@ -877,6 +879,8 @@ static int parse_g2h_response(struct xe_guc_ct *ct, u32 *msg, u32 len)
 	} else if (g2h_fence->response_buffer) {
 		g2h_fence->response_len = hxg_len;
 		memcpy(g2h_fence->response_buffer, hxg, hxg_len * sizeof(u32));
+	} else {
+		g2h_fence->response_data = FIELD_GET(GUC_HXG_RESPONSE_MSG_0_DATA0, hxg[0]);
 	}
 
 	g2h_release_space(ct, GUC_CTB_HXG_MSG_MAX_LEN);

base-commit: 10923212b018be3edb1c21b75f432c6cf3f50c6b
-- 
2.25.1


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

end of thread, other threads:[~2024-01-18 18:40 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-12 10:25 [PATCH 1/2] drm/xe/guc: Return CTB HXG response DATA0 if no buffer provided Michal Wajdeczko
2024-01-12 10:25 ` [PATCH 2/2] drm/xe/guc: Add kernel-doc for xe_guc_ct_send_recv() Michal Wajdeczko
2024-01-12 23:12   ` Matthew Brost
2024-01-13 13:01     ` Michal Wajdeczko
2024-01-18 18:38       ` Matthew Brost
2024-01-12 10:44 ` ✓ CI.Patch_applied: success for series starting with [1/2] drm/xe/guc: Return CTB HXG response DATA0 if no buffer provided Patchwork
2024-01-12 10:45 ` ✓ CI.checkpatch: " Patchwork
2024-01-12 10:45 ` ✓ CI.KUnit: " Patchwork
2024-01-12 10:53 ` ✓ CI.Build: " Patchwork
2024-01-12 10:53 ` ✓ CI.Hooks: " Patchwork
2024-01-12 10:54 ` ✓ CI.checksparse: " Patchwork
2024-01-12 11:17 ` ✓ CI.BAT: " Patchwork
2024-01-12 23:10 ` [PATCH 1/2] " Matthew Brost

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