From: Michel Thierry <michel.thierry@intel.com>
To: Michal Wajdeczko <michal.wajdeczko@intel.com>,
intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH v2 01/16] drm/i915/guc: Add support for data reporting in GuC responses
Date: Mon, 7 Aug 2017 10:13:29 -0700 [thread overview]
Message-ID: <0406c8cb-0ad6-1bd4-ef8a-93e818fe5b4f@intel.com> (raw)
In-Reply-To: <20170807161430.23308-2-michal.wajdeczko@intel.com>
On 8/7/2017 9:14 AM, Michal Wajdeczko wrote:
> GuC may return additional data in the command status response.
> Format and meaning of this data is action specific.
> We will use this non-negative data as a new success return value.
> Currently used actions don't return data that way yet.
>
> v2: fix prohibited space after '~' (Michel)
> update commit message (Daniele)
>
> 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>
> ---
> drivers/gpu/drm/i915/intel_guc_ct.c | 14 +++++++-------
> drivers/gpu/drm/i915/intel_guc_fwif.h | 6 ++++++
> drivers/gpu/drm/i915/intel_uc.c | 5 ++++-
> 3 files changed, 17 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_guc_ct.c b/drivers/gpu/drm/i915/intel_guc_ct.c
> index c4cbec1..1249868 100644
> --- a/drivers/gpu/drm/i915/intel_guc_ct.c
> +++ b/drivers/gpu/drm/i915/intel_guc_ct.c
> @@ -387,9 +387,9 @@ static int ctch_send(struct intel_guc *guc,
> err = wait_for_response(desc, fence, status);
> if (unlikely(err))
> return err;
> - if (*status != INTEL_GUC_STATUS_SUCCESS)
> + if (INTEL_GUC_RECV_TO_STATUS(*status) != INTEL_GUC_STATUS_SUCCESS)
> return -EIO;
> - return 0;
> + return INTEL_GUC_RECV_TO_DATA(*status);
> }
>
> /*
> @@ -399,18 +399,18 @@ static int intel_guc_send_ct(struct intel_guc *guc, const u32 *action, u32 len)
> {
> struct intel_guc_ct_channel *ctch = &guc->ct.host_channel;
> u32 status = ~0; /* undefined */
> - int err;
> + int ret;
>
> mutex_lock(&guc->send_mutex);
>
> - err = ctch_send(guc, ctch, action, len, &status);
> - if (unlikely(err)) {
> + ret = ctch_send(guc, ctch, action, len, &status);
> + if (unlikely(ret < 0)) {
> DRM_ERROR("CT: send action %#X failed; err=%d status=%#X\n",
> - action[0], err, status);
> + action[0], ret, status);
> }
>
> mutex_unlock(&guc->send_mutex);
> - return err;
> + return ret;
> }
>
> /**
> diff --git a/drivers/gpu/drm/i915/intel_guc_fwif.h b/drivers/gpu/drm/i915/intel_guc_fwif.h
> index 5fa2860..367aa65 100644
> --- a/drivers/gpu/drm/i915/intel_guc_fwif.h
> +++ b/drivers/gpu/drm/i915/intel_guc_fwif.h
> @@ -567,10 +567,16 @@ enum intel_guc_action {
> * command in SS0. The response is distinguishable from a command
> * by the fact that all the MASK bits are set. The remaining bits
> * give more detail.
> + * Bits [16:27] are reserved for optional data reporting.
> */
> #define INTEL_GUC_RECV_MASK ((u32)0xF0000000)
> #define INTEL_GUC_RECV_IS_RESPONSE(x) ((u32)(x) >= INTEL_GUC_RECV_MASK)
> #define INTEL_GUC_RECV_STATUS(x) (INTEL_GUC_RECV_MASK | (x))
> +#define INTEL_GUC_RECV_DATA_SHIFT 16
> +#define INTEL_GUC_RECV_DATA_MASK (0xFFF << INTEL_GUC_RECV_DATA_SHIFT)
> +#define INTEL_GUC_RECV_TO_STATUS(x) ((x) & ~INTEL_GUC_RECV_DATA_MASK)
> +#define INTEL_GUC_RECV_TO_DATA(x) (((x) & INTEL_GUC_RECV_DATA_MASK) >> \
> + INTEL_GUC_RECV_DATA_SHIFT)
>
> /* GUC will return status back to SOFT_SCRATCH_O_REG */
> enum intel_guc_status {
> diff --git a/drivers/gpu/drm/i915/intel_uc.c b/drivers/gpu/drm/i915/intel_uc.c
> index 27e072c..3aa0f44 100644
> --- a/drivers/gpu/drm/i915/intel_uc.c
> +++ b/drivers/gpu/drm/i915/intel_uc.c
> @@ -502,7 +502,7 @@ int intel_guc_send_mmio(struct intel_guc *guc, const u32 *action, u32 len)
> INTEL_GUC_RECV_MASK,
> INTEL_GUC_RECV_MASK,
> 10, 10, &status);
> - if (status != INTEL_GUC_STATUS_SUCCESS) {
> + if (INTEL_GUC_RECV_TO_STATUS(status) != INTEL_GUC_STATUS_SUCCESS) {
> /*
> * Either the GuC explicitly returned an error (which
> * we convert to -EIO here) or no response at all was
> @@ -514,6 +514,9 @@ int intel_guc_send_mmio(struct intel_guc *guc, const u32 *action, u32 len)
> DRM_WARN("INTEL_GUC_SEND: Action 0x%X failed;"
> " ret=%d status=0x%08X response=0x%08X\n",
> action[0], ret, status, I915_READ(SOFT_SCRATCH(15)));
> + } else {
> + /* Use data encoded by Guc in status dword as return value */
> + ret = INTEL_GUC_RECV_TO_DATA(status);
> }
>
> intel_uncore_forcewake_put(dev_priv, guc->send_regs.fw_domains);
>
Reviewed-by: Michel Thierry <michel.thierry@intel.com>
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2017-08-07 17:13 UTC|newest]
Thread overview: 55+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-04 16:26 [PATCH 00/15] drm/i915/guc: Support for Guc responses and requests Michal Wajdeczko
2017-08-04 16:26 ` [PATCH 01/15] drm/i915/guc: Add support for data reporting in GuC responses Michal Wajdeczko
2017-08-04 20:40 ` Michel Thierry
2017-08-04 21:29 ` Daniele Ceraolo Spurio
2017-08-04 21:54 ` Michal Wajdeczko
2017-08-04 16:26 ` [PATCH 02/15] drm/i915/guc: Prepare send() function to accept bigger response Michal Wajdeczko
2017-08-04 21:13 ` Michel Thierry
2017-08-04 16:27 ` [PATCH 03/15] drm/i915/guc: Add send_and_receive() helper function Michal Wajdeczko
2017-08-04 21:38 ` Michel Thierry
2017-08-04 16:27 ` [PATCH 04/15] drm/i915/guc: Implement response handling in send_mmio() Michal Wajdeczko
2017-08-04 21:43 ` Michel Thierry
2017-08-04 16:27 ` [PATCH 05/15] drm/i915/guc: Move Guc notification handling to separate function Michal Wajdeczko
2017-08-04 18:00 ` Chris Wilson
2017-08-04 19:35 ` Michal Wajdeczko
2017-08-04 16:27 ` [PATCH 06/15] drm/i915/guc: Move flushing the GuC logs outside notification handler Michal Wajdeczko
2017-08-04 16:27 ` [PATCH 07/15] drm/i915/guc: Create a GuC receive function Michal Wajdeczko
2017-08-04 23:59 ` Michel Thierry
2017-08-04 16:27 ` [PATCH 08/15] drm/i915/guc: Update CT message header definition Michal Wajdeczko
2017-08-04 16:27 ` [PATCH 09/15] drm/i915/guc: Prepare to handle messages from CT RECV buffer Michal Wajdeczko
2017-08-04 16:27 ` [PATCH 10/15] drm/i915/guc: Use better name for helper wait function Michal Wajdeczko
2017-08-04 16:27 ` [PATCH 11/15] drm/i915/guc: Implement response handling in send_ct() Michal Wajdeczko
2017-08-04 16:27 ` [PATCH 12/15] drm/i915/guc: Prepare to process incoming requests from CT Michal Wajdeczko
2017-08-04 17:13 ` Chris Wilson
2017-08-04 19:12 ` Michal Wajdeczko
2017-08-04 16:27 ` [PATCH 13/15] drm/i915/guc: Handle default action received over CT Michal Wajdeczko
2017-08-04 16:27 ` [PATCH 14/15] drm/i915/guc: Enable GuC interrupts when using CT Michal Wajdeczko
2017-08-04 16:27 ` [PATCH 15/15] drm/i915/guc: Trace messages from CT while in debug Michal Wajdeczko
2017-08-04 18:29 ` Chris Wilson
2017-08-04 16:49 ` ✗ Fi.CI.BAT: warning for drm/i915/guc: Support for Guc responses and requests Patchwork
2017-08-07 16:14 ` [PATCH v2 00/16] " Michal Wajdeczko
2017-08-07 16:14 ` [PATCH v2 01/16] drm/i915/guc: Add support for data reporting in GuC responses Michal Wajdeczko
2017-08-07 17:13 ` Michel Thierry [this message]
2017-08-07 16:14 ` [PATCH v2 02/16] drm/i915/guc: Prepare send() function to accept bigger response Michal Wajdeczko
2017-08-07 16:14 ` [PATCH v2 03/16] drm/i915/guc: Add send_and_receive() helper function Michal Wajdeczko
2017-08-07 16:14 ` [PATCH v2 04/16] drm/i915/guc: Implement response handling in send_mmio() Michal Wajdeczko
2017-08-07 16:14 ` [PATCH v2 05/16] drm/i915/guc: Move Guc notification handling to separate function Michal Wajdeczko
2017-08-07 16:14 ` [PATCH v2 06/16] drm/i915/guc: Move flushing the GuC logs outside notification handler Michal Wajdeczko
2017-08-07 16:14 ` [PATCH v2 07/16] drm/i915/guc: Create a GuC receive function Michal Wajdeczko
2017-08-07 16:14 ` [PATCH v2 08/16] drm/i915/guc: Update CT message header definition Michal Wajdeczko
2017-08-07 20:38 ` Daniele Ceraolo Spurio
2017-08-07 16:14 ` [PATCH v2 09/16] drm/i915/guc: Prepare to handle messages from CT RECV buffer Michal Wajdeczko
2017-08-07 16:14 ` [PATCH v2 10/16] drm/i915/guc: Use better name for helper wait function Michal Wajdeczko
2017-08-07 16:14 ` [PATCH v2 11/16] drm/i915/guc: Implement response handling in send_ct() Michal Wajdeczko
2017-08-07 16:14 ` [PATCH v2 12/16] drm/i915/guc: Prepare to process incoming requests from CT Michal Wajdeczko
2017-08-07 16:14 ` [PATCH v2 13/16] drm/i915/guc: Handle default action received over CT Michal Wajdeczko
2017-08-07 16:14 ` [PATCH v2 14/16] drm/i915/guc: Enable GuC interrupts when using CT Michal Wajdeczko
2017-08-08 15:26 ` Oscar Mateo
2017-08-07 16:14 ` [PATCH v2 15/16] drm/i915/guc: Trace messages from CT while in debug Michal Wajdeczko
2017-08-07 18:42 ` Daniele Ceraolo Spurio
2017-08-07 16:14 ` [PATCH v2 16/16] HAX Enable GuC loading & submission Michal Wajdeczko
2017-08-07 16:41 ` ✗ Fi.CI.BAT: failure for drm/i915/guc: Support for Guc responses and requests Patchwork
2017-08-08 12:30 ` [PATCH v3 15/16] drm/i915/guc: Trace messages from CT while in debug Michal Wajdeczko
2017-08-10 21:17 ` Daniele Ceraolo Spurio
2017-08-09 16:24 ` [PATCH v3 14/16] drm/i915/guc: Enable GuC interrupts when using CT Michal Wajdeczko
2017-08-09 17:06 ` Oscar Mateo
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=0406c8cb-0ad6-1bd4-ef8a-93e818fe5b4f@intel.com \
--to=michel.thierry@intel.com \
--cc=intel-gfx@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