Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Michal Wajdeczko <michal.wajdeczko@intel.com>
To: intel-xe@lists.freedesktop.org
Subject: [PATCH 2/2] drm/xe/guc: Add kernel-doc for xe_guc_ct_send_recv()
Date: Fri, 12 Jan 2024 11:25:54 +0100	[thread overview]
Message-ID: <20240112102554.761-2-michal.wajdeczko@intel.com> (raw)
In-Reply-To: <20240112102554.761-1-michal.wajdeczko@intel.com>

The communication with the GuC firmware is crucial for the driver
but unfortunately it has limited documentation.  Add initial
documentation for recently updated xe_guc_ct_send_recv().

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

diff --git a/drivers/gpu/drm/xe/xe_guc_ct.c b/drivers/gpu/drm/xe/xe_guc_ct.c
index 4ae1a0cd9537..ee5d99456aeb 100644
--- a/drivers/gpu/drm/xe/xe_guc_ct.c
+++ b/drivers/gpu/drm/xe/xe_guc_ct.c
@@ -785,6 +785,24 @@ static int guc_ct_send_recv(struct xe_guc_ct *ct, const u32 *action, u32 len,
 	return ret > 0 ? response_buffer ? g2h_fence.response_len : g2h_fence.response_data : ret;
 }
 
+/**
+ * xe_guc_ct_send_recv - Send and receive HXG to the GuC
+ * @ct: the &xe_guc_ct
+ * @action: the dword array with `HXG Request`_ message (can't be NULL)
+ * @len: length of the `HXG Request`_ message (in dwords, can't be 0)
+ * @response_buffer: placeholder for the `HXG Response`_ message (can be NULL)
+ *
+ * Send a `HXG Request`_ message to the GuC over CT communication channel and
+ * blocks until GuC replies with a `HXG Response`_ message.
+ *
+ * For non-blocking communication with GuC use xe_guc_ct_send().
+ *
+ * Note: The size of &response_buffer must be at least GUC_CTB_MAX_DWORDS_.
+ *
+ * Return: response length (in dwords) if &response_buffer was not NULL, or
+ *         DATA0 from `HXG Response`_ if &response_buffer was NULL, or
+ *         a negative error code on failure.
+ */
 int xe_guc_ct_send_recv(struct xe_guc_ct *ct, const u32 *action, u32 len,
 			u32 *response_buffer)
 {
-- 
2.25.1


  reply	other threads:[~2024-01-12 10:26 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 ` Michal Wajdeczko [this message]
2024-01-12 23:12   ` [PATCH 2/2] drm/xe/guc: Add kernel-doc for xe_guc_ct_send_recv() 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

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=20240112102554.761-2-michal.wajdeczko@intel.com \
    --to=michal.wajdeczko@intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    /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