diff options
author | Marcin Slusarz <marcin.slusarz@gmail.com> | 2013-02-08 15:42:13 -0500 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2013-02-20 05:46:34 -0500 |
commit | 33b903e82873ba9233bd89c44d016b87347ed158 (patch) | |
tree | 3e8e6a1cdcfc6bc07a22ad21e4d73e1924686dfb /drivers/gpu/drm | |
parent | eff76ed7881842ffcd2d77cf217eabcb1134b38b (diff) |
drm/nouveau: restore debugfs/vbios.rom support
Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com>
Diffstat (limited to 'drivers/gpu/drm')
-rw-r--r-- | drivers/gpu/drm/nouveau/Makefile | 1 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_debugfs.c | 64 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_debugfs.h | 22 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_drm.c | 6 |
4 files changed, 93 insertions, 0 deletions
diff --git a/drivers/gpu/drm/nouveau/Makefile b/drivers/gpu/drm/nouveau/Makefile index 51d09729fc56..90f9140eeefd 100644 --- a/drivers/gpu/drm/nouveau/Makefile +++ b/drivers/gpu/drm/nouveau/Makefile | |||
@@ -242,5 +242,6 @@ ifdef CONFIG_X86 | |||
242 | nouveau-$(CONFIG_ACPI) += nouveau_acpi.o | 242 | nouveau-$(CONFIG_ACPI) += nouveau_acpi.o |
243 | endif | 243 | endif |
244 | nouveau-$(CONFIG_DRM_NOUVEAU_BACKLIGHT) += nouveau_backlight.o | 244 | nouveau-$(CONFIG_DRM_NOUVEAU_BACKLIGHT) += nouveau_backlight.o |
245 | nouveau-$(CONFIG_DEBUG_FS) += nouveau_debugfs.o | ||
245 | 246 | ||
246 | obj-$(CONFIG_DRM_NOUVEAU)+= nouveau.o | 247 | obj-$(CONFIG_DRM_NOUVEAU)+= nouveau.o |
diff --git a/drivers/gpu/drm/nouveau/nouveau_debugfs.c b/drivers/gpu/drm/nouveau/nouveau_debugfs.c new file mode 100644 index 000000000000..5392e07edfc6 --- /dev/null +++ b/drivers/gpu/drm/nouveau/nouveau_debugfs.c | |||
@@ -0,0 +1,64 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2009 Red Hat <bskeggs@redhat.com> | ||
3 | * | ||
4 | * Permission is hereby granted, free of charge, to any person obtaining | ||
5 | * a copy of this software and associated documentation files (the | ||
6 | * "Software"), to deal in the Software without restriction, including | ||
7 | * without limitation the rights to use, copy, modify, merge, publish, | ||
8 | * distribute, sublicense, and/or sell copies of the Software, and to | ||
9 | * permit persons to whom the Software is furnished to do so, subject to | ||
10 | * the following conditions: | ||
11 | * | ||
12 | * The above copyright notice and this permission notice (including the | ||
13 | * next paragraph) shall be included in all copies or substantial | ||
14 | * portions of the Software. | ||
15 | * | ||
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | ||
17 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | ||
18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | ||
19 | * IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE | ||
20 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION | ||
21 | * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION | ||
22 | * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
23 | * | ||
24 | */ | ||
25 | |||
26 | /* | ||
27 | * Authors: | ||
28 | * Ben Skeggs <bskeggs@redhat.com> | ||
29 | */ | ||
30 | |||
31 | #include "nouveau_debugfs.h" | ||
32 | #include "nouveau_drm.h" | ||
33 | |||
34 | static int | ||
35 | nouveau_debugfs_vbios_image(struct seq_file *m, void *data) | ||
36 | { | ||
37 | struct drm_info_node *node = (struct drm_info_node *) m->private; | ||
38 | struct nouveau_drm *drm = nouveau_drm(node->minor->dev); | ||
39 | int i; | ||
40 | |||
41 | for (i = 0; i < drm->vbios.length; i++) | ||
42 | seq_printf(m, "%c", drm->vbios.data[i]); | ||
43 | return 0; | ||
44 | } | ||
45 | |||
46 | static struct drm_info_list nouveau_debugfs_list[] = { | ||
47 | { "vbios.rom", nouveau_debugfs_vbios_image, 0, NULL }, | ||
48 | }; | ||
49 | #define NOUVEAU_DEBUGFS_ENTRIES ARRAY_SIZE(nouveau_debugfs_list) | ||
50 | |||
51 | int | ||
52 | nouveau_debugfs_init(struct drm_minor *minor) | ||
53 | { | ||
54 | drm_debugfs_create_files(nouveau_debugfs_list, NOUVEAU_DEBUGFS_ENTRIES, | ||
55 | minor->debugfs_root, minor); | ||
56 | return 0; | ||
57 | } | ||
58 | |||
59 | void | ||
60 | nouveau_debugfs_takedown(struct drm_minor *minor) | ||
61 | { | ||
62 | drm_debugfs_remove_files(nouveau_debugfs_list, NOUVEAU_DEBUGFS_ENTRIES, | ||
63 | minor); | ||
64 | } | ||
diff --git a/drivers/gpu/drm/nouveau/nouveau_debugfs.h b/drivers/gpu/drm/nouveau/nouveau_debugfs.h new file mode 100644 index 000000000000..a62af6fb5f99 --- /dev/null +++ b/drivers/gpu/drm/nouveau/nouveau_debugfs.h | |||
@@ -0,0 +1,22 @@ | |||
1 | #ifndef __NOUVEAU_DEBUGFS_H__ | ||
2 | #define __NOUVEAU_DEBUGFS_H__ | ||
3 | |||
4 | #include <drm/drmP.h> | ||
5 | |||
6 | #if defined(CONFIG_DEBUG_FS) | ||
7 | extern int nouveau_debugfs_init(struct drm_minor *); | ||
8 | extern void nouveau_debugfs_takedown(struct drm_minor *); | ||
9 | #else | ||
10 | static inline int | ||
11 | nouveau_debugfs_init(struct drm_minor *minor) | ||
12 | { | ||
13 | return 0; | ||
14 | } | ||
15 | |||
16 | static inline void nouveau_debugfs_takedown(struct drm_minor *minor) | ||
17 | { | ||
18 | } | ||
19 | |||
20 | #endif | ||
21 | |||
22 | #endif | ||
diff --git a/drivers/gpu/drm/nouveau/nouveau_drm.c b/drivers/gpu/drm/nouveau/nouveau_drm.c index f9144910b78e..b1c4ce1cf2f2 100644 --- a/drivers/gpu/drm/nouveau/nouveau_drm.c +++ b/drivers/gpu/drm/nouveau/nouveau_drm.c | |||
@@ -50,6 +50,7 @@ | |||
50 | #include "nouveau_abi16.h" | 50 | #include "nouveau_abi16.h" |
51 | #include "nouveau_fbcon.h" | 51 | #include "nouveau_fbcon.h" |
52 | #include "nouveau_fence.h" | 52 | #include "nouveau_fence.h" |
53 | #include "nouveau_debugfs.h" | ||
53 | 54 | ||
54 | MODULE_PARM_DESC(config, "option string to pass to driver core"); | 55 | MODULE_PARM_DESC(config, "option string to pass to driver core"); |
55 | static char *nouveau_config; | 56 | static char *nouveau_config; |
@@ -667,6 +668,11 @@ driver = { | |||
667 | .postclose = nouveau_drm_postclose, | 668 | .postclose = nouveau_drm_postclose, |
668 | .lastclose = nouveau_vga_lastclose, | 669 | .lastclose = nouveau_vga_lastclose, |
669 | 670 | ||
671 | #if defined(CONFIG_DEBUG_FS) | ||
672 | .debugfs_init = nouveau_debugfs_init, | ||
673 | .debugfs_cleanup = nouveau_debugfs_takedown, | ||
674 | #endif | ||
675 | |||
670 | .irq_preinstall = nouveau_irq_preinstall, | 676 | .irq_preinstall = nouveau_irq_preinstall, |
671 | .irq_postinstall = nouveau_irq_postinstall, | 677 | .irq_postinstall = nouveau_irq_postinstall, |
672 | .irq_uninstall = nouveau_irq_uninstall, | 678 | .irq_uninstall = nouveau_irq_uninstall, |