[Intel-gfx] [PATCH 5/5] drm/i915/contexts: Serialize default context init

Ben Widawsky ben at bwidawsk.net
Tue Aug 14 23:35:17 CEST 2012


This is possible with the new force parameter in do_switch. As stated in
that patch, the goal is to get a real context stored at the time of
initialization.

References: https://bugs.freedesktop.org/show_bug.cgi?id=52429
Tested-by: Guang A Yang <guang.a.yang at intel.com>
Signed-off-by: Ben Widawsky <ben at bwidawsk.net>
---
 drivers/gpu/drm/i915/i915_gem_context.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/gpu/drm/i915/i915_gem_context.c b/drivers/gpu/drm/i915/i915_gem_context.c
index 3db84e2..eed00da 100644
--- a/drivers/gpu/drm/i915/i915_gem_context.c
+++ b/drivers/gpu/drm/i915/i915_gem_context.c
@@ -229,6 +229,10 @@ static int create_default_context(struct drm_i915_private *dev_priv)
 	if (ret)
 		goto err_unpin;
 
+	ret = do_switch(ctx, true);
+	if (ret)
+		goto err_unpin;
+
 	DRM_DEBUG_DRIVER("Default HW context loaded\n");
 	return 0;
 
-- 
1.7.11.4




More information about the Intel-gfx mailing list