[Intel-gfx] [PATCH 12/13] drm/i915: Add a CMD_PARSER_VERSION getparam

Volkin, Bradley D bradley.d.volkin at intel.com
Thu Jan 30 18:25:26 CET 2014


On Thu, Jan 30, 2014 at 01:19:15AM -0800, Daniel Vetter wrote:
> On Wed, Jan 29, 2014 at 01:55:13PM -0800, bradley.d.volkin at intel.com wrote:
> > From: Brad Volkin <bradley.d.volkin at intel.com>
> > 
> > So userspace can query the kernel for command parser support.
> > 
> > OTC-Tracker: AXIA-4631
> > Change-Id: I58af650db9f6753c2dcac9c54ab432fd31db302f
> > Signed-off-by: Brad Volkin <bradley.d.volkin at intel.com>
> > ---
> >  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

Agree on the revision log. I forgot that I left writing it as a todo.
I'll add i915_cmd_parser_get_version and fill that in.
- Brad
 
> 
> > +		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
> > Intel-gfx at lists.freedesktop.org
> > http://lists.freedesktop.org/mailman/listinfo/intel-gfx
> 
> -- 
> Daniel Vetter
> Software Engineer, Intel Corporation
> +41 (0) 79 365 57 48 - http://blog.ffwll.ch



More information about the Intel-gfx mailing list