Message ID | 20210909004941.379035-3-lucas.demarchi@intel.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | [1/4] drm/i915: rename debugfs_gt files | expand |
On Wed, Sep 08, 2021 at 05:49:40PM -0700, Lucas De Marchi wrote: >We shouldn't be using debugfs_ namespace for this functionality. Rename >debugfs_gt_pm.[ch] to intel_gt_pm_debugfs.[ch] and then make >functions, defines and structs follow suit. > >Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com> >--- > drivers/gpu/drm/i915/Makefile | 2 +- > drivers/gpu/drm/i915/gt/debugfs_gt_pm.h | 14 -------------- > drivers/gpu/drm/i915/gt/intel_gt_debugfs.c | 4 ++-- > .../gt/{debugfs_gt_pm.c => intel_gt_pm_debugfs.c} | 4 ++-- > drivers/gpu/drm/i915/gt/intel_gt_pm_debugfs.h | 14 ++++++++++++++ > 5 files changed, 19 insertions(+), 19 deletions(-) > delete mode 100644 drivers/gpu/drm/i915/gt/debugfs_gt_pm.h > rename drivers/gpu/drm/i915/gt/{debugfs_gt_pm.c => intel_gt_pm_debugfs.c} (99%) > create mode 100644 drivers/gpu/drm/i915/gt/intel_gt_pm_debugfs.h > >diff --git a/drivers/gpu/drm/i915/Makefile b/drivers/gpu/drm/i915/Makefile >index 232c9673a2e5..dd656f2d7721 100644 >--- a/drivers/gpu/drm/i915/Makefile >+++ b/drivers/gpu/drm/i915/Makefile >@@ -79,7 +79,6 @@ i915-$(CONFIG_PERF_EVENTS) += i915_pmu.o > > # "Graphics Technology" (aka we talk to the gpu) > gt-y += \ >- gt/debugfs_gt_pm.o \ > gt/gen2_engine_cs.o \ > gt/gen6_engine_cs.o \ > gt/gen6_ppgtt.o \ >@@ -103,6 +102,7 @@ gt-y += \ > gt/intel_gt_engines_debugfs.o \ > gt/intel_gt_irq.o \ > gt/intel_gt_pm.o \ >+ gt/intel_gt_pm_debugfs.o \ > gt/intel_gt_pm_irq.o \ > gt/intel_gt_requests.o \ > gt/intel_gtt.o \ >diff --git a/drivers/gpu/drm/i915/gt/debugfs_gt_pm.h b/drivers/gpu/drm/i915/gt/debugfs_gt_pm.h >deleted file mode 100644 >index 4cf5f5c9da7d..000000000000 >--- a/drivers/gpu/drm/i915/gt/debugfs_gt_pm.h >+++ /dev/null >@@ -1,14 +0,0 @@ >-/* SPDX-License-Identifier: MIT */ >-/* >- * Copyright © 2019 Intel Corporation >- */ >- >-#ifndef DEBUGFS_GT_PM_H >-#define DEBUGFS_GT_PM_H >- >-struct intel_gt; >-struct dentry; >- >-void debugfs_gt_pm_register(struct intel_gt *gt, struct dentry *root); >- >-#endif /* DEBUGFS_GT_PM_H */ >diff --git a/drivers/gpu/drm/i915/gt/intel_gt_debugfs.c b/drivers/gpu/drm/i915/gt/intel_gt_debugfs.c >index e5d173c235a3..4096ee893b69 100644 >--- a/drivers/gpu/drm/i915/gt/intel_gt_debugfs.c >+++ b/drivers/gpu/drm/i915/gt/intel_gt_debugfs.c >@@ -5,10 +5,10 @@ > > #include <linux/debugfs.h> > >-#include "debugfs_gt_pm.h" > #include "i915_drv.h" > #include "intel_gt_debugfs.h" > #include "intel_gt_engines_debugfs.h" >+#include "intel_gt_pm_debugfs.h" > #include "intel_sseu_debugfs.h" > #include "uc/intel_uc_debugfs.h" > >@@ -24,7 +24,7 @@ void intel_gt_register_debugfs(struct intel_gt *gt) > return; > > intel_gt_engines_register_debugfs(gt, root); >- debugfs_gt_pm_register(gt, root); >+ intel_gt_pm_register_debugfs(gt, root); This is one case I usually don't know what convention to follow since it changes in different places. I did it like xxxx_register_debugfs because of calls like intel_gt_init_scratch(), xxx_init_hw, etc. However here I see that just below we have intel_sseu_debugfs_register(), so maybe I should consider debugfs as part of the namespace? Lucas De Marchi
On Fri, 2021-09-10 at 10:52 -0700, Lucas De Marchi wrote: > On Wed, Sep 08, 2021 at 05:49:40PM -0700, Lucas De Marchi wrote: > > We shouldn't be using debugfs_ namespace for this functionality. > > Rename > > debugfs_gt_pm.[ch] to intel_gt_pm_debugfs.[ch] and then make > > functions, defines and structs follow suit. > > > > Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com> > > --- > > drivers/gpu/drm/i915/Makefile | 2 +- > > drivers/gpu/drm/i915/gt/debugfs_gt_pm.h | 14 --------- > > ----- > > drivers/gpu/drm/i915/gt/intel_gt_debugfs.c | 4 ++-- > > .../gt/{debugfs_gt_pm.c => intel_gt_pm_debugfs.c} | 4 ++-- > > drivers/gpu/drm/i915/gt/intel_gt_pm_debugfs.h | 14 > > ++++++++++++++ > > 5 files changed, 19 insertions(+), 19 deletions(-) > > delete mode 100644 drivers/gpu/drm/i915/gt/debugfs_gt_pm.h > > rename drivers/gpu/drm/i915/gt/{debugfs_gt_pm.c => > > intel_gt_pm_debugfs.c} (99%) > > create mode 100644 drivers/gpu/drm/i915/gt/intel_gt_pm_debugfs.h > > > > diff --git a/drivers/gpu/drm/i915/Makefile > > b/drivers/gpu/drm/i915/Makefile > > index 232c9673a2e5..dd656f2d7721 100644 > > --- a/drivers/gpu/drm/i915/Makefile > > +++ b/drivers/gpu/drm/i915/Makefile > > @@ -79,7 +79,6 @@ i915-$(CONFIG_PERF_EVENTS) += i915_pmu.o > > > > # "Graphics Technology" (aka we talk to the gpu) > > gt-y += \ > > - gt/debugfs_gt_pm.o \ > > gt/gen2_engine_cs.o \ > > gt/gen6_engine_cs.o \ > > gt/gen6_ppgtt.o \ > > @@ -103,6 +102,7 @@ gt-y += \ > > gt/intel_gt_engines_debugfs.o \ > > gt/intel_gt_irq.o \ > > gt/intel_gt_pm.o \ > > + gt/intel_gt_pm_debugfs.o \ > > gt/intel_gt_pm_irq.o \ > > gt/intel_gt_requests.o \ > > gt/intel_gtt.o \ > > diff --git a/drivers/gpu/drm/i915/gt/debugfs_gt_pm.h > > b/drivers/gpu/drm/i915/gt/debugfs_gt_pm.h > > deleted file mode 100644 > > index 4cf5f5c9da7d..000000000000 > > --- a/drivers/gpu/drm/i915/gt/debugfs_gt_pm.h > > +++ /dev/null > > @@ -1,14 +0,0 @@ > > -/* SPDX-License-Identifier: MIT */ > > -/* > > - * Copyright © 2019 Intel Corporation > > - */ > > - > > -#ifndef DEBUGFS_GT_PM_H > > -#define DEBUGFS_GT_PM_H > > - > > -struct intel_gt; > > -struct dentry; > > - > > -void debugfs_gt_pm_register(struct intel_gt *gt, struct dentry > > *root); > > - > > -#endif /* DEBUGFS_GT_PM_H */ > > diff --git a/drivers/gpu/drm/i915/gt/intel_gt_debugfs.c > > b/drivers/gpu/drm/i915/gt/intel_gt_debugfs.c > > index e5d173c235a3..4096ee893b69 100644 > > --- a/drivers/gpu/drm/i915/gt/intel_gt_debugfs.c > > +++ b/drivers/gpu/drm/i915/gt/intel_gt_debugfs.c > > @@ -5,10 +5,10 @@ > > > > #include <linux/debugfs.h> > > > > -#include "debugfs_gt_pm.h" > > #include "i915_drv.h" > > #include "intel_gt_debugfs.h" > > #include "intel_gt_engines_debugfs.h" > > +#include "intel_gt_pm_debugfs.h" Why locate here? Why not just replace debugfs_gt_pm.h? Compile error? -caz > > #include "intel_sseu_debugfs.h" > > #include "uc/intel_uc_debugfs.h" > > > > @@ -24,7 +24,7 @@ void intel_gt_register_debugfs(struct intel_gt > > *gt) > > return; > > > > intel_gt_engines_register_debugfs(gt, root); > > - debugfs_gt_pm_register(gt, root); > > + intel_gt_pm_register_debugfs(gt, root); > > This is one case I usually don't know what convention to follow since > it > changes in different places. > > I did it like xxxx_register_debugfs because of calls like > intel_gt_init_scratch(), xxx_init_hw, etc. However here I see that > just > below we have intel_sseu_debugfs_register(), so maybe I should > consider > debugfs as part of the namespace? > > Lucas De Marchi
On Fri, Sep 10, 2021 at 09:14:37PM +0000, Yokoyama, Caz wrote: >On Fri, 2021-09-10 at 10:52 -0700, Lucas De Marchi wrote: >> On Wed, Sep 08, 2021 at 05:49:40PM -0700, Lucas De Marchi wrote: >> > We shouldn't be using debugfs_ namespace for this functionality. >> > Rename >> > debugfs_gt_pm.[ch] to intel_gt_pm_debugfs.[ch] and then make >> > functions, defines and structs follow suit. >> > >> > Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com> >> > --- >> > drivers/gpu/drm/i915/Makefile | 2 +- >> > drivers/gpu/drm/i915/gt/debugfs_gt_pm.h | 14 --------- >> > ----- >> > drivers/gpu/drm/i915/gt/intel_gt_debugfs.c | 4 ++-- >> > .../gt/{debugfs_gt_pm.c => intel_gt_pm_debugfs.c} | 4 ++-- >> > drivers/gpu/drm/i915/gt/intel_gt_pm_debugfs.h | 14 >> > ++++++++++++++ >> > 5 files changed, 19 insertions(+), 19 deletions(-) >> > delete mode 100644 drivers/gpu/drm/i915/gt/debugfs_gt_pm.h >> > rename drivers/gpu/drm/i915/gt/{debugfs_gt_pm.c => >> > intel_gt_pm_debugfs.c} (99%) >> > create mode 100644 drivers/gpu/drm/i915/gt/intel_gt_pm_debugfs.h >> > >> > diff --git a/drivers/gpu/drm/i915/Makefile >> > b/drivers/gpu/drm/i915/Makefile >> > index 232c9673a2e5..dd656f2d7721 100644 >> > --- a/drivers/gpu/drm/i915/Makefile >> > +++ b/drivers/gpu/drm/i915/Makefile >> > @@ -79,7 +79,6 @@ i915-$(CONFIG_PERF_EVENTS) += i915_pmu.o >> > >> > # "Graphics Technology" (aka we talk to the gpu) >> > gt-y += \ >> > - gt/debugfs_gt_pm.o \ >> > gt/gen2_engine_cs.o \ >> > gt/gen6_engine_cs.o \ >> > gt/gen6_ppgtt.o \ >> > @@ -103,6 +102,7 @@ gt-y += \ >> > gt/intel_gt_engines_debugfs.o \ >> > gt/intel_gt_irq.o \ >> > gt/intel_gt_pm.o \ >> > + gt/intel_gt_pm_debugfs.o \ >> > gt/intel_gt_pm_irq.o \ >> > gt/intel_gt_requests.o \ >> > gt/intel_gtt.o \ >> > diff --git a/drivers/gpu/drm/i915/gt/debugfs_gt_pm.h >> > b/drivers/gpu/drm/i915/gt/debugfs_gt_pm.h >> > deleted file mode 100644 >> > index 4cf5f5c9da7d..000000000000 >> > --- a/drivers/gpu/drm/i915/gt/debugfs_gt_pm.h >> > +++ /dev/null >> > @@ -1,14 +0,0 @@ >> > -/* SPDX-License-Identifier: MIT */ >> > -/* >> > - * Copyright © 2019 Intel Corporation >> > - */ >> > - >> > -#ifndef DEBUGFS_GT_PM_H >> > -#define DEBUGFS_GT_PM_H >> > - >> > -struct intel_gt; >> > -struct dentry; >> > - >> > -void debugfs_gt_pm_register(struct intel_gt *gt, struct dentry >> > *root); >> > - >> > -#endif /* DEBUGFS_GT_PM_H */ >> > diff --git a/drivers/gpu/drm/i915/gt/intel_gt_debugfs.c >> > b/drivers/gpu/drm/i915/gt/intel_gt_debugfs.c >> > index e5d173c235a3..4096ee893b69 100644 >> > --- a/drivers/gpu/drm/i915/gt/intel_gt_debugfs.c >> > +++ b/drivers/gpu/drm/i915/gt/intel_gt_debugfs.c >> > @@ -5,10 +5,10 @@ >> > >> > #include <linux/debugfs.h> >> > >> > -#include "debugfs_gt_pm.h" >> > #include "i915_drv.h" >> > #include "intel_gt_debugfs.h" >> > #include "intel_gt_engines_debugfs.h" >> > +#include "intel_gt_pm_debugfs.h" >Why locate here? Why not just replace debugfs_gt_pm.h? Compile error? are you asking why I moved the include? Because sorting them alphabetically avoid big messes in these includes Lucas De Marchi >-caz > >> > #include "intel_sseu_debugfs.h" >> > #include "uc/intel_uc_debugfs.h" >> > >> > @@ -24,7 +24,7 @@ void intel_gt_register_debugfs(struct intel_gt >> > *gt) >> > return; >> > >> > intel_gt_engines_register_debugfs(gt, root); >> > - debugfs_gt_pm_register(gt, root); >> > + intel_gt_pm_register_debugfs(gt, root); >> >> This is one case I usually don't know what convention to follow since >> it >> changes in different places. >> >> I did it like xxxx_register_debugfs because of calls like >> intel_gt_init_scratch(), xxx_init_hw, etc. However here I see that >> just >> below we have intel_sseu_debugfs_register(), so maybe I should >> consider >> debugfs as part of the namespace? >> >> Lucas De Marchi
On Fri, 2021-09-10 at 14:52 -0700, Lucas De Marchi wrote: > On Fri, Sep 10, 2021 at 09:14:37PM +0000, Yokoyama, Caz wrote: > > On Fri, 2021-09-10 at 10:52 -0700, Lucas De Marchi wrote: > > > On Wed, Sep 08, 2021 at 05:49:40PM -0700, Lucas De Marchi wrote: > > > > We shouldn't be using debugfs_ namespace for this > > > > functionality. > > > > Rename > > > > debugfs_gt_pm.[ch] to intel_gt_pm_debugfs.[ch] and then make > > > > functions, defines and structs follow suit. > > > > > > > > Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com> > > > > --- > > > > drivers/gpu/drm/i915/Makefile | 2 +- > > > > drivers/gpu/drm/i915/gt/debugfs_gt_pm.h | 14 ----- > > > > ---- > > > > ----- > > > > drivers/gpu/drm/i915/gt/intel_gt_debugfs.c | 4 ++-- > > > > .../gt/{debugfs_gt_pm.c => intel_gt_pm_debugfs.c} | 4 ++-- > > > > drivers/gpu/drm/i915/gt/intel_gt_pm_debugfs.h | 14 > > > > ++++++++++++++ > > > > 5 files changed, 19 insertions(+), 19 deletions(-) > > > > delete mode 100644 drivers/gpu/drm/i915/gt/debugfs_gt_pm.h > > > > rename drivers/gpu/drm/i915/gt/{debugfs_gt_pm.c => > > > > intel_gt_pm_debugfs.c} (99%) > > > > create mode 100644 > > > > drivers/gpu/drm/i915/gt/intel_gt_pm_debugfs.h > > > > > > > > diff --git a/drivers/gpu/drm/i915/Makefile > > > > b/drivers/gpu/drm/i915/Makefile > > > > index 232c9673a2e5..dd656f2d7721 100644 > > > > --- a/drivers/gpu/drm/i915/Makefile > > > > +++ b/drivers/gpu/drm/i915/Makefile > > > > @@ -79,7 +79,6 @@ i915-$(CONFIG_PERF_EVENTS) += i915_pmu.o > > > > > > > > # "Graphics Technology" (aka we talk to the gpu) > > > > gt-y += \ > > > > - gt/debugfs_gt_pm.o \ > > > > gt/gen2_engine_cs.o \ > > > > gt/gen6_engine_cs.o \ > > > > gt/gen6_ppgtt.o \ > > > > @@ -103,6 +102,7 @@ gt-y += \ > > > > gt/intel_gt_engines_debugfs.o \ > > > > gt/intel_gt_irq.o \ > > > > gt/intel_gt_pm.o \ > > > > + gt/intel_gt_pm_debugfs.o \ > > > > gt/intel_gt_pm_irq.o \ > > > > gt/intel_gt_requests.o \ > > > > gt/intel_gtt.o \ > > > > diff --git a/drivers/gpu/drm/i915/gt/debugfs_gt_pm.h > > > > b/drivers/gpu/drm/i915/gt/debugfs_gt_pm.h > > > > deleted file mode 100644 > > > > index 4cf5f5c9da7d..000000000000 > > > > --- a/drivers/gpu/drm/i915/gt/debugfs_gt_pm.h > > > > +++ /dev/null > > > > @@ -1,14 +0,0 @@ > > > > -/* SPDX-License-Identifier: MIT */ > > > > -/* > > > > - * Copyright © 2019 Intel Corporation > > > > - */ > > > > - > > > > -#ifndef DEBUGFS_GT_PM_H > > > > -#define DEBUGFS_GT_PM_H > > > > - > > > > -struct intel_gt; > > > > -struct dentry; > > > > - > > > > -void debugfs_gt_pm_register(struct intel_gt *gt, struct dentry > > > > *root); > > > > - > > > > -#endif /* DEBUGFS_GT_PM_H */ > > > > diff --git a/drivers/gpu/drm/i915/gt/intel_gt_debugfs.c > > > > b/drivers/gpu/drm/i915/gt/intel_gt_debugfs.c > > > > index e5d173c235a3..4096ee893b69 100644 > > > > --- a/drivers/gpu/drm/i915/gt/intel_gt_debugfs.c > > > > +++ b/drivers/gpu/drm/i915/gt/intel_gt_debugfs.c > > > > @@ -5,10 +5,10 @@ > > > > > > > > #include <linux/debugfs.h> > > > > > > > > -#include "debugfs_gt_pm.h" > > > > #include "i915_drv.h" > > > > #include "intel_gt_debugfs.h" > > > > #include "intel_gt_engines_debugfs.h" > > > > +#include "intel_gt_pm_debugfs.h" > > Why locate here? Why not just replace debugfs_gt_pm.h? Compile > > error? > > are you asking why I moved the include? Because sorting them > alphabetically avoid big messes in these includes As the patch, it is easy to see if - and + lines are side by side. Anyway, I honor and respect your decision. -caz > > Lucas De Marchi > > > -caz > > > > > > #include "intel_sseu_debugfs.h" > > > > #include "uc/intel_uc_debugfs.h" > > > > > > > > @@ -24,7 +24,7 @@ void intel_gt_register_debugfs(struct > > > > intel_gt > > > > *gt) > > > > return; > > > > > > > > intel_gt_engines_register_debugfs(gt, root); > > > > - debugfs_gt_pm_register(gt, root); > > > > + intel_gt_pm_register_debugfs(gt, root); > > > > > > This is one case I usually don't know what convention to follow > > > since > > > it > > > changes in different places. > > > > > > I did it like xxxx_register_debugfs because of calls like > > > intel_gt_init_scratch(), xxx_init_hw, etc. However here I see > > > that > > > just > > > below we have intel_sseu_debugfs_register(), so maybe I should > > > consider > > > debugfs as part of the namespace? > > > > > > Lucas De Marchi
On Fri, Sep 10, 2021 at 10:52:57AM -0700, Lucas De Marchi wrote: > On Wed, Sep 08, 2021 at 05:49:40PM -0700, Lucas De Marchi wrote: > > We shouldn't be using debugfs_ namespace for this functionality. Rename > > debugfs_gt_pm.[ch] to intel_gt_pm_debugfs.[ch] and then make > > functions, defines and structs follow suit. > > > > Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com> > > --- > > drivers/gpu/drm/i915/Makefile | 2 +- > > drivers/gpu/drm/i915/gt/debugfs_gt_pm.h | 14 -------------- > > drivers/gpu/drm/i915/gt/intel_gt_debugfs.c | 4 ++-- > > .../gt/{debugfs_gt_pm.c => intel_gt_pm_debugfs.c} | 4 ++-- > > drivers/gpu/drm/i915/gt/intel_gt_pm_debugfs.h | 14 ++++++++++++++ > > 5 files changed, 19 insertions(+), 19 deletions(-) > > delete mode 100644 drivers/gpu/drm/i915/gt/debugfs_gt_pm.h > > rename drivers/gpu/drm/i915/gt/{debugfs_gt_pm.c => intel_gt_pm_debugfs.c} (99%) > > create mode 100644 drivers/gpu/drm/i915/gt/intel_gt_pm_debugfs.h > > > > diff --git a/drivers/gpu/drm/i915/Makefile b/drivers/gpu/drm/i915/Makefile > > index 232c9673a2e5..dd656f2d7721 100644 > > --- a/drivers/gpu/drm/i915/Makefile > > +++ b/drivers/gpu/drm/i915/Makefile > > @@ -79,7 +79,6 @@ i915-$(CONFIG_PERF_EVENTS) += i915_pmu.o > > > > # "Graphics Technology" (aka we talk to the gpu) > > gt-y += \ > > - gt/debugfs_gt_pm.o \ > > gt/gen2_engine_cs.o \ > > gt/gen6_engine_cs.o \ > > gt/gen6_ppgtt.o \ > > @@ -103,6 +102,7 @@ gt-y += \ > > gt/intel_gt_engines_debugfs.o \ > > gt/intel_gt_irq.o \ > > gt/intel_gt_pm.o \ > > + gt/intel_gt_pm_debugfs.o \ > > gt/intel_gt_pm_irq.o \ > > gt/intel_gt_requests.o \ > > gt/intel_gtt.o \ > > diff --git a/drivers/gpu/drm/i915/gt/debugfs_gt_pm.h b/drivers/gpu/drm/i915/gt/debugfs_gt_pm.h > > deleted file mode 100644 > > index 4cf5f5c9da7d..000000000000 > > --- a/drivers/gpu/drm/i915/gt/debugfs_gt_pm.h > > +++ /dev/null > > @@ -1,14 +0,0 @@ > > -/* SPDX-License-Identifier: MIT */ > > -/* > > - * Copyright © 2019 Intel Corporation > > - */ > > - > > -#ifndef DEBUGFS_GT_PM_H > > -#define DEBUGFS_GT_PM_H > > - > > -struct intel_gt; > > -struct dentry; > > - > > -void debugfs_gt_pm_register(struct intel_gt *gt, struct dentry *root); > > - > > -#endif /* DEBUGFS_GT_PM_H */ > > diff --git a/drivers/gpu/drm/i915/gt/intel_gt_debugfs.c b/drivers/gpu/drm/i915/gt/intel_gt_debugfs.c > > index e5d173c235a3..4096ee893b69 100644 > > --- a/drivers/gpu/drm/i915/gt/intel_gt_debugfs.c > > +++ b/drivers/gpu/drm/i915/gt/intel_gt_debugfs.c > > @@ -5,10 +5,10 @@ > > > > #include <linux/debugfs.h> > > > > -#include "debugfs_gt_pm.h" > > #include "i915_drv.h" > > #include "intel_gt_debugfs.h" > > #include "intel_gt_engines_debugfs.h" > > +#include "intel_gt_pm_debugfs.h" > > #include "intel_sseu_debugfs.h" > > #include "uc/intel_uc_debugfs.h" > > > > @@ -24,7 +24,7 @@ void intel_gt_register_debugfs(struct intel_gt *gt) > > return; > > > > intel_gt_engines_register_debugfs(gt, root); > > - debugfs_gt_pm_register(gt, root); > > + intel_gt_pm_register_debugfs(gt, root); > > This is one case I usually don't know what convention to follow since it > changes in different places. > > I did it like xxxx_register_debugfs because of calls like > intel_gt_init_scratch(), xxx_init_hw, etc. However here I see that just > below we have intel_sseu_debugfs_register(), so maybe I should consider > debugfs as part of the namespace? I like *_debugfs_register slightly better than *_register_debugfs because to me we're not registering debugfs itself, we're performing debugfs' register operation on some files. But I don't really have a strong feeling either way. Whichever way you decide, Reviewed-by: Matt Roper <matthew.d.roper@intel.com> for the series. Matt > > Lucas De Marchi
diff --git a/drivers/gpu/drm/i915/Makefile b/drivers/gpu/drm/i915/Makefile index 232c9673a2e5..dd656f2d7721 100644 --- a/drivers/gpu/drm/i915/Makefile +++ b/drivers/gpu/drm/i915/Makefile @@ -79,7 +79,6 @@ i915-$(CONFIG_PERF_EVENTS) += i915_pmu.o # "Graphics Technology" (aka we talk to the gpu) gt-y += \ - gt/debugfs_gt_pm.o \ gt/gen2_engine_cs.o \ gt/gen6_engine_cs.o \ gt/gen6_ppgtt.o \ @@ -103,6 +102,7 @@ gt-y += \ gt/intel_gt_engines_debugfs.o \ gt/intel_gt_irq.o \ gt/intel_gt_pm.o \ + gt/intel_gt_pm_debugfs.o \ gt/intel_gt_pm_irq.o \ gt/intel_gt_requests.o \ gt/intel_gtt.o \ diff --git a/drivers/gpu/drm/i915/gt/debugfs_gt_pm.h b/drivers/gpu/drm/i915/gt/debugfs_gt_pm.h deleted file mode 100644 index 4cf5f5c9da7d..000000000000 --- a/drivers/gpu/drm/i915/gt/debugfs_gt_pm.h +++ /dev/null @@ -1,14 +0,0 @@ -/* SPDX-License-Identifier: MIT */ -/* - * Copyright © 2019 Intel Corporation - */ - -#ifndef DEBUGFS_GT_PM_H -#define DEBUGFS_GT_PM_H - -struct intel_gt; -struct dentry; - -void debugfs_gt_pm_register(struct intel_gt *gt, struct dentry *root); - -#endif /* DEBUGFS_GT_PM_H */ diff --git a/drivers/gpu/drm/i915/gt/intel_gt_debugfs.c b/drivers/gpu/drm/i915/gt/intel_gt_debugfs.c index e5d173c235a3..4096ee893b69 100644 --- a/drivers/gpu/drm/i915/gt/intel_gt_debugfs.c +++ b/drivers/gpu/drm/i915/gt/intel_gt_debugfs.c @@ -5,10 +5,10 @@ #include <linux/debugfs.h> -#include "debugfs_gt_pm.h" #include "i915_drv.h" #include "intel_gt_debugfs.h" #include "intel_gt_engines_debugfs.h" +#include "intel_gt_pm_debugfs.h" #include "intel_sseu_debugfs.h" #include "uc/intel_uc_debugfs.h" @@ -24,7 +24,7 @@ void intel_gt_register_debugfs(struct intel_gt *gt) return; intel_gt_engines_register_debugfs(gt, root); - debugfs_gt_pm_register(gt, root); + intel_gt_pm_register_debugfs(gt, root); intel_sseu_debugfs_register(gt, root); intel_uc_debugfs_register(>->uc, root); diff --git a/drivers/gpu/drm/i915/gt/debugfs_gt_pm.c b/drivers/gpu/drm/i915/gt/intel_gt_pm_debugfs.c similarity index 99% rename from drivers/gpu/drm/i915/gt/debugfs_gt_pm.c rename to drivers/gpu/drm/i915/gt/intel_gt_pm_debugfs.c index 9222cf68c56c..baca153c05dd 100644 --- a/drivers/gpu/drm/i915/gt/debugfs_gt_pm.c +++ b/drivers/gpu/drm/i915/gt/intel_gt_pm_debugfs.c @@ -6,12 +6,12 @@ #include <linux/seq_file.h> -#include "debugfs_gt_pm.h" #include "i915_drv.h" #include "intel_gt.h" #include "intel_gt_clock_utils.h" #include "intel_gt_debugfs.h" #include "intel_gt_pm.h" +#include "intel_gt_pm_debugfs.h" #include "intel_llc.h" #include "intel_rc6.h" #include "intel_rps.h" @@ -614,7 +614,7 @@ static bool rps_eval(void *data) DEFINE_INTEL_GT_DEBUGFS_ATTRIBUTE(rps_boost); -void debugfs_gt_pm_register(struct intel_gt *gt, struct dentry *root) +void intel_gt_pm_register_debugfs(struct intel_gt *gt, struct dentry *root) { static const struct intel_gt_debugfs_file files[] = { { "drpc", &drpc_fops, NULL }, diff --git a/drivers/gpu/drm/i915/gt/intel_gt_pm_debugfs.h b/drivers/gpu/drm/i915/gt/intel_gt_pm_debugfs.h new file mode 100644 index 000000000000..f44894579604 --- /dev/null +++ b/drivers/gpu/drm/i915/gt/intel_gt_pm_debugfs.h @@ -0,0 +1,14 @@ +/* SPDX-License-Identifier: MIT */ +/* + * Copyright © 2019 Intel Corporation + */ + +#ifndef INTEL_GT_PM_DEBUGFS_H +#define INTEL_GT_PM_DEBUGFS_H + +struct intel_gt; +struct dentry; + +void intel_gt_pm_register_debugfs(struct intel_gt *gt, struct dentry *root); + +#endif /* INTEL_GT_PM_DEBUGFS_H */
We shouldn't be using debugfs_ namespace for this functionality. Rename debugfs_gt_pm.[ch] to intel_gt_pm_debugfs.[ch] and then make functions, defines and structs follow suit. Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com> --- drivers/gpu/drm/i915/Makefile | 2 +- drivers/gpu/drm/i915/gt/debugfs_gt_pm.h | 14 -------------- drivers/gpu/drm/i915/gt/intel_gt_debugfs.c | 4 ++-- .../gt/{debugfs_gt_pm.c => intel_gt_pm_debugfs.c} | 4 ++-- drivers/gpu/drm/i915/gt/intel_gt_pm_debugfs.h | 14 ++++++++++++++ 5 files changed, 19 insertions(+), 19 deletions(-) delete mode 100644 drivers/gpu/drm/i915/gt/debugfs_gt_pm.h rename drivers/gpu/drm/i915/gt/{debugfs_gt_pm.c => intel_gt_pm_debugfs.c} (99%) create mode 100644 drivers/gpu/drm/i915/gt/intel_gt_pm_debugfs.h