diff mbox

[04/15] drm/i915/guc: Implement response handling in send_mmio()

Message ID 20170804162712.20468-5-michal.wajdeczko@intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Michal Wajdeczko Aug. 4, 2017, 4:27 p.m. UTC
In addition to already returned small data encoded in the status MMIO,
GuC may write more additional data in remaining MMIO regs. Lets copy
all that regs into optionally provided response buffer.

Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
Cc: Oscar Mateo <oscar.mateo@intel.com>
---
 drivers/gpu/drm/i915/intel_uc.c | 5 +++++
 1 file changed, 5 insertions(+)

Comments

Michel Thierry Aug. 4, 2017, 9:43 p.m. UTC | #1
On 8/4/2017 9:27 AM, Michal Wajdeczko wrote:
> In addition to already returned small data encoded in the status MMIO,
> GuC may write more additional data in remaining MMIO regs. Lets copy
> all that regs into optionally provided response buffer.
> 
> Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
> Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
> Cc: Oscar Mateo <oscar.mateo@intel.com>
> ---
>   drivers/gpu/drm/i915/intel_uc.c | 5 +++++
>   1 file changed, 5 insertions(+)
> 
> diff --git a/drivers/gpu/drm/i915/intel_uc.c b/drivers/gpu/drm/i915/intel_uc.c
> index 77da750..c704968 100644
> --- a/drivers/gpu/drm/i915/intel_uc.c
> +++ b/drivers/gpu/drm/i915/intel_uc.c
> @@ -517,6 +517,11 @@ int intel_guc_send_mmio(struct intel_guc *guc, const u32 *action, u32 len,
>                           " ret=%d status=0x%08X response=0x%08X\n",
>                           action[0], ret, status, I915_READ(SOFT_SCRATCH(15)));
>          } else {
> +               if (response) {
> +                       /* Skip reg[0] with the status/response mask */
> +                       for (i = 1; i < guc->send_regs.count; i++)
> +                               response[i] = I915_READ(guc_send_reg(guc, i));
> +               }

new line here?
>                  /* Use data encoded in status dword as return value */
>                  ret = INTEL_GUC_RECV_TO_DATA(status);
>          }

Reviewed-by: Michel Thierry <michel.thierry@intel.com>
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/intel_uc.c b/drivers/gpu/drm/i915/intel_uc.c
index 77da750..c704968 100644
--- a/drivers/gpu/drm/i915/intel_uc.c
+++ b/drivers/gpu/drm/i915/intel_uc.c
@@ -517,6 +517,11 @@  int intel_guc_send_mmio(struct intel_guc *guc, const u32 *action, u32 len,
 			 " ret=%d status=0x%08X response=0x%08X\n",
 			 action[0], ret, status, I915_READ(SOFT_SCRATCH(15)));
 	} else {
+		if (response) {
+			/* Skip reg[0] with the status/response mask */
+			for (i = 1; i < guc->send_regs.count; i++)
+				response[i] = I915_READ(guc_send_reg(guc, i));
+		}
 		/* Use data encoded in status dword as return value */
 		ret = INTEL_GUC_RECV_TO_DATA(status);
 	}