All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andi Shyti <andi.shyti@intel.com>
To: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [Intel-gfx] [PATCH 5/6] drm/i915/uc: Move uC debugfs to its own folder under GT
Date: Thu, 5 Mar 2020 20:02:46 +0200	[thread overview]
Message-ID: <20200305180246.GA21851@intel.intel> (raw)
In-Reply-To: <86c2cff6-eff6-6ff9-3774-ca8d7771c3dd@intel.com>

Hi Daniele,

> > On Thu, Feb 27, 2020 at 06:28:42PM -0800, Daniele Ceraolo Spurio wrote:
> > > uC is a component of the GT, so it makes sense for the uC debugfs files
> > > to be in the GT folder. A subfolder has been used to keep the same
> > > structure we have for the code.
> > 
> > Can we please document the interface changes. I see there are
> > some differences between the original and the new interfaces.
> > 
> 
> What differences are you referring to? there aren't supposed to be any,
> aside from the path change.

Have I seen it wrong or there are new files in this patch?
In any case, maybe we need to have the new structure.

> > > +#define DEFINE_UC_DEBUGFS_ATTRIBUTE(__name)				\
> > > +	static int __name ## _open(struct inode *inode, struct file *file) \
> > > +{									\
> > > +	return single_open(file, __name ## _show, inode->i_private);	\
> > > +}									\
> > > +static const struct file_operations __name ## _fops = {			\
> > > +	.owner = THIS_MODULE,						\
> > > +	.open = __name ## _open,					\
> > > +	.read = seq_read,						\
> > > +	.llseek = seq_lseek,						\
> > > +	.release = single_release,					\
> > > +}
> > 
> > Why do we need DEFINE_UC_DEBUGFS_ATTRIBUTE()?
> > 
> > DEFINE_GT_DEBUGFS_ATTRIBUTE() was meant to be common to all gt
> > debugfs. I there any reason we need a new one?
> > 
> 
> Just wanted to avoid including the other header just for this macro.

well that was supposed to be a library for all the gem/debugfs
files and avoid duplicated code, I don't see anything wrong with
including the file.

> > > +struct debugfs_uc_file {
> > > +	const char *name;
> > > +	const struct file_operations *fops;
> > > +};
> > > +
> > > +#define debugfs_uc_register_files(files__, root__, data__) \
> > > +do { \
> > > +	int i__ = 0; \
> > > +	for (i__ = 0; i__ < ARRAY_SIZE(files__); i__++) { \
> > > +		debugfs_create_file(files__[i__].name, \
> > > +				    0444, root__, data__, \
> > > +				    files__[i__].fops); \
> > > +	} \
> > > +} while (0)
> > 
> > You want to define your own debugfs_uc_register_files() instead
> > of using debugfs_gt_register_files() because you want "data__"
> > to be void, right?
> > 
> > I think we can achieve that by adding a wrapper in debugfs_gt.c,
> > perhaps we can do something like:
> > 
> > void __debugfs_gt_register_files(struct intel_gt *gt,
> >                                   struct dentry *root,
> >                                   const struct debugfs_gt_file *files,
> >                                   void *data,
> >                                   unsigned long count)
> > {
> >        ......
> > }
> > 
> > and
> > 
> > #define debugfs_gt_register_files(...) __debugfs_gt_register_files(...)
> > #define debugfs_uc_register_files(...) __debugfs_gt_register_files(...)
> > 
> > so that we can keep everything in a library. What do you think.
> > 
> 
> LGTM. Mind if I rename to:
> 
> intel_gt_debugfs_register(...)
> intel_uc_debugfs_register(...)
> 
> to avoid the debugfs_* prefix, as pointed out by Jani?

I have a patch for it, can you please hold a little, unless, of
course, yours is already ready.

Obvously, the naming you propose makes sense.

Andi
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2020-03-05 18:02 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-28  2:28 [Intel-gfx] [PATCH 0/6] Re-org uC debugfs files and move them under GT Daniele Ceraolo Spurio
2020-02-28  2:28 ` [Intel-gfx] [PATCH 1/6] drm/i915/guc: drop stage_pool debugfs Daniele Ceraolo Spurio
2020-02-28  2:28 ` [Intel-gfx] [PATCH 2/6] drm/i915/uc: mark structure passed to checker functions as const Daniele Ceraolo Spurio
2020-02-28  9:18   ` Jani Nikula
2020-02-29  0:20     ` Daniele Ceraolo Spurio
2020-03-04  9:56       ` Jani Nikula
2020-02-28  2:28 ` [Intel-gfx] [PATCH 3/6] drm/i915/huc: make "support huc" reflect HW capabilities Daniele Ceraolo Spurio
2020-02-28  2:28 ` [Intel-gfx] [PATCH 4/6] drm/i915/debugfs: move uC printers and update debugfs file names Daniele Ceraolo Spurio
     [not found]   ` <be6dd380-e87b-9ac7-0185-c3c46e40240b@intel.com>
2020-03-11 23:38     ` Daniele Ceraolo Spurio
2020-02-28  2:28 ` [Intel-gfx] [PATCH 5/6] drm/i915/uc: Move uC debugfs to its own folder under GT Daniele Ceraolo Spurio
2020-02-28  9:24   ` Jani Nikula
2020-03-03  1:52   ` Andi Shyti
2020-03-03 22:13     ` Daniele Ceraolo Spurio
2020-03-05 18:02       ` Andi Shyti [this message]
2020-03-05 23:10         ` Daniele Ceraolo Spurio
2020-02-28  2:28 ` [Intel-gfx] [PATCH 6/6] drm/i915/uc: do not free err log on uc_fini Daniele Ceraolo Spurio
2020-02-28  5:54 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for Re-org uC debugfs files and move them under GT Patchwork
2020-02-28  5:58 ` [Intel-gfx] ✗ Fi.CI.SPARSE: " Patchwork
2020-02-28  6:20 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2020-02-29 16:42 ` [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=20200305180246.GA21851@intel.intel \
    --to=andi.shyti@intel.com \
    --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.