Eric Anholt | c8b75bc | 2015-03-02 13:01:12 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright © 2014 Broadcom |
| 3 | * |
| 4 | * This program is free software; you can redistribute it and/or modify |
| 5 | * it under the terms of the GNU General Public License version 2 as |
| 6 | * published by the Free Software Foundation. |
| 7 | */ |
| 8 | |
| 9 | #include <linux/seq_file.h> |
| 10 | #include <linux/circ_buf.h> |
| 11 | #include <linux/ctype.h> |
| 12 | #include <linux/debugfs.h> |
| 13 | #include <drm/drmP.h> |
| 14 | |
| 15 | #include "vc4_drv.h" |
| 16 | #include "vc4_regs.h" |
| 17 | |
| 18 | static const struct drm_info_list vc4_debugfs_list[] = { |
Eric Anholt | c826a6e | 2015-10-09 20:25:07 -0700 | [diff] [blame] | 19 | {"bo_stats", vc4_bo_stats_debugfs, 0}, |
Eric Anholt | 08302c3 | 2016-02-10 11:42:32 -0800 | [diff] [blame] | 20 | {"dpi_regs", vc4_dpi_debugfs_regs, 0}, |
Eric Anholt | 4078f57 | 2017-01-31 11:29:11 -0800 | [diff] [blame] | 21 | {"dsi1_regs", vc4_dsi_debugfs_regs, 0, (void *)(uintptr_t)1}, |
Eric Anholt | c8b75bc | 2015-03-02 13:01:12 -0800 | [diff] [blame] | 22 | {"hdmi_regs", vc4_hdmi_debugfs_regs, 0}, |
Boris Brezillon | e4b81f8 | 2016-12-02 14:48:10 +0100 | [diff] [blame] | 23 | {"vec_regs", vc4_vec_debugfs_regs, 0}, |
Boris Brezillon | 008095e | 2018-07-03 09:50:22 +0200 | [diff] [blame] | 24 | {"txp_regs", vc4_txp_debugfs_regs, 0}, |
Eric Anholt | c8b75bc | 2015-03-02 13:01:12 -0800 | [diff] [blame] | 25 | {"hvs_regs", vc4_hvs_debugfs_regs, 0}, |
Boris Brezillon | 531a1b6 | 2019-02-20 16:51:22 +0100 | [diff] [blame] | 26 | {"hvs_underrun", vc4_hvs_debugfs_underrun, 0}, |
Eric Anholt | c8b75bc | 2015-03-02 13:01:12 -0800 | [diff] [blame] | 27 | {"crtc0_regs", vc4_crtc_debugfs_regs, 0, (void *)(uintptr_t)0}, |
| 28 | {"crtc1_regs", vc4_crtc_debugfs_regs, 0, (void *)(uintptr_t)1}, |
| 29 | {"crtc2_regs", vc4_crtc_debugfs_regs, 0, (void *)(uintptr_t)2}, |
Eric Anholt | d3f5168 | 2015-03-02 13:01:12 -0800 | [diff] [blame] | 30 | {"v3d_ident", vc4_v3d_debugfs_ident, 0}, |
| 31 | {"v3d_regs", vc4_v3d_debugfs_regs, 0}, |
Eric Anholt | c8b75bc | 2015-03-02 13:01:12 -0800 | [diff] [blame] | 32 | }; |
| 33 | |
| 34 | #define VC4_DEBUGFS_ENTRIES ARRAY_SIZE(vc4_debugfs_list) |
| 35 | |
| 36 | int |
| 37 | vc4_debugfs_init(struct drm_minor *minor) |
| 38 | { |
Paul Kocialkowski | 6b5c029 | 2019-02-20 16:51:24 +0100 | [diff] [blame^] | 39 | struct vc4_dev *vc4 = to_vc4_dev(minor->dev); |
| 40 | struct dentry *dentry; |
| 41 | |
| 42 | dentry = debugfs_create_bool("hvs_load_tracker", S_IRUGO | S_IWUSR, |
| 43 | minor->debugfs_root, |
| 44 | &vc4->load_tracker_enabled); |
| 45 | if (!dentry) |
| 46 | return -ENOMEM; |
| 47 | |
Eric Anholt | c8b75bc | 2015-03-02 13:01:12 -0800 | [diff] [blame] | 48 | return drm_debugfs_create_files(vc4_debugfs_list, VC4_DEBUGFS_ENTRIES, |
| 49 | minor->debugfs_root, minor); |
| 50 | } |