drm/i915: add I915_EXEC_VEBOX to i915_gem_do_execbuffer()
authorXiang, Haihao <haihao.xiang@intel.com>
Wed, 29 May 2013 02:22:33 +0000 (19:22 -0700)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Fri, 31 May 2013 18:54:21 +0000 (20:54 +0200)
A user can run batchbuffer via VEBOX ring.

Signed-off-by: Xiang, Haihao <haihao.xiang@intel.com>
Reviewed-by: Damien Lespiau <damien.lespiau@intel.com>
Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/i915/i915_gem_execbuffer.c
include/uapi/drm/i915_drm.h

index 117ce38136812d1689ecc4b65ffe743a5e86a71c..a8bb62ca8756a42f424bd20a446e38d28a79f25b 100644 (file)
@@ -885,6 +885,15 @@ i915_gem_do_execbuffer(struct drm_device *dev, void *data,
                        return -EPERM;
                }
                break;
+       case I915_EXEC_VEBOX:
+               ring = &dev_priv->ring[VECS];
+               if (ctx_id != 0) {
+                       DRM_DEBUG("Ring %s doesn't support contexts\n",
+                                 ring->name);
+                       return -EPERM;
+               }
+               break;
+
        default:
                DRM_DEBUG("execbuf with unknown ring: %d\n",
                          (int)(args->flags & I915_EXEC_RING_MASK));
index 07d59419fe6ba29a03a5cc4bdfe8ffb46acb29ab..81b99817198edfaeb5984b85a4789c11c4495462 100644 (file)
@@ -660,6 +660,7 @@ struct drm_i915_gem_execbuffer2 {
 #define I915_EXEC_RENDER                 (1<<0)
 #define I915_EXEC_BSD                    (2<<0)
 #define I915_EXEC_BLT                    (3<<0)
+#define I915_EXEC_VEBOX                  (4<<0)
 
 /* Used for switching the constants addressing mode on gen4+ RENDER ring.
  * Gen6+ only supports relative addressing to dynamic state (default) and