@@ -19,7 +19,7 @@ struct nvkm_subdev {
enum nvkm_subdev_type type;
int inst;
char name[16];
- u32 debug;
+ unsigned long debug;
struct list_head head;
void **pself;
@@ -90,13 +90,6 @@ DECLARE_DYNDBG_CLASSMAP(nv_cli_debug_verbose, DD_CLASS_TYPE_VERBOSE, 10,
"NV_CLI_DBG_TRACE",
"NV_CLI_DBG_SPAM");
-DECLARE_DYNDBG_CLASSMAP(nv_subdev_debug_verbose, DD_CLASS_TYPE_VERBOSE, 15,
- "NV_SUBDEV_DBG_OFF",
- "NV_SUBDEV_DBG_INFO",
- "NV_SUBDEV_DBG_DEBUG",
- "NV_SUBDEV_DBG_TRACE",
- "NV_SUBDEV_DBG_SPAM");
-
MODULE_PARM_DESC(config, "option string to pass to driver core");
static char *nouveau_config;
module_param_named(config, nouveau_config, charp, 0400);
@@ -26,6 +26,27 @@
#include <core/option.h>
#include <subdev/mc.h>
+#include <linux/dynamic_debug.h>
+#include <linux/module.h>
+
+#define DEBUG
+
+DECLARE_DYNDBG_CLASSMAP(nv_subdev_debug_verbose, DD_CLASS_TYPE_VERBOSE, 15,
+ "NV_SUBDEV_DBG_OFF",
+ "NV_SUBDEV_DBG_INFO",
+ "NV_SUBDEV_DBG_DEBUG",
+ "NV_SUBDEV_DBG_TRACE",
+ "NV_SUBDEV_DBG_SPAM");
+
+static struct ddebug_classes_bitmap_param nv_subdev_verbose = {
+ .bits = NULL, // wants &_subdev->debug
+ .flags = "p",
+ .map = &nv_subdev_debug_verbose,
+};
+module_param_cb(debug_subdev, ¶m_ops_dyndbg_classes, &nv_subdev_verbose, 0600);
+
+
+
const char *
nvkm_subdev_type[NVKM_SUBDEV_NR] = {
#define NVKM_LAYOUT_ONCE(type,data,ptr,...) [type] = #ptr,
@@ -180,6 +201,8 @@ nvkm_subdev_ctor(const struct nvkm_subdev_func *func, struct nvkm_device *device
else
strscpy(subdev->name, nvkm_subdev_type[type], sizeof(subdev->name));
subdev->debug = nvkm_dbgopt(device->dbgopt, subdev->name);
+ nv_subdev_verbose.bits = &subdev->debug;
+ pr_debug("updated bitmap: %px\n", &nv_subdev_verbose.bits);
list_add_tail(&subdev->head, &device->subdev);
}