From: Andi Shyti <andi@etezian.org>
To: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
Cc: Intel GFX <intel-gfx@lists.freedesktop.org>
Subject: Re: [Intel-gfx] [PATCH] drm/i915/gt: allow setting generic data pointer
Date: Fri, 6 Mar 2020 12:47:58 +0200 [thread overview]
Message-ID: <20200306104758.GA46547@jack.zhora.eu> (raw)
In-Reply-To: <40bb5d31-78bb-d72c-fe58-a82150c0697f@intel.com>
Hi Daniele,
> > > > diff --git a/drivers/gpu/drm/i915/gt/debugfs_gt.c b/drivers/gpu/drm/i915/gt/debugfs_gt.c
> > > > index 75255aaacaed..9112a8585caf 100644
> > > > --- a/drivers/gpu/drm/i915/gt/debugfs_gt.c
> > > > +++ b/drivers/gpu/drm/i915/gt/debugfs_gt.c
> > > > @@ -26,15 +26,14 @@ void debugfs_gt_register(struct intel_gt *gt)
> > > > debugfs_gt_pm_register(gt, root);
> > > > }
> > > > -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 intel_gt *gt, struct dentry *root,
> > > > + const struct debugfs_gt_file *files,
> > > > + unsigned long count, void *data)
> > > > {
> > > > while (count--) {
> > > > if (!files->eval || files->eval(gt))
> > >
> > > IMO the files->eval() function should also use the provided data instead of
> > > intel_gt. This will also allow us to drop the intel_gt parameter in this
> > > function, which in turn means we can use this function directly from all the
> > > levels.
> >
> > do you mean something like this:
> >
> > - bool (*eval)(const struct intel_gt *gt);
> > + bool (*eval)(void *data);
> >
> > ?
>
> yes
>
> >
> > I am missing the use case, though, what is it that cannot be
> > reached by the gt so that it needs to be more generic?
>
> It's not a problem of reaching it from gt but the other way around, I don't
> want the caller to have to retrieve a gt variable it don't needs just to
> pass it to this function and then go back to the actual required data from
> gt inside of the eval function. Anything you need for your evaluation should
> be reachable from the struct used as data for the debugfs.
> To make a concrete example, I want to avoid an unneeded guc_to_gt inside
> intel_guc_debugfs_register that would also require a matched guc =
> >->uc.guc inside the eval function, passing guc (i.e. the data) straight
> in the eval is cleaner IMO.
Thanks for the feedback, makes sense.
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-06 10:48 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-05 23:59 [Intel-gfx] [PATCH] drm/i915/gt: allow setting generic data pointer Andi Shyti
2020-03-06 0:31 ` Daniele Ceraolo Spurio
2020-03-06 1:15 ` Andi Shyti
2020-03-06 1:27 ` Daniele Ceraolo Spurio
2020-03-06 10:47 ` Andi Shyti [this message]
2020-03-06 6:44 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for " Patchwork
2020-03-06 6:58 ` [Intel-gfx] ✗ Fi.CI.DOCS: " Patchwork
2020-03-06 7:08 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2020-03-07 0:36 ` [Intel-gfx] ✓ Fi.CI.IGT: " 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=20200306104758.GA46547@jack.zhora.eu \
--to=andi@etezian.org \
--cc=daniele.ceraolospurio@intel.com \
--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.