drm/rockchip: add rk3399 vop big csc support
[firefly-linux-kernel-4.4.55.git] / drivers / gpu / drm / i915 / i915_gem_context.c
index 02ceb7a4b4815e52a825a290aa8e6d2cd78d25b5..0433d25f9d23a6b8cf4c6a4650b81ae7024c0535 100644 (file)
@@ -340,6 +340,10 @@ void i915_gem_context_reset(struct drm_device *dev)
                        i915_gem_context_unreference(lctx);
                        ring->last_context = NULL;
                }
+
+               /* Force the GPU state to be reinitialised on enabling */
+               if (ring->default_context)
+                       ring->default_context->legacy_hw_ctx.initialized = false;
        }
 }
 
@@ -708,7 +712,7 @@ static int do_switch(struct drm_i915_gem_request *req)
        if (ret)
                goto unpin_out;
 
-       if (!to->legacy_hw_ctx.initialized) {
+       if (!to->legacy_hw_ctx.initialized || i915_gem_context_is_default(to)) {
                hw_flags |= MI_RESTORE_INHIBIT;
                /* NB: If we inhibit the restore, the context is not allowed to
                 * die because future work may end up depending on valid address