From: Matthew Brost <matthew.brost@intel.com>
To: Michal Wajdeczko <michal.wajdeczko@intel.com>
Cc: intel-xe@lists.freedesktop.org
Subject: Re: [PATCH 1/2] drm/xe/guc: Return CTB HXG response DATA0 if no buffer provided
Date: Fri, 12 Jan 2024 23:10:22 +0000 [thread overview]
Message-ID: <ZaHG3nGTGam+TTrq@DUT025-TGLU.fm.intel.com> (raw)
In-Reply-To: <20240112102554.761-1-michal.wajdeczko@intel.com>
On Fri, Jan 12, 2024 at 11:25:53AM +0100, Michal Wajdeczko wrote:
> 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>
> ---
> 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
>
prev parent reply other threads:[~2024-01-12 23:12 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
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 ` Matthew Brost [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=ZaHG3nGTGam+TTrq@DUT025-TGLU.fm.intel.com \
--to=matthew.brost@intel.com \
--cc=intel-xe@lists.freedesktop.org \
--cc=michal.wajdeczko@intel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox