mbox series

[v2,0/3] Improve drm printer code

Message ID 20240517163406.2348-1-michal.wajdeczko@intel.com (mailing list archive)
Headers show
Series Improve drm printer code | expand

Message

Michal Wajdeczko May 17, 2024, 4:34 p.m. UTC
We already have some drm printk functions that need to duplicate
a code to get a similar format of the final result, for example:

  [ ] 0000:00:00.0: [drm:foo] bar
  [ ] 0000:00:00.0: [drm] foo bar
  [ ] 0000:00:00.0: [drm] *ERROR* foo

Add a generic __drm_dev_vprintk() function that can format the
final message like all other existing function do and allows us
to keep the formatting code in one place.

Above also allows to improve drm_dbg_printer() that today lacks
of outputing symbolic name of the caller, like drm_dbg() does.

v1: https://patchwork.freedesktop.org/series/133749/
v2: make it static, keep it simple and use braces (Jani)

Michal Wajdeczko (3):
  drm/print: Add generic drm dev printk function
  drm/print: Improve drm_dbg_printer
  drm/i915: Don't use __func__ as prefix for drm_dbg_printer

 drivers/gpu/drm/drm_print.c                | 53 ++++++++++++----------
 drivers/gpu/drm/i915/gt/intel_reset.c      |  2 +-
 drivers/gpu/drm/i915/gt/selftest_context.c |  2 +-
 include/drm/drm_print.h                    |  2 +
 4 files changed, 34 insertions(+), 25 deletions(-)

Comments

Michal Wajdeczko May 22, 2024, 9:02 a.m. UTC | #1
++

It's already reviewed, but since this touches shared code, extra acks
are still welcomed

On 17.05.2024 18:34, Michal Wajdeczko wrote:
> We already have some drm printk functions that need to duplicate
> a code to get a similar format of the final result, for example:
> 
>   [ ] 0000:00:00.0: [drm:foo] bar
>   [ ] 0000:00:00.0: [drm] foo bar
>   [ ] 0000:00:00.0: [drm] *ERROR* foo
> 
> Add a generic __drm_dev_vprintk() function that can format the
> final message like all other existing function do and allows us
> to keep the formatting code in one place.
> 
> Above also allows to improve drm_dbg_printer() that today lacks
> of outputing symbolic name of the caller, like drm_dbg() does.
> 
> v1: https://patchwork.freedesktop.org/series/133749/
> v2: make it static, keep it simple and use braces (Jani)
> 
> Michal Wajdeczko (3):
>   drm/print: Add generic drm dev printk function
>   drm/print: Improve drm_dbg_printer
>   drm/i915: Don't use __func__ as prefix for drm_dbg_printer
> 
>  drivers/gpu/drm/drm_print.c                | 53 ++++++++++++----------
>  drivers/gpu/drm/i915/gt/intel_reset.c      |  2 +-
>  drivers/gpu/drm/i915/gt/selftest_context.c |  2 +-
>  include/drm/drm_print.h                    |  2 +
>  4 files changed, 34 insertions(+), 25 deletions(-)
>