[Intel-gfx] [PATCH 1/2] drm/i915: Factor out a enable_execlists() function

Damien Lespiau damien.lespiau at intel.com
Mon Apr 7 16:05:38 CEST 2014


So it's clear what the condition is. We'll add a bit more code shortly.

Signed-off-by: Damien Lespiau <damien.lespiau at intel.com>
---
 drivers/gpu/drm/i915/i915_gem.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index 1a58e6e..998f647 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -4460,6 +4460,11 @@ err_out:
 	return ret;
 }
 
+static bool enable_execlists(struct drm_device *dev)
+{
+	return HAS_LOGICAL_RING_CONTEXTS(dev) && USES_PPGTT(dev);
+}
+
 int i915_gem_init(struct drm_device *dev)
 {
 	struct drm_i915_private *dev_priv = dev->dev_private;
@@ -4478,7 +4483,7 @@ int i915_gem_init(struct drm_device *dev)
 
 	intel_init_rings_early(dev);
 
-	if (HAS_LOGICAL_RING_CONTEXTS(dev) && USES_PPGTT(dev))
+	if (enable_execlists(dev))
 		ret = gen8_gem_context_init(dev);
 
 	if (ret) {
-- 
1.8.3.1




More information about the Intel-gfx mailing list