From: Andi Shyti <andi@etezian.org>
To: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Intel GFX <intel-gfx@lists.freedesktop.org>
Subject: Re: [Intel-gfx] [PATCH v4] drm/i915/gt: allow setting generic data pointer
Date: Sun, 8 Mar 2020 00:19:55 +0200 [thread overview]
Message-ID: <20200307221955.GA60782@jack.zhora.eu> (raw)
In-Reply-To: <158360254703.6224.5041578469627024671@build.alporthouse.com>
Hi Chris,
> > > Quoting Andi Shyti (2020-03-06 23:03:44)
> > > > -void debugfs_gt_register_files(struct intel_gt *gt,
> > > > - struct dentry *root,
> > > > - const struct debugfs_gt_file *files,
> > > > - unsigned long count)
> > > > +void intel_gt_debugfs_register_files(struct dentry *root,
> > > > + const struct debugfs_gt_file *files,
> > > > + unsigned long count, void *data)
> > > > {
> > > > while (count--) {
> > > > - if (!files->eval || files->eval(gt))
> > > > + if (!files->eval || files->eval(data))
> > > > debugfs_create_file(files->name,
> > > > - 0444, root, gt,
> > > > + 0444, root, data,
> > > > files->fops);
> > > >
> > >
> > > And now we are not a intel_gt routine, you'll want to move again :)
> > > i915_debugfs_utils.c ? :)
> >
> > Actually, this is what it came to and this was the first
> > discussion I had with Daniele and that's also why I was loyal to
> > th "_gt_" wrappers until the end. But I had to agree that this
> > was becoming more a limitation.
> >
> > The biggest difference left, which by the way is the real
> > distinguishing factor other than the *gt pointer, is that we
> > create files under gt directory, instead of having the root
> > imposed by the drm (even though the caller can eventually choose
> > different roots).
> >
> > We could perhaps store the root pointer in the intel_gt
> > structure so that this function stays de facto an intel_gt
> > routine and the caller doesn't need to care where the files will
> > be generated. This is what we planned to do with sysfs as well.
> >
> > What do you think?
>
> I thought we were passing along the root. If not I think we should, more
> of a debugfs constructor context?
What do you mean with debugfs constructor context? Is it a
gt->debugfs_root pointer like the gt->sysfs_root?
> The main thing of course is not to overengineer and do the minimal
> necessary for the immediate users we have. We can always extend and
> refactor for a third user, etc, etc.
>
> So if this works for gt + children, go for it and worry about tomorrow,
> tomorrow. Trusting our good practice for "a stitch in time saves nine".
this came after Daniele's guc patches where he preferred to
define his own functions instead of using this one that is meant
to be used in that situation.
Andi
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2020-03-07 22:59 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-06 23:03 [Intel-gfx] [PATCH v4] drm/i915/gt: allow setting generic data pointer Andi Shyti
2020-03-07 2:26 ` [Intel-gfx] ✗ Fi.CI.DOCS: warning for drm/i915/gt: allow setting generic data pointer (rev4) Patchwork
2020-03-07 2:40 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2020-03-07 12:07 ` [Intel-gfx] [PATCH v4] drm/i915/gt: allow setting generic data pointer Chris Wilson
2020-03-07 12:55 ` Andi Shyti
2020-03-07 17:35 ` Chris Wilson
2020-03-07 22:19 ` Andi Shyti [this message]
2020-03-09 22:05 ` Daniele Ceraolo Spurio
2020-03-09 22:38 ` Andi Shyti
2020-03-09 23:11 ` Daniele Ceraolo Spurio
2020-03-11 8:24 ` Andi Shyti
2020-03-12 0:37 ` Daniele Ceraolo Spurio
2020-03-07 21:10 ` [Intel-gfx] ✓ Fi.CI.IGT: success for drm/i915/gt: allow setting generic data pointer (rev4) Patchwork
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200307221955.GA60782@jack.zhora.eu \
--to=andi@etezian.org \
--cc=chris@chris-wilson.co.uk \
--cc=intel-gfx@lists.freedesktop.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.