drm/i915/gvt: let NOPID be the default value of force_to_nonpriv registers
[muen/linux.git] / drivers / gpu / drm / i915 / gvt / cmd_parser.c
index 9ec2cd982705e43d451be0f080ddd8fbf154b896..737cc824344def3e521a23c5f88d7cdf4311efbb 100644 (file)
@@ -817,8 +817,15 @@ static int force_nonpriv_reg_handler(struct parser_exec_state *s,
 {
        struct intel_gvt *gvt = s->vgpu->gvt;
        unsigned int data = cmd_val(s, index + 1);
+       u32 ring_base;
+       u32 nopid;
+       struct drm_i915_private *dev_priv = s->vgpu->gvt->dev_priv;
+
+       ring_base = dev_priv->engine[s->ring_id]->mmio_base;
+       nopid = i915_mmio_reg_offset(RING_NOPID(ring_base));
 
-       if (!intel_gvt_in_force_nonpriv_whitelist(gvt, data)) {
+       if (!intel_gvt_in_force_nonpriv_whitelist(gvt, data) &&
+                       data != nopid) {
                gvt_err("Unexpected forcenonpriv 0x%x LRI write, value=0x%x\n",
                        offset, data);
                return -EPERM;