@@ -2425,6 +2425,9 @@ int i915_gem_context_create_ioctl(struct drm_device *dev, void *data,
int i915_gem_context_destroy_ioctl(struct drm_device *dev, void *data,
struct drm_file *file);
+/* intel_lrc.c */
+int gen8_gem_context_init(struct drm_device *dev);
+
/* i915_gem_evict.c */
int __must_check i915_gem_evict_something(struct drm_device *dev,
struct i915_address_space *vm,
@@ -4490,10 +4490,18 @@ i915_gem_init_hw(struct drm_device *dev)
return ret;
}
+static bool enable_execlists(struct drm_device *dev)
+{
+ if (!i915.enable_execlists)
+ return false;
+
+ 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;
- int ret;
+ int ret = -1;
mutex_lock(&dev->struct_mutex);
@@ -4509,11 +4517,17 @@ int i915_gem_init(struct drm_device *dev)
intel_init_rings_early(dev);
- ret = i915_gem_context_init(dev);
+ if (enable_execlists(dev))
+ ret = gen8_gem_context_init(dev);
+
if (ret) {
- mutex_unlock(&dev->struct_mutex);
- return ret;
- }
+ ret = i915_gem_context_init(dev);
+ if (ret) {
+ mutex_unlock(&dev->struct_mutex);
+ return ret;
+ }
+ } else
+ dev_priv->lrc_enabled = true;
ret = i915_gem_init_hw(dev);
if (ret == -EIO) {
@@ -40,3 +40,8 @@
#include <drm/drmP.h>
#include <drm/i915_drm.h>
#include "i915_drv.h"
+
+int gen8_gem_context_init(struct drm_device *dev)
+{
+ return -ENOSYS;
+}