From: Michal Wajdeczko <michal.wajdeczko@intel.com>
To: Matthew Brost <matthew.brost@intel.com>
Cc: intel-xe@lists.freedesktop.org
Subject: Re: [PATCH] drm/xe/guc: Return CTB response length
Date: Thu, 11 Jan 2024 18:07:12 +0100 [thread overview]
Message-ID: <cd126beb-db4e-4995-8518-f04658fd6820@intel.com> (raw)
In-Reply-To: <ZaAaDeAOPqbS7Tg6@DUT025-TGLU.fm.intel.com>
On 11.01.2024 17:40, Matthew Brost wrote:
> On Thu, Jan 11, 2024 at 04:27:24PM +0100, Michal Wajdeczko wrote:
>> Not all CTB responses from the GuC are fixed size and we need to
>> pass response length to the caller, if there was a response_buffer.
>> Easiest solution is to return it as positive value from all
>> xe_guc_ct_send_recv() functions. The CTB response length is always
>> between 1 and 254 (ie. GUC_HXG_MSG_MIN_LEN and GUC_CTB_MAX_DWORDS
>> - GUC_HXG_MSG_MIN_LEN).
>>
>> Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
>> Cc: Matthew Brost <matthew.brost@intel.com>
>
> I has purposed a different usage of the return value [1].
>
> Perhaps we just have response len as a pass by ref argument?
no need for additional argument, we can still return data0 if there was
no response_buffer provided, and I also have patch for this, but didn't
send right now as it conflicts with our already in-flight HXG changes.
Michal
>
> Matt
>
> [1] https://patchwork.freedesktop.org/patch/541762/?series=119096&rev=1
>
>> ---
>> drivers/gpu/drm/xe/xe_guc_ct.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/gpu/drm/xe/xe_guc_ct.c b/drivers/gpu/drm/xe/xe_guc_ct.c
>> index c29f095aa1b9..d490a4d42c01 100644
>> --- a/drivers/gpu/drm/xe/xe_guc_ct.c
>> +++ b/drivers/gpu/drm/xe/xe_guc_ct.c
>> @@ -780,7 +780,7 @@ static int guc_ct_send_recv(struct xe_guc_ct *ct, const u32 *action, u32 len,
>> ret = -EIO;
>> }
>>
>> - return ret > 0 ? 0 : ret;
>> + return ret > 0 ? response_buffer ? g2h_fence.response_len : 0 : ret;
>> }
>>
>> int xe_guc_ct_send_recv(struct xe_guc_ct *ct, const u32 *action, u32 len,
>>
>> base-commit: 79184e72263e91528195db01783148435c7e4fad
>> --
>> 2.25.1
>>
next prev parent reply other threads:[~2024-01-11 17:07 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-11 15:27 [PATCH] drm/xe/guc: Return CTB response length Michal Wajdeczko
2024-01-11 15:30 ` ✓ CI.Patch_applied: success for " Patchwork
2024-01-11 15:30 ` ✓ CI.checkpatch: " Patchwork
2024-01-11 15:31 ` ✓ CI.KUnit: " Patchwork
2024-01-11 15:38 ` ✓ CI.Build: " Patchwork
2024-01-11 15:39 ` ✓ CI.Hooks: " Patchwork
2024-01-11 15:40 ` ✓ CI.checksparse: " Patchwork
2024-01-11 16:17 ` ✗ CI.BAT: failure " Patchwork
2024-01-11 17:31 ` Michal Wajdeczko
2024-01-11 16:40 ` [PATCH] " Matthew Brost
2024-01-11 17:07 ` Michal Wajdeczko [this message]
2024-01-11 20:02 ` Matthew Brost
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=cd126beb-db4e-4995-8518-f04658fd6820@intel.com \
--to=michal.wajdeczko@intel.com \
--cc=intel-xe@lists.freedesktop.org \
--cc=matthew.brost@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