[igt-dev] [PATCH i-g-t v5 2/2] tests: add slice power programming test

Chris Wilson chris at chris-wilson.co.uk
Thu May 24 16:09:45 UTC 2018


Quoting Lionel Landwerlin (2018-05-24 16:36:41)
> On 24/05/18 16:23, Chris Wilson wrote:
> > Quoting Lionel Landwerlin (2018-05-24 15:58:57)
> >> +static int drm_fd;
> >> +static int devid;
> >> +static uint64_t device_slice_mask = 0;
> >> +static uint64_t device_subslice_mask = 0;
> >> +static uint32_t device_slice_count = 0;
> >> +static uint32_t device_subslice_count = 0;
> > Any reason for using globals?
> >
> >> +static uint64_t mask_minus_one(uint64_t mask)
> > minus/plus was making me think you were trying to do the equivalent of
> > mask += 1 etc.
> >
> > I think mask_clear_first() and mask_set_next() would be clearer, and
> > I would just lose the _one variants and just pass N in everywhere.
> >
> >> +{
> >> +       int i;
> >> +
> > mask_clear_first:
> >       bit = ffs(mask);
> >       igt_assert(bit);
> >       return mask & ~BIT(bit-1);
> >
> > mask_set_next:
> >       bit = ffs(~mask);
> >       igt_assert(bit);
> >       return mask | BIT(bit-1);
> >
> > ?
> 
> It's not that simple :(
> 
> Here is the subslice mask of my BXT 2x6 : 0b110
> So I think stuff can get fused off anywhere.
> 
> >
> >> +static uint32_t
> >> +read_rpcs_reg(drm_intel_bufmgr *bufmgr,
> >> +             drm_intel_context *context,
> >> +             uint32_t expected_slices)
> >> +{
> >> +       struct intel_batchbuffer *batch;
> >> +       drm_intel_bo *dst_bo;
> > Bleurgh. Why the dependency on libdrm_intel?
> >
> > Do you have to keep using libdrm_intel? For testing the kernel
> > interfaces, the obfuscation is not helpful.
> 
> I'm just being lazy...
> I thought doing stuff from scratch would be a fair amount of additional 
> code.
> Will update.

Everything you want here is provided by igt already.

ioctl_wrappers.c for the most part.

The only thing you lose out on is bufmgr, if you happen to be desperate
for bo caching. (And arguably if your test is that performance centric
then setting everything up once before the test rather than rely on
libdrm_intel's cache is still preferable.)
-Chris


More information about the igt-dev mailing list