aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/omapdrm/omap_debugfs.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-02-25 19:46:44 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2013-02-25 19:46:44 -0500
commitfffddfd6c8e0c10c42c6e2cc54ba880fcc36ebbb (patch)
tree71bc5e597124dbaf7550f1e089d675718b3ed5c0 /drivers/gpu/drm/omapdrm/omap_debugfs.c
parent69086a78bdc973ec0b722be790b146e84ba8a8c4 (diff)
parentbe88298b0a3f771a4802f20c5e66af74bfd1dff1 (diff)
Merge branch 'drm-next' of git://people.freedesktop.org/~airlied/linux
Pull drm merge from Dave Airlie: "Highlights: - TI LCD controller KMS driver - TI OMAP KMS driver merged from staging - drop gma500 stub driver - the fbcon locking fixes - the vgacon dirty like zebra fix. - open firmware videomode and hdmi common code helpers - major locking rework for kms object handling - pageflip/cursor won't block on polling anymore! - fbcon helper and prime helper cleanups - i915: all over the map, haswell power well enhancements, valleyview macro horrors cleaned up, killing lots of legacy GTT code, - radeon: CS ioctl unification, deprecated UMS support, gpu reset rework, VM fixes - nouveau: reworked thermal code, external dp/tmds encoder support (anx9805), fences sleep instead of polling, - exynos: all over the driver fixes." Lovely conflict in radeon/evergreen_cs.c between commit de0babd60d8d ("drm/radeon: enforce use of radeon_get_ib_value when reading user cmd") and the new changes that modified that evergreen_dma_cs_parse() function. * 'drm-next' of git://people.freedesktop.org/~airlied/linux: (508 commits) drm/tilcdc: only build on arm drm/i915: Revert hdmi HDP pin checks drm/tegra: Add list of framebuffers to debugfs drm/tegra: Fix color expansion drm/tegra: Split DC_CMD_STATE_CONTROL register write drm/tegra: Implement page-flipping support drm/tegra: Implement VBLANK support drm/tegra: Implement .mode_set_base() drm/tegra: Add plane support drm/tegra: Remove bogus tegra_framebuffer structure drm: Add consistency check for page-flipping drm/radeon: Use generic HDMI infoframe helpers drm/tegra: Use generic HDMI infoframe helpers drm: Add EDID helper documentation drm: Add HDMI infoframe helpers video: Add generic HDMI infoframe helpers drm: Add some missing forward declarations drm: Move mode tables to drm_edid.c drm: Remove duplicate drm_mode_cea_vic() gma500: Fix n, m1 and m2 clock limits for sdvo and lvds ...
Diffstat (limited to 'drivers/gpu/drm/omapdrm/omap_debugfs.c')
-rw-r--r--drivers/gpu/drm/omapdrm/omap_debugfs.c125
1 files changed, 125 insertions, 0 deletions
diff --git a/drivers/gpu/drm/omapdrm/omap_debugfs.c b/drivers/gpu/drm/omapdrm/omap_debugfs.c
new file mode 100644
index 000000000000..c27f59da7f29
--- /dev/null
+++ b/drivers/gpu/drm/omapdrm/omap_debugfs.c
@@ -0,0 +1,125 @@
1/*
2 * drivers/gpu/drm/omapdrm/omap_debugfs.c
3 *
4 * Copyright (C) 2011 Texas Instruments
5 * Author: Rob Clark <rob.clark@linaro.org>
6 *
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License version 2 as published by
9 * the Free Software Foundation.
10 *
11 * This program is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
14 * more details.
15 *
16 * You should have received a copy of the GNU General Public License along with
17 * this program. If not, see <http://www.gnu.org/licenses/>.
18 */
19
20#include "omap_drv.h"
21#include "omap_dmm_tiler.h"
22
23#include "drm_fb_helper.h"
24
25
26#ifdef CONFIG_DEBUG_FS
27
28static int gem_show(struct seq_file *m, void *arg)
29{
30 struct drm_info_node *node = (struct drm_info_node *) m->private;
31 struct drm_device *dev = node->minor->dev;
32 struct omap_drm_private *priv = dev->dev_private;
33 int ret;
34
35 ret = mutex_lock_interruptible(&dev->struct_mutex);
36 if (ret)
37 return ret;
38
39 seq_printf(m, "All Objects:\n");
40 omap_gem_describe_objects(&priv->obj_list, m);
41
42 mutex_unlock(&dev->struct_mutex);
43
44 return 0;
45}
46
47static int mm_show(struct seq_file *m, void *arg)
48{
49 struct drm_info_node *node = (struct drm_info_node *) m->private;
50 struct drm_device *dev = node->minor->dev;
51 return drm_mm_dump_table(m, dev->mm_private);
52}
53
54static int fb_show(struct seq_file *m, void *arg)
55{
56 struct drm_info_node *node = (struct drm_info_node *) m->private;
57 struct drm_device *dev = node->minor->dev;
58 struct omap_drm_private *priv = dev->dev_private;
59 struct drm_framebuffer *fb;
60
61 seq_printf(m, "fbcon ");
62 omap_framebuffer_describe(priv->fbdev->fb, m);
63
64 mutex_lock(&dev->mode_config.fb_lock);
65 list_for_each_entry(fb, &dev->mode_config.fb_list, head) {
66 if (fb == priv->fbdev->fb)
67 continue;
68
69 seq_printf(m, "user ");
70 omap_framebuffer_describe(fb, m);
71 }
72 mutex_unlock(&dev->mode_config.fb_lock);
73
74 return 0;
75}
76
77/* list of debufs files that are applicable to all devices */
78static struct drm_info_list omap_debugfs_list[] = {
79 {"gem", gem_show, 0},
80 {"mm", mm_show, 0},
81 {"fb", fb_show, 0},
82};
83
84/* list of debugfs files that are specific to devices with dmm/tiler */
85static struct drm_info_list omap_dmm_debugfs_list[] = {
86 {"tiler_map", tiler_map_show, 0},
87};
88
89int omap_debugfs_init(struct drm_minor *minor)
90{
91 struct drm_device *dev = minor->dev;
92 int ret;
93
94 ret = drm_debugfs_create_files(omap_debugfs_list,
95 ARRAY_SIZE(omap_debugfs_list),
96 minor->debugfs_root, minor);
97
98 if (ret) {
99 dev_err(dev->dev, "could not install omap_debugfs_list\n");
100 return ret;
101 }
102
103 if (dmm_is_available())
104 ret = drm_debugfs_create_files(omap_dmm_debugfs_list,
105 ARRAY_SIZE(omap_dmm_debugfs_list),
106 minor->debugfs_root, minor);
107
108 if (ret) {
109 dev_err(dev->dev, "could not install omap_dmm_debugfs_list\n");
110 return ret;
111 }
112
113 return ret;
114}
115
116void omap_debugfs_cleanup(struct drm_minor *minor)
117{
118 drm_debugfs_remove_files(omap_debugfs_list,
119 ARRAY_SIZE(omap_debugfs_list), minor);
120 if (dmm_is_available())
121 drm_debugfs_remove_files(omap_dmm_debugfs_list,
122 ARRAY_SIZE(omap_dmm_debugfs_list), minor);
123}
124
125#endif