diff mbox

[1/2] drm/i915/hsw: Expose resource streamer control flags

Message ID 1373290729-18887-2-git-send-email-abdiel.janulgue@linux.intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Abdiel Janulgue July 8, 2013, 1:38 p.m. UTC
Signed-off-by: Abdiel Janulgue <abdiel.janulgue@linux.intel.com>
---
 drivers/gpu/drm/i915/i915_gem_execbuffer.c |    2 ++
 include/uapi/drm/i915_drm.h                |    1 +
 2 files changed, 3 insertions(+)

Comments

Daniel Vetter July 8, 2013, 8:11 p.m. UTC | #1
On Mon, Jul 08, 2013 at 04:38:48PM +0300, Abdiel Janulgue wrote:
> Signed-off-by: Abdiel Janulgue <abdiel.janulgue@linux.intel.com>
> ---
>  drivers/gpu/drm/i915/i915_gem_execbuffer.c |    2 ++
>  include/uapi/drm/i915_drm.h                |    1 +
>  2 files changed, 3 insertions(+)
> 
> diff --git a/drivers/gpu/drm/i915/i915_gem_execbuffer.c b/drivers/gpu/drm/i915/i915_gem_execbuffer.c
> index 5aeb447..3d6d3c9 100644
> --- a/drivers/gpu/drm/i915/i915_gem_execbuffer.c
> +++ b/drivers/gpu/drm/i915/i915_gem_execbuffer.c
> @@ -865,6 +865,8 @@ i915_gem_do_execbuffer(struct drm_device *dev, void *data,
>  	}
>  	if (args->flags & I915_EXEC_IS_PINNED)
>  		flags |= I915_DISPATCH_PINNED;
> +	if (args->flags & I915_EXEC_RS)
> +		flags |= I915_EXEC_RS;

I think we should check for the render ring and haswell here and reject
the flag everywhere else by returning -EINVAL to userspace.
-Daniel

>  
>  	switch (args->flags & I915_EXEC_RING_MASK) {
>  	case I915_EXEC_DEFAULT:
> diff --git a/include/uapi/drm/i915_drm.h b/include/uapi/drm/i915_drm.h
> index 923ed7f..728f544 100644
> --- a/include/uapi/drm/i915_drm.h
> +++ b/include/uapi/drm/i915_drm.h
> @@ -661,6 +661,7 @@ struct drm_i915_gem_execbuffer2 {
>  #define I915_EXEC_BSD                    (2<<0)
>  #define I915_EXEC_BLT                    (3<<0)
>  #define I915_EXEC_VEBOX                  (4<<0)
> +#define I915_EXEC_RS                     (8<<0)
>  
>  /* Used for switching the constants addressing mode on gen4+ RENDER ring.
>   * Gen6+ only supports relative addressing to dynamic state (default) and
> -- 
> 1.7.9.5
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Chris Wilson July 9, 2013, 9:04 a.m. UTC | #2
On Mon, Jul 08, 2013 at 04:38:48PM +0300, Abdiel Janulgue wrote:
> Signed-off-by: Abdiel Janulgue <abdiel.janulgue@linux.intel.com>
> ---
>  drivers/gpu/drm/i915/i915_gem_execbuffer.c |    2 ++
>  include/uapi/drm/i915_drm.h                |    1 +
>  2 files changed, 3 insertions(+)
> 
> diff --git a/drivers/gpu/drm/i915/i915_gem_execbuffer.c b/drivers/gpu/drm/i915/i915_gem_execbuffer.c
> index 5aeb447..3d6d3c9 100644
> --- a/drivers/gpu/drm/i915/i915_gem_execbuffer.c
> +++ b/drivers/gpu/drm/i915/i915_gem_execbuffer.c
> @@ -865,6 +865,8 @@ i915_gem_do_execbuffer(struct drm_device *dev, void *data,
>  	}
>  	if (args->flags & I915_EXEC_IS_PINNED)
>  		flags |= I915_DISPATCH_PINNED;
> +	if (args->flags & I915_EXEC_RS)
> +		flags |= I915_EXEC_RS;

Keep EXEC and DISPATCH as distinct namespaces.

>  	switch (args->flags & I915_EXEC_RING_MASK) {
>  	case I915_EXEC_DEFAULT:
> diff --git a/include/uapi/drm/i915_drm.h b/include/uapi/drm/i915_drm.h
> index 923ed7f..728f544 100644
> --- a/include/uapi/drm/i915_drm.h
> +++ b/include/uapi/drm/i915_drm.h
> @@ -661,6 +661,7 @@ struct drm_i915_gem_execbuffer2 {
>  #define I915_EXEC_BSD                    (2<<0)
>  #define I915_EXEC_BLT                    (3<<0)
>  #define I915_EXEC_VEBOX                  (4<<0)
> +#define I915_EXEC_RS                     (8<<0)

This is in the portion of bits set aside for new rings. Please add it to
the end of the of the flags. And call it _RESOURCE_STREAMER to be less
ambiguous.
-Chris
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/i915_gem_execbuffer.c b/drivers/gpu/drm/i915/i915_gem_execbuffer.c
index 5aeb447..3d6d3c9 100644
--- a/drivers/gpu/drm/i915/i915_gem_execbuffer.c
+++ b/drivers/gpu/drm/i915/i915_gem_execbuffer.c
@@ -865,6 +865,8 @@  i915_gem_do_execbuffer(struct drm_device *dev, void *data,
 	}
 	if (args->flags & I915_EXEC_IS_PINNED)
 		flags |= I915_DISPATCH_PINNED;
+	if (args->flags & I915_EXEC_RS)
+		flags |= I915_EXEC_RS;
 
 	switch (args->flags & I915_EXEC_RING_MASK) {
 	case I915_EXEC_DEFAULT:
diff --git a/include/uapi/drm/i915_drm.h b/include/uapi/drm/i915_drm.h
index 923ed7f..728f544 100644
--- a/include/uapi/drm/i915_drm.h
+++ b/include/uapi/drm/i915_drm.h
@@ -661,6 +661,7 @@  struct drm_i915_gem_execbuffer2 {
 #define I915_EXEC_BSD                    (2<<0)
 #define I915_EXEC_BLT                    (3<<0)
 #define I915_EXEC_VEBOX                  (4<<0)
+#define I915_EXEC_RS                     (8<<0)
 
 /* Used for switching the constants addressing mode on gen4+ RENDER ring.
  * Gen6+ only supports relative addressing to dynamic state (default) and