On Wed, Jan 29, 2014 at 01:55:13PM -0800, [email protected] wrote:
> From: Brad Volkin <[email protected]>
> 
> So userspace can query the kernel for command parser support.
> 
> OTC-Tracker: AXIA-4631
> Change-Id: I58af650db9f6753c2dcac9c54ab432fd31db302f
> Signed-off-by: Brad Volkin <[email protected]>
> ---
>  drivers/gpu/drm/i915/i915_dma.c | 4 ++++
>  include/uapi/drm/i915_drm.h     | 1 +
>  2 files changed, 5 insertions(+)
> 
> diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c
> index 258b1be..34ba199 100644
> --- a/drivers/gpu/drm/i915/i915_dma.c
> +++ b/drivers/gpu/drm/i915/i915_dma.c
> @@ -1013,6 +1013,10 @@ static int i915_getparam(struct drm_device *dev, void 
> *data,
>       case I915_PARAM_HAS_EXEC_HANDLE_LUT:
>               value = 1;
>               break;
> +     case I915_PARAM_CMD_PARSER_VERSION:
> +             /* TODO: version info (e.g. what is allowed?) */
> +             value = 1;

I think an increasing integer without any mean special grouping (like
major/minor) is good enough. What we need though is a small revision log
with one-line blurbs that explain what has been added, e.g.

1: Initial version.
2: Allow streamout related registers
3: Add gen8 support

...

I think it would be good to have this as a comment right next to the
parser code itself, so what about adding a i915_cmd_parser_get_version
function to i915_cmd_parser.c who's only job is to return and integer and
contain this comment?
-Daniel

> +             break;
>       default:
>               DRM_DEBUG("Unknown parameter %d\n", param->param);
>               return -EINVAL;
> diff --git a/include/uapi/drm/i915_drm.h b/include/uapi/drm/i915_drm.h
> index 126bfaa..8a3e4ef00 100644
> --- a/include/uapi/drm/i915_drm.h
> +++ b/include/uapi/drm/i915_drm.h
> @@ -337,6 +337,7 @@ typedef struct drm_i915_irq_wait {
>  #define I915_PARAM_HAS_EXEC_NO_RELOC  25
>  #define I915_PARAM_HAS_EXEC_HANDLE_LUT   26
>  #define I915_PARAM_HAS_WT                     27
> +#define I915_PARAM_CMD_PARSER_VERSION         28
>  
>  typedef struct drm_i915_getparam {
>       int param;
> -- 
> 1.8.5.2
> 
> _______________________________________________
> Intel-gfx mailing list
> [email protected]
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

Reply via email to