[Beignet] [PATCH] drm/i915: Export total subslice and EU counts

Jeff McGee jeff.mcgee at intel.com
Fri Mar 6 10:44:18 PST 2015


On Thu, Mar 05, 2015 at 12:35:55PM +0800, Zhigang Gong wrote:
> There is one minor conflict when apply the KMD patch to latest
> drm-intel-nightly branch. It should be easy to fix.
> 
> Another issue is that IMO, we should bump libdrm's version number
> when increase these new APIs. Then in Beignet, we can check the
> libdrm version at build time and determine whether we will use
> these new interfaces. Thus, we can avoid breaking beignet on
> those systems which have previous libdrm/kernel installed.
> 
Right. I can append a libdrm patch to bump the version. And then I
suppose I will follow the process to make a new release. Not sure
right now how that works. First time going through it.

Also, how should we test for the libdrm version and conditionally
use the API? Is there a previous example of this in Beignet that I
could follow?

Jeff

> The other parts of the whole patchset,
> including patches for KMD/libdrm/Intel gpu tools and Beignet,
> all look good to me.
> 
> And I just tested it on BDW and SKL platforms, it works fine.
> 
> Thanks,
> Zhigang Gong.
> 
> On Mon, Mar 02, 2015 at 03:37:32PM -0800, jeff.mcgee at intel.com wrote:
> > From: Jeff McGee <jeff.mcgee at intel.com>
> > 
> > Setup new I915_GETPARAM ioctl entries for subslice total and
> > EU total. Userspace drivers need these values when constructing
> > GPGPU commands. This kernel query method is intended to replace
> > the PCI ID-based tables that userspace drivers currently maintain.
> > The kernel driver can employ fuse register reads as needed to
> > ensure the most accurate determination of GT config attributes.
> > This first became important with Cherryview in which the config
> > could differ between devices with the same PCI ID.
> > 
> > The kernel detection of these values is device-specific and not
> > included in this patch. Because zero is not a valid value for any of
> > these parameters, a value of zero is interpreted as unknown for the
> > device. Userspace drivers should continue to maintain ID-based tables
> > for older devices not supported by the new query method.
> > 
> > For: VIZ-4636
> > Signed-off-by: Jeff McGee <jeff.mcgee at intel.com>
> > ---
> >  drivers/gpu/drm/i915/i915_dma.c | 10 ++++++++++
> >  include/uapi/drm/i915_drm.h     |  2 ++
> >  2 files changed, 12 insertions(+)
> > 
> > diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c
> > index 053e178..9350ea2 100644
> > --- a/drivers/gpu/drm/i915/i915_dma.c
> > +++ b/drivers/gpu/drm/i915/i915_dma.c
> > @@ -150,6 +150,16 @@ static int i915_getparam(struct drm_device *dev, void *data,
> >  	case I915_PARAM_MMAP_VERSION:
> >  		value = 1;
> >  		break;
> > +	case I915_PARAM_SUBSLICE_TOTAL:
> > +		value = INTEL_INFO(dev)->subslice_total;
> > +		if (!value)
> > +			return -ENODEV;
> > +		break;
> > +	case I915_PARAM_EU_TOTAL:
> > +		value = INTEL_INFO(dev)->eu_total;
> > +		if (!value)
> > +			return -ENODEV;
> > +		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 6eed16b..8672efc 100644
> > --- a/include/uapi/drm/i915_drm.h
> > +++ b/include/uapi/drm/i915_drm.h
> > @@ -347,6 +347,8 @@ typedef struct drm_i915_irq_wait {
> >  #define I915_PARAM_HAS_COHERENT_PHYS_GTT 29
> >  #define I915_PARAM_MMAP_VERSION          30
> >  #define I915_PARAM_HAS_BSD2		 31
> > +#define I915_PARAM_SUBSLICE_TOTAL	 32
> > +#define I915_PARAM_EU_TOTAL		 33
> >  
> >  typedef struct drm_i915_getparam {
> >  	int param;
> > -- 
> > 2.3.0
> > 
> > _______________________________________________
> > Beignet mailing list
> > Beignet at lists.freedesktop.org
> > http://lists.freedesktop.org/mailman/listinfo/beignet
> _______________________________________________
> Beignet mailing list
> Beignet at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/beignet


More information about the dri-devel mailing list