[PATCH] drm/i915/gvt: allow semaphore wait command in gvt-g cmd parser

Weinan Li weinan.z.li at intel.com
Tue Oct 17 00:59:19 UTC 2017


There are semaphore wait commands which are blocked by GVT-g cmd parser
before. With partition GTT and shadow PPGTT, GVT-g can support semaphore
based on memory but not register. Still need to add more extra process
before enable register semaphore in the future.

Signed-off-by: Weinan Li <weinan.z.li at intel.com>
---
 drivers/gpu/drm/i915/gvt/cmd_parser.c | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/gvt/cmd_parser.c b/drivers/gpu/drm/i915/gvt/cmd_parser.c
index 831f816..46f0895 100644
--- a/drivers/gpu/drm/i915/gvt/cmd_parser.c
+++ b/drivers/gpu/drm/i915/gvt/cmd_parser.c
@@ -1462,7 +1462,22 @@ static inline int unexpected_cmd(struct parser_exec_state *s)
 
 static int cmd_handler_mi_semaphore_wait(struct parser_exec_state *s)
 {
-	return unexpected_cmd(s);
+	unsigned long gma;
+	int ret = 0;
+
+	/* TODO: handle semaphore wait based on register */
+	if (unlikely(cmd_val(s, 0) & (1 << 16)))
+		return unexpected_cmd(s);
+
+	/* Don't need to audit ppgtt */
+	if (!(cmd_val(s, 0) & (1 << 22)))
+		return 0;
+
+	gma = ((cmd_val(s, 3) & GENMASK(15, 0)) << 32) |
+		(cmd_val(s, 2) & GENMASK(31, 2));
+
+	ret = cmd_address_audit(s, gma, sizeof(u32), false);
+	return ret;
 }
 
 static int cmd_handler_mi_report_perf_count(struct parser_exec_state *s)
-- 
1.9.1



More information about the intel-gvt-dev mailing list