All of lore.kernel.org
 help / color / mirror / Atom feed
* [Intel-xe] [RFC 0/2] Dump + OOB workarounds
@ 2023-04-12  8:20 Lucas De Marchi
  2023-04-12  8:20 ` [Intel-xe] [RFC 1/2] drm/xe: Add debugfs to dump all known workarounds Lucas De Marchi
                   ` (9 more replies)
  0 siblings, 10 replies; 16+ messages in thread
From: Lucas De Marchi @ 2023-04-12  8:20 UTC (permalink / raw)
  To: intel-xe; +Cc: Matt Roper, Lucas De Marchi, Rodrigo Vivi

This is 2 RFCs in one, since they are more or less related.

PATCH #1) Dump the "driver workaround database" to check what are the
workarounds implemented. This is useful when checking against the spec
what workarounds are implemented in the driver.  This can later be
extended to mark what are the "active" workarounds on the current
platform.  I think this second scenario is more useful for the debugfs
usage.

Other alternatives I have considered:
a) Reuse the kunit infra; with this it's possible to easily fake a
platform and get what are the WAs considered "active" for a platform.
This is nice because it doesn't need to run on real hardware. However
this may be abusing what the kunit is for

b) Just write a tool in C or python that parses the section from
the .ko and output the info need. Drawback is keeping in sync the
declarations from xe_rtp with this additional tool. And probably also
that it'd need to process the rules by itself.

PATCH #2) "out-of-band" workarounds, i.e. those that are sprinkled
around the driver. In the implementation here I tried to keep the caller
similar to what it was before. With the addition of XE_WA() the caller
"registers" the workaround so later we can access it. As example I
converted 1 place in xe_guc.c to use that.

Note: The "condition" is checked each time it goes through that code
path.  I was debating the ability to just re-use XE_RTP_RULE() instead
since it appears all the conditions can be translated to rules.
Consider this the alternative (a).

After writing the commit message for that patch I thought: but if we can
transform those conditions in rules, we could very well keep them in an
additional table in xe_wa.c, which is the alternative below:

b) keep an additional table in xe_wa.c whose action is to set a
bit/byte(?)  in  xe->active_oob_workarounds[]. During probe
the rules are processed and the ones active are marked in that array.
The extra section created by XE_WA() is then used to just map
the WA to the index value. Then the callers would only need something
like `if (XE_WA(xe, "XXXXXX") { ... } ` since the condition would be
executed once on init.  However I'm thinking that this may not scale to
all workarounds we may have.

Thoughts?

thanks
Lucas De Marchi

Lucas De Marchi (2):
  drm/xe: Add debugfs to dump all known workarounds
  drm/xe: Register OOB workarounds

 drivers/gpu/drm/xe/Makefile       |  2 ++
 drivers/gpu/drm/xe/xe.lds         |  8 +++++++
 drivers/gpu/drm/xe/xe_debugfs.c   | 12 ++++++++++
 drivers/gpu/drm/xe/xe_guc.c       |  6 ++---
 drivers/gpu/drm/xe/xe_rtp_types.h |  8 +++++++
 drivers/gpu/drm/xe/xe_wa.c        | 38 +++++++++++++++++++++++++++++--
 drivers/gpu/drm/xe/xe_wa.h        | 14 ++++++++++++
 7 files changed, 83 insertions(+), 5 deletions(-)
 create mode 100644 drivers/gpu/drm/xe/xe.lds

-- 
2.39.0


^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2023-04-17 21:16 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-04-12  8:20 [Intel-xe] [RFC 0/2] Dump + OOB workarounds Lucas De Marchi
2023-04-12  8:20 ` [Intel-xe] [RFC 1/2] drm/xe: Add debugfs to dump all known workarounds Lucas De Marchi
2023-04-17 21:16   ` Matt Roper
2023-04-12  8:20 ` [Intel-xe] [RFC 2/2] drm/xe: Register OOB workarounds Lucas De Marchi
2023-04-12 11:31   ` Mika Kuoppala
2023-04-12 16:21     ` Lucas De Marchi
2023-04-13  7:33       ` Mika Kuoppala
2023-04-12  8:24 ` [Intel-xe] ✓ CI.Patch_applied: success for Dump + " Patchwork
2023-04-12  8:25 ` [Intel-xe] ✓ CI.KUnit: " Patchwork
2023-04-12  8:29 ` [Intel-xe] ✓ CI.Build: " Patchwork
2023-04-12 10:32 ` [Intel-xe] ✓ CI.Patch_applied: " Patchwork
2023-04-12 10:34 ` [Intel-xe] ✓ CI.KUnit: " Patchwork
2023-04-12 10:37 ` [Intel-xe] ✓ CI.Build: " Patchwork
2023-04-12 10:58 ` [Intel-xe] ○ CI.BAT: info " Patchwork
2023-04-14 14:36 ` [Intel-xe] [RFC 0/2] " Rodrigo Vivi
2023-04-14 15:03   ` Lucas De Marchi

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.