xref: /linux/drivers/gpu/drm/nouveau/nouveau_debugfs.h (revision 2c1ed907520c50326b8f604907a8478b27881a2e)
1 /* SPDX-License-Identifier: MIT */
2 #ifndef __NOUVEAU_DEBUGFS_H__
3 #define __NOUVEAU_DEBUGFS_H__
4 
5 #include <drm/drm_debugfs.h>
6 
7 #if defined(CONFIG_DEBUG_FS)
8 
9 #include "nouveau_drv.h"
10 
11 struct nouveau_debugfs {
12 	struct nvif_object ctrl;
13 };
14 
15 static inline struct nouveau_debugfs *
nouveau_debugfs(struct drm_device * dev)16 nouveau_debugfs(struct drm_device *dev)
17 {
18 	return nouveau_drm(dev)->debugfs;
19 }
20 
21 extern void  nouveau_drm_debugfs_init(struct drm_minor *);
22 extern int  nouveau_debugfs_init(struct nouveau_drm *);
23 extern void nouveau_debugfs_fini(struct nouveau_drm *);
24 
25 extern struct dentry *nouveau_debugfs_root;
26 
27 int  nouveau_module_debugfs_init(void);
28 void nouveau_module_debugfs_fini(void);
29 #else
30 static inline void
nouveau_drm_debugfs_init(struct drm_minor * minor)31 nouveau_drm_debugfs_init(struct drm_minor *minor)
32 {}
33 
34 static inline int
nouveau_debugfs_init(struct nouveau_drm * drm)35 nouveau_debugfs_init(struct nouveau_drm *drm)
36 {
37 	return 0;
38 }
39 
40 static inline void
nouveau_debugfs_fini(struct nouveau_drm * drm)41 nouveau_debugfs_fini(struct nouveau_drm *drm)
42 {
43 }
44 
45 static inline int
nouveau_module_debugfs_init(void)46 nouveau_module_debugfs_init(void)
47 {
48 	return 0;
49 }
50 
51 static inline void
nouveau_module_debugfs_fini(void)52 nouveau_module_debugfs_fini(void)
53 {
54 }
55 
56 #endif
57 
58 #endif
59