Commit d624d86e authored by Daniel Vetter's avatar Daniel Vetter

drm/i915: Drop create_vm argument to i915_gem_create_context

Now that all the flow is streamlined the rule is simple: We create
a new ppgtt for a new context when we have full ppgtt enabled.
Reviewed-by: default avatarMichel Thierry <michel.thierry@intel.com>
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
parent ae6c4806
...@@ -233,8 +233,7 @@ __create_hw_context(struct drm_device *dev, ...@@ -233,8 +233,7 @@ __create_hw_context(struct drm_device *dev,
*/ */
static struct intel_context * static struct intel_context *
i915_gem_create_context(struct drm_device *dev, i915_gem_create_context(struct drm_device *dev,
struct drm_i915_file_private *file_priv, struct drm_i915_file_private *file_priv)
bool create_vm)
{ {
const bool is_global_default_ctx = file_priv == NULL; const bool is_global_default_ctx = file_priv == NULL;
struct intel_context *ctx; struct intel_context *ctx;
...@@ -262,7 +261,7 @@ i915_gem_create_context(struct drm_device *dev, ...@@ -262,7 +261,7 @@ i915_gem_create_context(struct drm_device *dev,
} }
} }
if (create_vm) { if (USES_FULL_PPGTT(dev)) {
struct i915_hw_ppgtt *ppgtt = i915_ppgtt_create(dev, file_priv); struct i915_hw_ppgtt *ppgtt = i915_ppgtt_create(dev, file_priv);
if (IS_ERR_OR_NULL(ppgtt)) { if (IS_ERR_OR_NULL(ppgtt)) {
...@@ -345,7 +344,7 @@ int i915_gem_context_init(struct drm_device *dev) ...@@ -345,7 +344,7 @@ int i915_gem_context_init(struct drm_device *dev)
} }
} }
ctx = i915_gem_create_context(dev, NULL, USES_FULL_PPGTT(dev)); ctx = i915_gem_create_context(dev, NULL);
if (IS_ERR(ctx)) { if (IS_ERR(ctx)) {
DRM_ERROR("Failed to create default global context (error %ld)\n", DRM_ERROR("Failed to create default global context (error %ld)\n",
PTR_ERR(ctx)); PTR_ERR(ctx));
...@@ -444,7 +443,7 @@ int i915_gem_context_open(struct drm_device *dev, struct drm_file *file) ...@@ -444,7 +443,7 @@ int i915_gem_context_open(struct drm_device *dev, struct drm_file *file)
idr_init(&file_priv->context_idr); idr_init(&file_priv->context_idr);
mutex_lock(&dev->struct_mutex); mutex_lock(&dev->struct_mutex);
ctx = i915_gem_create_context(dev, file_priv, USES_FULL_PPGTT(dev)); ctx = i915_gem_create_context(dev, file_priv);
mutex_unlock(&dev->struct_mutex); mutex_unlock(&dev->struct_mutex);
if (IS_ERR(ctx)) { if (IS_ERR(ctx)) {
...@@ -702,7 +701,7 @@ int i915_gem_context_create_ioctl(struct drm_device *dev, void *data, ...@@ -702,7 +701,7 @@ int i915_gem_context_create_ioctl(struct drm_device *dev, void *data,
if (ret) if (ret)
return ret; return ret;
ctx = i915_gem_create_context(dev, file_priv, USES_FULL_PPGTT(dev)); ctx = i915_gem_create_context(dev, file_priv);
mutex_unlock(&dev->struct_mutex); mutex_unlock(&dev->struct_mutex);
if (IS_ERR(ctx)) if (IS_ERR(ctx))
return PTR_ERR(ctx); return PTR_ERR(ctx);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment