clear-pkgs-linux-iot-lts2018/1238-drm-i915-gvt-set-acces...

40 lines
1.5 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Liu Xinyun <xinyun.liu@intel.com>
Date: Wed, 16 Oct 2019 05:45:32 +0800
Subject: [PATCH] drm/i915/gvt: set access non-context regs conditionally
It needs to prevent cmd accessing non-context reges only if the
non-context registers is not saved/restored.
Set this operation choosable with the parameter `enable_context_resume`
This change works with commit commit dfa51979b69e ("drm/i915/gvt: Forbid
command to access non-context registers")
Tracked-On: projectacrn/acrn-hypervisor#3830
Signed-off-by: Liu Xinyun <xinyun.liu@intel.com>
Reviewed-by: Zhao Yakui <yakui.zhao@intel.com>
---
drivers/gpu/drm/i915/gvt/cmd_parser.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/i915/gvt/cmd_parser.c b/drivers/gpu/drm/i915/gvt/cmd_parser.c
index 10ff0802f249..dbb60bb3a158 100644
--- a/drivers/gpu/drm/i915/gvt/cmd_parser.c
+++ b/drivers/gpu/drm/i915/gvt/cmd_parser.c
@@ -921,8 +921,9 @@ static int cmd_reg_handler(struct parser_exec_state *s,
/* Re-direct the non-context MMIO access to VGT_SCRATCH_REG, it
* has no functional impact to HW.
*/
- if (!strcmp(cmd, "lri") || !strcmp(cmd, "lrr-dst")
- || !strcmp(cmd, "lrm") || !strcmp(cmd, "pipe_ctrl")) {
+ if ((!strcmp(cmd, "lri") || !strcmp(cmd, "lrr-dst") ||
+ !strcmp(cmd, "lrm") || !strcmp(cmd, "pipe_ctrl")) &&
+ !i915_modparams.enable_context_restore) {
if (intel_gvt_mmio_is_non_context(gvt, offset))
patch_value(s, cmd_ptr(s, index), VGT_SCRATCH_REG);
}
--
https://clearlinux.org