[PATCH v4 58/58] accel: add -DDYNAMIC_DEBUG_MODULE to subdir-cflags - RFC
Jim Cromie
jim.cromie at gmail.com
Sun Aug 3 03:58:16 UTC 2025
Currently amdxdna uses drm_dbg, so it needs this cflag in order to
compile; it currently gets the cflag from its own Makefile.
If other accel modules want to use DRM.debug, they will need this flag
too, so add it in accel/Makefile.
NOTE: ivpu has its own CLASS-ish dbg system:
./drivers/accel/ivpu$ grep IVPU_DBG_ *
ivpu_drv.c:MODULE_PARM_DESC(dbg_mask, "Driver debug mask. See IVPU_DBG_* macros.");
ivpu_drv.h:#define IVPU_DBG_REG BIT(0)
ivpu_drv.h:#define IVPU_DBG_IRQ BIT(1)
ivpu_drv.h:#define IVPU_DBG_MMU BIT(2)
ivpu_drv.h:#define IVPU_DBG_FILE BIT(3)
ivpu_drv.h:#define IVPU_DBG_MISC BIT(4)
ivpu_drv.h:#define IVPU_DBG_FW_BOOT BIT(5)
ivpu_drv.h:#define IVPU_DBG_PM BIT(6)
ivpu_drv.h:#define IVPU_DBG_IPC BIT(7)
ivpu_drv.h:#define IVPU_DBG_BO BIT(8)
ivpu_drv.h:#define IVPU_DBG_JOB BIT(9)
ivpu_drv.h:#define IVPU_DBG_JSM BIT(10)
ivpu_drv.h:#define IVPU_DBG_KREF BIT(11)
ivpu_drv.h:#define IVPU_DBG_RPM BIT(12)
ivpu_drv.h:#define IVPU_DBG_MMU_MAP BIT(13)
ivpu_drv.h: if (unlikely(IVPU_DBG_##type & ivpu_dbg_mask)) \
./drivers/accel/ivpu$ grep ivpu_dbg * | cut -f1,2 -d, | cut -d: -f2- | perl -pe 's/\s+/ /' | sort -u
extern int ivpu_dbg_mask;
if (unlikely(IVPU_DBG_##type & ivpu_dbg_mask)) \
int ivpu_dbg_mask;
ivpu_dbg_bo(vdev, bo
ivpu_dbg(vdev, BO
ivpu_dbg(vdev, FILE
ivpu_dbg(vdev, FW_BOOT
ivpu_dbg(vdev, IPC
ivpu_dbg(vdev, IRQ
ivpu_dbg(vdev, JOB
ivpu_dbg(vdev, JSM
ivpu_dbg(vdev, KREF
ivpu_dbg(vdev, MISC
ivpu_dbg(vdev, MMU
ivpu_dbg(vdev, MMU_MAP
ivpu_dbg(vdev, PM
ivpu_dbg(vdev, REG
module_param_named(dbg_mask, ivpu_dbg_mask
static inline void ivpu_dbg_bo(struct ivpu_device *vdev, struct ivpu_bo *bo
This looks readily convertible to a dyndbg classmap and controlling kparam.
Signed-off-by: Jim Cromie <jim.cromie at gmail.com>
---
drivers/accel/Makefile | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/accel/Makefile b/drivers/accel/Makefile
index a301fb6089d4c..e437549cba8ac 100644
--- a/drivers/accel/Makefile
+++ b/drivers/accel/Makefile
@@ -1,5 +1,7 @@
# SPDX-License-Identifier: GPL-2.0-only
+subdir-cflags-$(CONFIG_DYNAMIC_DEBUG_CORE) == -DDYNAMIC_DEBUG_MODULE
+
obj-$(CONFIG_DRM_ACCEL_AMDXDNA) += amdxdna/
obj-$(CONFIG_DRM_ACCEL_HABANALABS) += habanalabs/
obj-$(CONFIG_DRM_ACCEL_IVPU) += ivpu/
--
2.50.1
More information about the amd-gfx
mailing list