[igt-dev] [PATCH i-g-t 04/17] Add basic PXP testing of buffer and context alloc
Teres Alexis, Alan Previn
alan.previn.teres.alexis at intel.com
Mon May 17 16:34:20 UTC 2021
Okay will replace with igt_ioctl .. the history was skeleton code I inherited and I assumed that ioctl call method was already correct - so it wasnt an intentional gap.
...alan
-----Original Message-----
From: Latvala, Petri <petri.latvala at intel.com>
Sent: Monday, May 17, 2021 7:51 AM
To: Dixit, Ashutosh <ashutosh.dixit at intel.com>
Cc: Teres Alexis, Alan Previn <alan.previn.teres.alexis at intel.com>; igt-dev at lists.freedesktop.org
Subject: Re: [igt-dev] [PATCH i-g-t 04/17] Add basic PXP testing of buffer and context alloc
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