Commit e8520969 authored by Chris Wilson's avatar Chris Wilson Committed by Daniel Vetter

drm/i915: Replace open-coding of DEFAULT_CONTEXT_ID

The intent of the check is made more clear if we use the proper name for
0 here.
Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: default avatarMika Kuoppala <mika.kuoppala@intel.com>
Reviewed-by: default avatarBen Widawsky <ben@bwidawsk.net>
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
parent 11fa3384
...@@ -873,7 +873,7 @@ i915_gem_do_execbuffer(struct drm_device *dev, void *data, ...@@ -873,7 +873,7 @@ i915_gem_do_execbuffer(struct drm_device *dev, void *data,
break; break;
case I915_EXEC_BSD: case I915_EXEC_BSD:
ring = &dev_priv->ring[VCS]; ring = &dev_priv->ring[VCS];
if (ctx_id != 0) { if (ctx_id != DEFAULT_CONTEXT_ID) {
DRM_DEBUG("Ring %s doesn't support contexts\n", DRM_DEBUG("Ring %s doesn't support contexts\n",
ring->name); ring->name);
return -EPERM; return -EPERM;
...@@ -881,7 +881,7 @@ i915_gem_do_execbuffer(struct drm_device *dev, void *data, ...@@ -881,7 +881,7 @@ i915_gem_do_execbuffer(struct drm_device *dev, void *data,
break; break;
case I915_EXEC_BLT: case I915_EXEC_BLT:
ring = &dev_priv->ring[BCS]; ring = &dev_priv->ring[BCS];
if (ctx_id != 0) { if (ctx_id != DEFAULT_CONTEXT_ID) {
DRM_DEBUG("Ring %s doesn't support contexts\n", DRM_DEBUG("Ring %s doesn't support contexts\n",
ring->name); ring->name);
return -EPERM; return -EPERM;
...@@ -889,7 +889,7 @@ i915_gem_do_execbuffer(struct drm_device *dev, void *data, ...@@ -889,7 +889,7 @@ i915_gem_do_execbuffer(struct drm_device *dev, void *data,
break; break;
case I915_EXEC_VEBOX: case I915_EXEC_VEBOX:
ring = &dev_priv->ring[VECS]; ring = &dev_priv->ring[VECS];
if (ctx_id != 0) { if (ctx_id != DEFAULT_CONTEXT_ID) {
DRM_DEBUG("Ring %s doesn't support contexts\n", DRM_DEBUG("Ring %s doesn't support contexts\n",
ring->name); ring->name);
return -EPERM; return -EPERM;
......
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