Re: [Intel-gfx] [PATCH v5] drm/i915/gt: move remaining debugfs interfaces into gt

2021-10-15 Thread Andi Shyti
Hi Lucas,

> > > > The following interfaces:
> > > >
> > > >  i915_wedged
> > > >  i915_forcewake_user
> > > >
> > > > are dependent on gt values. Put them inside gt/ and drop the
> > > > "i915_" prefix name. This would be the new structure:
> > > >
> > > >  dri/0/gt
> > > >  |
> > > >  +-- forcewake_user
> > > >  |
> > > >  \-- reset
> > > >
> > > > For backwards compatibility with existing igt (and the slight
> > > > semantic difference between operating on the i915 abi entry
> > > > points and the deep gt info):
> > > >
> > > >  dri/0
> > > >  |
> > > >  +-- i915_wedged
> > > >  |
> > > >  \-- i915_forcewake_user
> > > >
> > > > remain at the top level.
> > > >
> > > > Signed-off-by: Andi Shyti 
> > > > Cc: Tvrtko Ursulin 
> > > > Cc: Chris Wilson 
> > > > Reviewed-by: Lucas De Marchi 
> > > 
> > > do you want me to push this?
> > 
> > yes, please.
> 
> done, thanks.

Thanks!

> Now, about igt: eventually we need to update it to use the gt
> debugfs file. Is this something you have already or is it something
> we are waiting on multi-gt to land?

There is some work done in igt but it's all around multitile. I
think it's better to wait for the multitile to land and then
update igt.

In any case, at the current state, igt shouldn't be affected.

Thanks again,
Andi


Re: [Intel-gfx] [PATCH v5] drm/i915/gt: move remaining debugfs interfaces into gt

2021-10-14 Thread Lucas De Marchi

On Thu, Oct 14, 2021 at 02:11:34AM +0200, Andi Shyti wrote:

Hi Lucas,

On Wed, Oct 13, 2021 at 05:04:27PM -0700, Lucas De Marchi wrote:

On Wed, Oct 13, 2021 at 12:17:38AM +0200, Andi Shyti wrote:
> From: Andi Shyti 
>
> The following interfaces:
>
>  i915_wedged
>  i915_forcewake_user
>
> are dependent on gt values. Put them inside gt/ and drop the
> "i915_" prefix name. This would be the new structure:
>
>  dri/0/gt
>  |
>  +-- forcewake_user
>  |
>  \-- reset
>
> For backwards compatibility with existing igt (and the slight
> semantic difference between operating on the i915 abi entry
> points and the deep gt info):
>
>  dri/0
>  |
>  +-- i915_wedged
>  |
>  \-- i915_forcewake_user
>
> remain at the top level.
>
> Signed-off-by: Andi Shyti 
> Cc: Tvrtko Ursulin 
> Cc: Chris Wilson 
> Reviewed-by: Lucas De Marchi 

do you want me to push this?


yes, please.


done, thanks.

Now, about igt: eventually we need to update it to use the gt
debugfs file. Is this something you have already or is it something
we are waiting on multi-gt to land?

Lucas De Marchi



Thanks,
Andi


Re: [Intel-gfx] [PATCH v5] drm/i915/gt: move remaining debugfs interfaces into gt

2021-10-13 Thread Andi Shyti
Hi Lucas,

On Wed, Oct 13, 2021 at 05:04:27PM -0700, Lucas De Marchi wrote:
> On Wed, Oct 13, 2021 at 12:17:38AM +0200, Andi Shyti wrote:
> > From: Andi Shyti 
> > 
> > The following interfaces:
> > 
> >  i915_wedged
> >  i915_forcewake_user
> > 
> > are dependent on gt values. Put them inside gt/ and drop the
> > "i915_" prefix name. This would be the new structure:
> > 
> >  dri/0/gt
> >  |
> >  +-- forcewake_user
> >  |
> >  \-- reset
> > 
> > For backwards compatibility with existing igt (and the slight
> > semantic difference between operating on the i915 abi entry
> > points and the deep gt info):
> > 
> >  dri/0
> >  |
> >  +-- i915_wedged
> >  |
> >  \-- i915_forcewake_user
> > 
> > remain at the top level.
> > 
> > Signed-off-by: Andi Shyti 
> > Cc: Tvrtko Ursulin 
> > Cc: Chris Wilson 
> > Reviewed-by: Lucas De Marchi 
> 
> do you want me to push this?

yes, please.

Thanks,
Andi


Re: [Intel-gfx] [PATCH v5] drm/i915/gt: move remaining debugfs interfaces into gt

2021-10-13 Thread Lucas De Marchi

On Wed, Oct 13, 2021 at 12:17:38AM +0200, Andi Shyti wrote:

From: Andi Shyti 

The following interfaces:

 i915_wedged
 i915_forcewake_user

are dependent on gt values. Put them inside gt/ and drop the
"i915_" prefix name. This would be the new structure:

 dri/0/gt
 |
 +-- forcewake_user
 |
 \-- reset

For backwards compatibility with existing igt (and the slight
semantic difference between operating on the i915 abi entry
points and the deep gt info):

 dri/0
 |
 +-- i915_wedged
 |
 \-- i915_forcewake_user

remain at the top level.

Signed-off-by: Andi Shyti 
Cc: Tvrtko Ursulin 
Cc: Chris Wilson 
Reviewed-by: Lucas De Marchi 


do you want me to push this?

Lucas De Marchi


Re: [Intel-gfx] [PATCH v5] drm/i915/gt: move remaining debugfs interfaces into gt

2021-10-13 Thread Andi Shyti
Hi,

sorry, just forgot to add the changelog

On Wed, Oct 13, 2021 at 12:17:38AM +0200, Andi Shyti wrote:
> From: Andi Shyti 
> 
> The following interfaces:
> 
>   i915_wedged
>   i915_forcewake_user
> 
> are dependent on gt values. Put them inside gt/ and drop the
> "i915_" prefix name. This would be the new structure:
> 
>   dri/0/gt
>   |
>   +-- forcewake_user
>   |
>   \-- reset
> 
> For backwards compatibility with existing igt (and the slight
> semantic difference between operating on the i915 abi entry
> points and the deep gt info):
> 
>   dri/0
>   |
>   +-- i915_wedged
>   |
>   \-- i915_forcewake_user
> 
> remain at the top level.
> 
> Signed-off-by: Andi Shyti 
> Cc: Tvrtko Ursulin 
> Cc: Chris Wilson 
> Reviewed-by: Lucas De Marchi 
> ---

Changelog:
--
v4 -> v5: https://patchwork.freedesktop.org/patch/458293/
 * rename static functions exposed to header files so that they
   can keep a coherent namespace (thanks Lucas!)
 * add Lucas r-b.

v3 -> v4: https://patchwork.freedesktop.org/patch/458225/
 * remove the unnecessary interrupt_info_show() information. They
   were already removed here by Chris:

cf977e18610e6 ("drm/i915/gem: Spring clean debugfs")

v2 -> v3: https://patchwork.freedesktop.org/patch/458108/
 * keep the original interfaces as they were (thanks Chris) but
   implement the functionality inside the gt. The upper level
   files will call the gt functions (thanks Lucas).

v1 -> v2: https://patchwork.freedesktop.org/patch/456652/
 * keep the original interfaces intact (thanks Chris).

Andi


[Intel-gfx] [PATCH v5] drm/i915/gt: move remaining debugfs interfaces into gt

2020-04-03 Thread Andi Shyti
From: Andi Shyti 

The following interfaces:

  i915_wedged
  i915_forcewake_user
  i915_gem_interrupt
  i915_rcs_topology
  i915_sseu_status

are dependent on gt values. Put them inside gt/ and drop the
"i915_" prefix name. This would be the new structure:

  gt
  |
  +-- forcewake_user
  |
  +-- interrupt_info
  |
  +-- reset
  |
  +-- rcs_topology
  |
  +-- sseu_status

Signed-off-by: Andi Shyti 
Reviewed-by: Tvrtko Ursulin 
Reviewed-by: Chris Wilson 
---
Hi,

this patch is the first of a series that aims to refactor the
debugfs structure in the i915. Some changes will affect the
debugfs framework as well.

It has gone through a series of offline reviews mainly from
Tvrtko. Even though it hasn't been done publicly, I took the
freedom to add Tvrtko's review.

Thanks Tvrtko and Chris for the review,
Andi

Changelog
=
v5:
 - renamed from debugfs_gt_sseu.[ch] to debugfs_sseu.[ch]
 - moved i915_rcs_topology from i915_debugfs.c to
   gt/debugfs_sseu.c
 - added Tvrtko's and Chris r-b.
v4:
 - interrupt and sseu debugfs interface are moved to their own
   "debugfs_gt_irq" and "debugfs_gt_sseu" files
 - reset functions are renamed to reset_show/store
v3:
 - better arrangement of what should stay in i915_debugfs and
   what needs to be moved under gt/
 - more use of the local "uncore" and "i915" variables to improve
   readability
v2:
 - dropped changes on "drop_caches", they were indeed irrelevant
 - improved interrupt info function

 drivers/gpu/drm/i915/Makefile|   2 +
 drivers/gpu/drm/i915/gt/debugfs_gt.c |  50 ++-
 drivers/gpu/drm/i915/gt/debugfs_gt_irq.c | 162 ++
 drivers/gpu/drm/i915/gt/debugfs_gt_irq.h |  15 +
 drivers/gpu/drm/i915/gt/debugfs_gt_pm.c  |  32 ++
 drivers/gpu/drm/i915/gt/debugfs_sseu.c   | 294 +
 drivers/gpu/drm/i915/gt/debugfs_sseu.h   |  16 +
 drivers/gpu/drm/i915/i915_debugfs.c  | 384 +--
 8 files changed, 571 insertions(+), 384 deletions(-)
 create mode 100644 drivers/gpu/drm/i915/gt/debugfs_gt_irq.c
 create mode 100644 drivers/gpu/drm/i915/gt/debugfs_gt_irq.h
 create mode 100644 drivers/gpu/drm/i915/gt/debugfs_sseu.c
 create mode 100644 drivers/gpu/drm/i915/gt/debugfs_sseu.h

diff --git a/drivers/gpu/drm/i915/Makefile b/drivers/gpu/drm/i915/Makefile
index 2fce8b0040f3..51929d6648e2 100644
--- a/drivers/gpu/drm/i915/Makefile
+++ b/drivers/gpu/drm/i915/Makefile
@@ -79,6 +79,8 @@ gt-y += \
gt/debugfs_engines.o \
gt/debugfs_gt.o \
gt/debugfs_gt_pm.o \
+   gt/debugfs_gt_irq.o \
+   gt/debugfs_sseu.o \
gt/gen6_ppgtt.o \
gt/gen7_renderclear.o \
gt/gen8_ppgtt.o \
diff --git a/drivers/gpu/drm/i915/gt/debugfs_gt.c 
b/drivers/gpu/drm/i915/gt/debugfs_gt.c
index 1de5fbaa1cf9..507fe5dcb360 100644
--- a/drivers/gpu/drm/i915/gt/debugfs_gt.c
+++ b/drivers/gpu/drm/i915/gt/debugfs_gt.c
@@ -8,9 +8,53 @@
 
 #include "debugfs_engines.h"
 #include "debugfs_gt.h"
+#include "debugfs_gt_irq.h"
 #include "debugfs_gt_pm.h"
-#include "uc/intel_uc_debugfs.h"
+#include "debugfs_sseu.h"
 #include "i915_drv.h"
+#include "intel_gt_pm.h"
+#include "intel_gt_requests.h"
+#include "uc/intel_uc_debugfs.h"
+
+static int reset_show(void *data, u64 *val)
+{
+   struct intel_gt *gt = data;
+   int ret = intel_gt_terminally_wedged(gt);
+
+   switch (ret) {
+   case -EIO:
+   *val = 1;
+   return 0;
+   case 0:
+   *val = 0;
+   return 0;
+   default:
+   return ret;
+   }
+}
+
+static int reset_store(void *data, u64 val)
+{
+   struct intel_gt *gt = data;
+
+   /* Flush any previous reset before applying for a new one */
+   wait_event(gt->reset.queue,
+  !test_bit(I915_RESET_BACKOFF, >->reset.flags));
+
+   intel_gt_handle_error(gt, val, I915_ERROR_CAPTURE,
+ "Manually reset engine mask to %llx", val);
+   return 0;
+}
+DEFINE_SIMPLE_ATTRIBUTE(reset_fops, reset_show, reset_store, "%llu\n");
+
+static void __debugfs_gt_register(struct intel_gt *gt, struct dentry *root)
+{
+   static const struct debugfs_gt_file files[] = {
+   { "reset", &reset_fops, NULL },
+   };
+
+   intel_gt_debugfs_register_files(root, files, ARRAY_SIZE(files), gt);
+}
 
 void debugfs_gt_register(struct intel_gt *gt)
 {
@@ -23,8 +67,12 @@ void debugfs_gt_register(struct intel_gt *gt)
if (IS_ERR(root))
return;
 
+   __debugfs_gt_register(gt, root);
+
debugfs_engines_register(gt, root);
debugfs_gt_pm_register(gt, root);
+   debugfs_gt_register_sseu(gt, root);
+   debugfs_gt_register_irq(gt, root);
 
intel_uc_debugfs_register(>->uc, root);
 }
diff --git a/drivers/gpu/drm/i915/gt/debugfs_gt_irq.c 
b/drivers/gpu/drm/i915/gt/debugfs_gt_irq.c
new file mode 100644
index ..8aaf76dfc573
--- /dev/null
+++ b/drivers/gpu/drm/i915/gt/debugfs_gt_irq.c
@@ -0,0 +1,162 @@
+// SPDX-License-Identifier: MIT
+

[Intel-gfx] [PATCH v5] drm/i915/gt: move remaining debugfs interfaces into gt

2020-04-02 Thread Andi Shyti
From: Andi Shyti 

The following interfaces:

  i915_wedged
  i915_forcewake_user
  i915_gem_interrupt
  i915_rcs_topology
  i915_sseu_status

are dependent on gt values. Put them inside gt/ and drop the
"i915_" prefix name. This would be the new structure:

  gt
  |
  +-- forcewake_user
  |
  +-- interrupt_info
  |
  +-- reset
  |
  +-- rcs_topology
  |
  +-- sseu_status

Signed-off-by: Andi Shyti 
Reviewed-by: Tvrtko Ursulin 
Reviewed-by: Chris Wilson 
---
Hi,

this patch is the first of a series that aims to refactor the
debugfs structure in the i915. Some changes will affect the
debugfs framework as well.

It has gone through a series of offline reviews mainly from
Tvrtko. Even though it hasn't been done publicly, I took the
freedom to add Tvrtko's review.

Thanks Tvrtko and Chris for the review,
Andi

Changelog
=
v5:
 - renamed from debugfs_gt_sseu.[ch] to debugfs_sseu.[ch]
 - moved i915_rcs_topology from i915_debugfs.c to
   gt/debugfs_sseu.c
 - added Tvrtko's and Chris r-b.
v4:
 - interrupt and sseu debugfs interface are moved to their own
   "debugfs_gt_irq" and "debugfs_gt_sseu" files
 - reset functions are renamed to reset_show/store
v3:
 - better arrangement of what should stay in i915_debugfs and
   what needs to be moved under gt/
 - more use of the local "uncore" and "i915" variables to improve
   readability
v2:
 - dropped changes on "drop_caches", they were indeed irrelevant
 - improved interrupt info function

 drivers/gpu/drm/i915/Makefile|   2 +
 drivers/gpu/drm/i915/gt/debugfs_gt.c |  50 ++-
 drivers/gpu/drm/i915/gt/debugfs_gt_irq.c | 162 ++
 drivers/gpu/drm/i915/gt/debugfs_gt_irq.h |  15 +
 drivers/gpu/drm/i915/gt/debugfs_gt_pm.c  |  32 ++
 drivers/gpu/drm/i915/gt/debugfs_sseu.c   | 294 +
 drivers/gpu/drm/i915/gt/debugfs_sseu.h   |  16 +
 drivers/gpu/drm/i915/i915_debugfs.c  | 384 +--
 8 files changed, 571 insertions(+), 384 deletions(-)
 create mode 100644 drivers/gpu/drm/i915/gt/debugfs_gt_irq.c
 create mode 100644 drivers/gpu/drm/i915/gt/debugfs_gt_irq.h
 create mode 100644 drivers/gpu/drm/i915/gt/debugfs_sseu.c
 create mode 100644 drivers/gpu/drm/i915/gt/debugfs_sseu.h

diff --git a/drivers/gpu/drm/i915/Makefile b/drivers/gpu/drm/i915/Makefile
index 2fce8b0040f3..51929d6648e2 100644
--- a/drivers/gpu/drm/i915/Makefile
+++ b/drivers/gpu/drm/i915/Makefile
@@ -79,6 +79,8 @@ gt-y += \
gt/debugfs_engines.o \
gt/debugfs_gt.o \
gt/debugfs_gt_pm.o \
+   gt/debugfs_gt_irq.o \
+   gt/debugfs_sseu.o \
gt/gen6_ppgtt.o \
gt/gen7_renderclear.o \
gt/gen8_ppgtt.o \
diff --git a/drivers/gpu/drm/i915/gt/debugfs_gt.c 
b/drivers/gpu/drm/i915/gt/debugfs_gt.c
index 1de5fbaa1cf9..507fe5dcb360 100644
--- a/drivers/gpu/drm/i915/gt/debugfs_gt.c
+++ b/drivers/gpu/drm/i915/gt/debugfs_gt.c
@@ -8,9 +8,53 @@
 
 #include "debugfs_engines.h"
 #include "debugfs_gt.h"
+#include "debugfs_gt_irq.h"
 #include "debugfs_gt_pm.h"
-#include "uc/intel_uc_debugfs.h"
+#include "debugfs_sseu.h"
 #include "i915_drv.h"
+#include "intel_gt_pm.h"
+#include "intel_gt_requests.h"
+#include "uc/intel_uc_debugfs.h"
+
+static int reset_show(void *data, u64 *val)
+{
+   struct intel_gt *gt = data;
+   int ret = intel_gt_terminally_wedged(gt);
+
+   switch (ret) {
+   case -EIO:
+   *val = 1;
+   return 0;
+   case 0:
+   *val = 0;
+   return 0;
+   default:
+   return ret;
+   }
+}
+
+static int reset_store(void *data, u64 val)
+{
+   struct intel_gt *gt = data;
+
+   /* Flush any previous reset before applying for a new one */
+   wait_event(gt->reset.queue,
+  !test_bit(I915_RESET_BACKOFF, >->reset.flags));
+
+   intel_gt_handle_error(gt, val, I915_ERROR_CAPTURE,
+ "Manually reset engine mask to %llx", val);
+   return 0;
+}
+DEFINE_SIMPLE_ATTRIBUTE(reset_fops, reset_show, reset_store, "%llu\n");
+
+static void __debugfs_gt_register(struct intel_gt *gt, struct dentry *root)
+{
+   static const struct debugfs_gt_file files[] = {
+   { "reset", &reset_fops, NULL },
+   };
+
+   intel_gt_debugfs_register_files(root, files, ARRAY_SIZE(files), gt);
+}
 
 void debugfs_gt_register(struct intel_gt *gt)
 {
@@ -23,8 +67,12 @@ void debugfs_gt_register(struct intel_gt *gt)
if (IS_ERR(root))
return;
 
+   __debugfs_gt_register(gt, root);
+
debugfs_engines_register(gt, root);
debugfs_gt_pm_register(gt, root);
+   debugfs_gt_register_sseu(gt, root);
+   debugfs_gt_register_irq(gt, root);
 
intel_uc_debugfs_register(>->uc, root);
 }
diff --git a/drivers/gpu/drm/i915/gt/debugfs_gt_irq.c 
b/drivers/gpu/drm/i915/gt/debugfs_gt_irq.c
new file mode 100644
index ..8aaf76dfc573
--- /dev/null
+++ b/drivers/gpu/drm/i915/gt/debugfs_gt_irq.c
@@ -0,0 +1,162 @@
+// SPDX-License-Identifier: MIT
+

Re: [Intel-gfx] [PATCH v5] drm/i915/gt: move remaining debugfs interfaces into gt

2020-04-02 Thread Chris Wilson
Quoting Andi Shyti (2020-04-02 18:44:17)
>  static const struct drm_info_list i915_debugfs_list[] = {
> {"i915_capabilities", i915_capabilities, 0},
> {"i915_gem_objects", i915_gem_object_info, 0},
> @@ -1862,10 +1484,8 @@ static const struct drm_info_list i915_debugfs_list[] 
> = {
> {"i915_llc", i915_llc, 0},
> {"i915_runtime_pm_status", i915_runtime_pm_status, 0},
> {"i915_engine_info", i915_engine_info, 0},
> -   {"i915_rcs_topology", i915_rcs_topology, 0},
> {"i915_shrinker_info", i915_shrinker_info, 0},
> {"i915_wa_registers", i915_wa_registers, 0},
> -   {"i915_sseu_status", i915_sseu_status, 0},
> {"i915_rps_boost_info", i915_rps_boost_info, 0},

Future passes:
i915_gem_fence_regs
i915_frequency_info [or subsume]
i915_ring_freq_table
i915_swizzle_info
i915_llc
i915_wa_registers?
i915_rps_boost_info
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx