All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michal Wajdeczko <michal.wajdeczko@intel.com>
To: intel-gfx@lists.freedesktop.org
Subject: [PATCH v4 03/13] drm/i915/guc: Prepare send() function to accept bigger response
Date: Fri, 23 Mar 2018 14:47:18 +0000	[thread overview]
Message-ID: <20180323144728.61548-4-michal.wajdeczko@intel.com> (raw)
In-Reply-To: <20180323144728.61548-1-michal.wajdeczko@intel.com>

This is a preparation step for the upcoming patches.
We already can return some small data decoded from the command
status, but we will need more in the future.

v2: add explicit response buf size
v3: squash with helper patch

Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
Cc: Oscar Mateo <oscar.mateo@intel.com>
Cc: Michel Thierry <michel.thierry@intel.com>
Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
Reviewed-by: Michel Thierry <michel.thierry@intel.com> #1
---
 drivers/gpu/drm/i915/intel_guc.c    |  6 ++++--
 drivers/gpu/drm/i915/intel_guc.h    | 18 ++++++++++++++----
 drivers/gpu/drm/i915/intel_guc_ct.c |  7 ++++---
 3 files changed, 22 insertions(+), 9 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_guc.c b/drivers/gpu/drm/i915/intel_guc.c
index 77bf4e6..a533ff8 100644
--- a/drivers/gpu/drm/i915/intel_guc.c
+++ b/drivers/gpu/drm/i915/intel_guc.c
@@ -310,7 +310,8 @@ void intel_guc_init_params(struct intel_guc *guc)
 	intel_uncore_forcewake_put(dev_priv, FORCEWAKE_BLITTER);
 }
 
-int intel_guc_send_nop(struct intel_guc *guc, const u32 *action, u32 len)
+int intel_guc_send_nop(struct intel_guc *guc, const u32 *action, u32 len,
+		       u32 *response_buf, u32 response_buf_size)
 {
 	WARN(1, "Unexpected send: action=%#x\n", *action);
 	return -ENODEV;
@@ -319,7 +320,8 @@ int intel_guc_send_nop(struct intel_guc *guc, const u32 *action, u32 len)
 /*
  * This function implements the MMIO based host to GuC interface.
  */
-int intel_guc_send_mmio(struct intel_guc *guc, const u32 *action, u32 len)
+int intel_guc_send_mmio(struct intel_guc *guc, const u32 *action, u32 len,
+			u32 *response_buf, u32 response_buf_size)
 {
 	struct drm_i915_private *dev_priv = guc_to_i915(guc);
 	u32 status;
diff --git a/drivers/gpu/drm/i915/intel_guc.h b/drivers/gpu/drm/i915/intel_guc.h
index 13f3d1d..7ee0732 100644
--- a/drivers/gpu/drm/i915/intel_guc.h
+++ b/drivers/gpu/drm/i915/intel_guc.h
@@ -88,7 +88,8 @@ struct intel_guc {
 	struct mutex send_mutex;
 
 	/* GuC's FW specific send function */
-	int (*send)(struct intel_guc *guc, const u32 *data, u32 len);
+	int (*send)(struct intel_guc *guc, const u32 *data, u32 len,
+		    u32 *response_buf, u32 response_buf_size);
 
 	/* GuC's FW specific notify function */
 	void (*notify)(struct intel_guc *guc);
@@ -97,7 +98,14 @@ struct intel_guc {
 static
 inline int intel_guc_send(struct intel_guc *guc, const u32 *action, u32 len)
 {
-	return guc->send(guc, action, len);
+	return guc->send(guc, action, len, NULL, 0);
+}
+
+static inline int
+intel_guc_send_and_receive(struct intel_guc *guc, const u32 *action, u32 len,
+			   u32 *response_buf, u32 response_buf_size)
+{
+	return guc->send(guc, action, len, response_buf, response_buf_size);
 }
 
 static inline void intel_guc_notify(struct intel_guc *guc)
@@ -140,8 +148,10 @@ static inline u32 intel_guc_ggtt_offset(struct intel_guc *guc,
 void intel_guc_fini_wq(struct intel_guc *guc);
 int intel_guc_init(struct intel_guc *guc);
 void intel_guc_fini(struct intel_guc *guc);
-int intel_guc_send_nop(struct intel_guc *guc, const u32 *action, u32 len);
-int intel_guc_send_mmio(struct intel_guc *guc, const u32 *action, u32 len);
+int intel_guc_send_nop(struct intel_guc *guc, const u32 *action, u32 len,
+		       u32 *response_buf, u32 response_buf_size);
+int intel_guc_send_mmio(struct intel_guc *guc, const u32 *action, u32 len,
+			u32 *response_buf, u32 response_buf_size);
 void intel_guc_to_host_event_handler(struct intel_guc *guc);
 int intel_guc_sample_forcewake(struct intel_guc *guc);
 int intel_guc_auth_huc(struct intel_guc *guc, u32 rsa_offset);
diff --git a/drivers/gpu/drm/i915/intel_guc_ct.c b/drivers/gpu/drm/i915/intel_guc_ct.c
index fa52259..a54bf58 100644
--- a/drivers/gpu/drm/i915/intel_guc_ct.c
+++ b/drivers/gpu/drm/i915/intel_guc_ct.c
@@ -88,7 +88,7 @@ static int guc_action_register_ct_buffer(struct intel_guc *guc,
 	int err;
 
 	/* Can't use generic send(), CT registration must go over MMIO */
-	err = intel_guc_send_mmio(guc, action, ARRAY_SIZE(action));
+	err = intel_guc_send_mmio(guc, action, ARRAY_SIZE(action), NULL, 0);
 	if (err)
 		DRM_ERROR("CT: register %s buffer failed; err=%d\n",
 			  guc_ct_buffer_type_to_str(type), err);
@@ -107,7 +107,7 @@ static int guc_action_deregister_ct_buffer(struct intel_guc *guc,
 	int err;
 
 	/* Can't use generic send(), CT deregistration must go over MMIO */
-	err = intel_guc_send_mmio(guc, action, ARRAY_SIZE(action));
+	err = intel_guc_send_mmio(guc, action, ARRAY_SIZE(action), NULL, 0);
 	if (err)
 		DRM_ERROR("CT: deregister %s buffer failed; owner=%d err=%d\n",
 			  guc_ct_buffer_type_to_str(type), owner, err);
@@ -408,7 +408,8 @@ static int ctch_send(struct intel_guc *guc,
 /*
  * Command Transport (CT) buffer based GuC send function.
  */
-static int intel_guc_send_ct(struct intel_guc *guc, const u32 *action, u32 len)
+static int intel_guc_send_ct(struct intel_guc *guc, const u32 *action, u32 len,
+			     u32 *response_buf, u32 response_buf_size)
 {
 	struct intel_guc_ct_channel *ctch = &guc->ct.host_channel;
 	u32 status = ~0; /* undefined */
-- 
1.9.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  parent reply	other threads:[~2018-03-23 14:47 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-23 14:47 [PATCH v4 00/13] drm/i915/guc: Support for Guc responses and requests Michal Wajdeczko
2018-03-23 14:47 ` [PATCH v4 01/13] drm/i915/guc: Add documentation for MMIO based communication Michal Wajdeczko
2018-03-23 21:29   ` Michel Thierry
2018-03-24  7:09     ` Michal Wajdeczko
2018-03-23 14:47 ` [PATCH v4 02/13] drm/i915/guc: Add support for data reporting in GuC responses Michal Wajdeczko
2018-03-23 21:33   ` Michel Thierry
2018-03-23 14:47 ` Michal Wajdeczko [this message]
2018-03-23 21:48   ` [PATCH v4 03/13] drm/i915/guc: Prepare send() function to accept bigger response Michel Thierry
2018-03-23 14:47 ` [PATCH v4 04/13] drm/i915/guc: Implement response handling in send_mmio() Michal Wajdeczko
2018-03-23 21:55   ` Michel Thierry
2018-03-24  7:09     ` Michal Wajdeczko
2018-03-23 14:47 ` [PATCH v4 05/13] drm/i915/guc: Make event handler a virtual function Michal Wajdeczko
2018-03-23 22:25   ` Michel Thierry
2018-03-24  7:14     ` Michal Wajdeczko
2018-03-23 14:47 ` [PATCH v4 06/13] drm/i915/guc: Prepare to handle messages from CT RECV buffer Michal Wajdeczko
2018-03-23 22:39   ` Michel Thierry
2018-03-23 14:47 ` [PATCH v4 07/13] drm/i915/guc: Use better name for helper wait function Michal Wajdeczko
2018-03-23 22:35   ` Michel Thierry
2018-03-23 14:47 ` [PATCH v4 08/13] drm/i915/guc: Implement response handling in send_ct() Michal Wajdeczko
2018-03-23 22:55   ` Michel Thierry
2018-03-26 15:29   ` Michał Winiarski
2018-03-26 15:35     ` Jani Nikula
2018-03-26 16:48       ` Michal Wajdeczko
2018-03-26 16:39     ` Michal Wajdeczko
2018-03-23 14:47 ` [PATCH v4 09/13] drm/i915/guc: Prepare to process incoming requests from CT Michal Wajdeczko
2018-03-23 23:23   ` Michel Thierry
2018-03-23 14:47 ` [PATCH v4 10/13] drm/i915/guc: Enable GuC interrupts when using CT Michal Wajdeczko
2018-03-23 23:02   ` Michel Thierry
2018-03-23 14:47 ` [PATCH v4 11/13] drm/i915/guc: Handle default action received over CT Michal Wajdeczko
2018-03-23 23:29   ` Michel Thierry
2018-03-23 14:47 ` [PATCH v4 12/13] drm/i915/guc: Trace messages from CT while in debug Michal Wajdeczko
2018-03-23 14:47 ` [PATCH v4 13/13] HAX: Enable GuC for CI Michal Wajdeczko
2018-03-23 16:43 ` ✗ Fi.CI.CHECKPATCH: warning for drm/i915/guc: Support for Guc responses and requests (rev2) Patchwork
2018-03-23 16:47 ` ✗ Fi.CI.SPARSE: " Patchwork
2018-03-23 16:58 ` ✓ Fi.CI.BAT: success " Patchwork
2018-03-23 19:32 ` ✗ Fi.CI.IGT: failure " Patchwork

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=20180323144728.61548-4-michal.wajdeczko@intel.com \
    --to=michal.wajdeczko@intel.com \
    --cc=intel-gfx@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.