xref: /netbsd-src/sys/external/bsd/drm2/dist/drm/nouveau/nouveau_debugfs.h (revision 41ec02673d281bbb3d38e6c78504ce6e30c228c1)
1 /*	$NetBSD: nouveau_debugfs.h,v 1.3 2021/12/18 23:45:32 riastradh Exp $	*/
2 
3 /* SPDX-License-Identifier: MIT */
4 #ifndef __NOUVEAU_DEBUGFS_H__
5 #define __NOUVEAU_DEBUGFS_H__
6 
7 #include <drm/drm_debugfs.h>
8 
9 #if defined(CONFIG_DEBUG_FS)
10 
11 #include "nouveau_drv.h"
12 
13 struct nouveau_debugfs {
14 	struct nvif_object ctrl;
15 };
16 
17 static inline struct nouveau_debugfs *
nouveau_debugfs(struct drm_device * dev)18 nouveau_debugfs(struct drm_device *dev)
19 {
20 	return nouveau_drm(dev)->debugfs;
21 }
22 
23 extern int  nouveau_drm_debugfs_init(struct drm_minor *);
24 extern int  nouveau_debugfs_init(struct nouveau_drm *);
25 extern void nouveau_debugfs_fini(struct nouveau_drm *);
26 #else
27 static inline int
nouveau_drm_debugfs_init(struct drm_minor * minor)28 nouveau_drm_debugfs_init(struct drm_minor *minor)
29 {
30        return 0;
31 }
32 
33 static inline int
nouveau_debugfs_init(struct nouveau_drm * drm)34 nouveau_debugfs_init(struct nouveau_drm *drm)
35 {
36 	return 0;
37 }
38 
39 static inline void
nouveau_debugfs_fini(struct nouveau_drm * drm)40 nouveau_debugfs_fini(struct nouveau_drm *drm)
41 {
42 }
43 
44 #endif
45 
46 #endif
47