drm: POC drm on dyndbg - use in core, 2 helpers, 3 drivers.
authorJim Cromie <jim.cromie@gmail.com>
Mon, 12 Sep 2022 05:28:45 +0000 (23:28 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 24 Sep 2022 13:02:01 +0000 (15:02 +0200)
commitf158936b60a7874f29cf8de8d83191ad69119c11
tree9626b0e0f81c25be4279e009035e36cdd182a980
parent0406faf25fb12d29cb1823e641c6f3f3e2037735
drm: POC drm on dyndbg - use in core, 2 helpers, 3 drivers.

Use DECLARE_DYNDBG_CLASSMAP across DRM:

 - in .c files, since macro defines/initializes a record

 - in drivers, $mod_{drv,drm,param}.c
   ie where param setup is done, since a classmap is param related

 - in drm/drm_print.c
   since existing __drm_debug param is defined there,
   and we ifdef it, and provide an elaborated alternative.

 - in drm_*_helper modules:
   dp/drm_dp - 1st item in makefile target
   drivers/gpu/drm/drm_crtc_helper.c - random pick iirc.

Since these modules all use identical CLASSMAP declarations (ie: names
and .class_id's) they will all respond together to "class DRM_UT_*"
query-commands:

  :#> echo class DRM_UT_KMS +p > /proc/dynamic_debug/control

NOTES:

This changes __drm_debug from int to ulong, so BIT() is usable on it.

DRM's enum drm_debug_category values need to sync with the index of
their respective class-names here.  Then .class_id == category, and
dyndbg's class FOO mechanisms will enable drm_dbg(DRM_UT_KMS, ...).

Though DRM needs consistent categories across all modules, thats not
generally needed; modules X and Y could define FOO differently (ie a
different NAME => class_id mapping), changes are made according to
each module's private class-map.

No callsites are actually selected by this patch, since none are
class'd yet.

Signed-off-by: Jim Cromie <jim.cromie@gmail.com>
Link: https://lore.kernel.org/r/20220912052852.1123868-3-jim.cromie@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
drivers/gpu/drm/display/drm_dp_helper.c
drivers/gpu/drm/drm_crtc_helper.c
drivers/gpu/drm/drm_print.c
drivers/gpu/drm/i915/i915_params.c
drivers/gpu/drm/nouveau/nouveau_drm.c
include/drm/drm_print.h