[Intel-gfx] [PATCH v2 04/16] drm/i915/guc: Implement response handling in send_mmio()

Michal Wajdeczko michal.wajdeczko at intel.com
Mon Aug 7 16:14:18 UTC 2017


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.

v2: new line (Michel)

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

diff --git a/drivers/gpu/drm/i915/intel_uc.c b/drivers/gpu/drm/i915/intel_uc.c
index 1bb3bc0..433a6a3 100644
--- a/drivers/gpu/drm/i915/intel_uc.c
+++ b/drivers/gpu/drm/i915/intel_uc.c
@@ -517,6 +517,12 @@ 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 by Guc in status dword as return value */
 		ret = INTEL_GUC_RECV_TO_DATA(status);
 	}
-- 
2.7.4



More information about the Intel-gfx mailing list