[igt-dev] [PATCH i-g-t 04/17] Add basic PXP testing of buffer and context alloc

Petri Latvala petri.latvala at intel.com
Mon May 17 14:50:35 UTC 2021


On Mon, May 17, 2021 at 07:42:49AM -0700, Dixit, Ashutosh wrote:
> On Mon, 17 May 2021 03:26:34 -0700, Petri Latvala wrote:
> >
> > > +static int create_bo_ext(int i915, uint32_t size, bool protected_is_true, uint32_t *bo_out)
> > > +{
> > > +	int ret;
> > > +
> > > +	struct drm_i915_gem_create_ext_protected_content protected_ext = {
> > > +		.base = { .name = I915_GEM_CREATE_EXT_PROTECTED_CONTENT },
> > > +		.flags = 0,
> > > +	};
> > > +
> > > +	struct drm_i915_gem_create_ext create_ext = {
> > > +		.size = size,
> > > +		.extensions = 0,
> > > +	};
> > > +
> > > +	if (protected_is_true)
> > > +		create_ext.extensions = (uintptr_t)&protected_ext;
> > > +
> > > +	ret = ioctl(i915, DRM_IOCTL_I915_GEM_CREATE_EXT, &create_ext);
> >
> > Why the naked ioctl on a DRM ioctl instead of the many wrappers we
> > have in lib? (do_ioctl, do_ioctl_err, igt_ioctl, ...)
> 
> Mostly because Matt Auld's patchset which adds these wrappers for
> DRM_IOCTL_I915_GEM_CREATE_EXT has not yet been merged.

Still, using plain

ioctl(i915, DRM_IOCTL_I915_GEM_CREATE_EXT, &create_ext)

instead of

igt_ioctl(i915, DRM_IOCTL_I915_GEM_CREATE_EXT, &create_ext)

needs a good reason.


-- 
Petri Latvala


More information about the igt-dev mailing list