diff options
author | Michal Wajdeczko <michal.wajdeczko@intel.com> | 2024-01-12 11:25:53 +0100 |
---|---|---|
committer | Michal Wajdeczko <michal.wajdeczko@intel.com> | 2024-01-18 19:28:41 +0100 |
commit | a54e016ace26304505dfd1bd2fb0278a91dae310 (patch) | |
tree | 3bfdfe78cbf7ade89bbc3e149df78b059ddb9254 /drivers/gpu/drm/xe/xe_guc_ct.c | |
parent | 34e9d836f9d0362a45009d61e211e0d5fbdcc28a (diff) | |
download | lwn-a54e016ace26304505dfd1bd2fb0278a91dae310.tar.gz lwn-a54e016ace26304505dfd1bd2fb0278a91dae310.zip |
drm/xe/guc: Return CTB HXG response DATA0 if no buffer provided
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>
Reviewed-by: Matthew Brost <matthew.brost@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240112102554.761-1-michal.wajdeczko@intel.com
Diffstat (limited to 'drivers/gpu/drm/xe/xe_guc_ct.c')
-rw-r--r-- | drivers/gpu/drm/xe/xe_guc_ct.c | 6 |
1 files changed, 5 insertions, 1 deletions
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 @@ retry_same_fence: 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); |