| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Copyright (C) 2013 Red Hat |
|---|
| 3 | 4 | * Author: Rob Clark <robdclark@gmail.com> |
|---|
| 4 | | - * |
|---|
| 5 | | - * This program is free software; you can redistribute it and/or modify it |
|---|
| 6 | | - * under the terms of the GNU General Public License version 2 as published by |
|---|
| 7 | | - * the Free Software Foundation. |
|---|
| 8 | | - * |
|---|
| 9 | | - * This program is distributed in the hope that it will be useful, but WITHOUT |
|---|
| 10 | | - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|---|
| 11 | | - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for |
|---|
| 12 | | - * more details. |
|---|
| 13 | | - * |
|---|
| 14 | | - * You should have received a copy of the GNU General Public License along with |
|---|
| 15 | | - * this program. If not, see <http://www.gnu.org/licenses/>. |
|---|
| 16 | 5 | */ |
|---|
| 17 | 6 | |
|---|
| 18 | 7 | /* For profiling, userspace can: |
|---|
| .. | .. |
|---|
| 26 | 15 | #ifdef CONFIG_DEBUG_FS |
|---|
| 27 | 16 | |
|---|
| 28 | 17 | #include <linux/debugfs.h> |
|---|
| 18 | +#include <linux/uaccess.h> |
|---|
| 19 | + |
|---|
| 20 | +#include <drm/drm_file.h> |
|---|
| 29 | 21 | |
|---|
| 30 | 22 | #include "msm_drv.h" |
|---|
| 31 | 23 | #include "msm_gpu.h" |
|---|
| .. | .. |
|---|
| 205 | 197 | { |
|---|
| 206 | 198 | struct msm_drm_private *priv = minor->dev->dev_private; |
|---|
| 207 | 199 | struct msm_perf_state *perf; |
|---|
| 208 | | - struct dentry *ent; |
|---|
| 209 | 200 | |
|---|
| 210 | 201 | /* only create on first minor: */ |
|---|
| 211 | 202 | if (priv->perf) |
|---|
| .. | .. |
|---|
| 220 | 211 | mutex_init(&perf->read_lock); |
|---|
| 221 | 212 | priv->perf = perf; |
|---|
| 222 | 213 | |
|---|
| 223 | | - ent = debugfs_create_file("perf", S_IFREG | S_IRUGO, |
|---|
| 224 | | - minor->debugfs_root, perf, &perf_debugfs_fops); |
|---|
| 225 | | - if (!ent) { |
|---|
| 226 | | - DRM_ERROR("Cannot create /sys/kernel/debug/dri/%pd/perf\n", |
|---|
| 227 | | - minor->debugfs_root); |
|---|
| 228 | | - goto fail; |
|---|
| 229 | | - } |
|---|
| 230 | | - |
|---|
| 214 | + debugfs_create_file("perf", S_IFREG | S_IRUGO, minor->debugfs_root, |
|---|
| 215 | + perf, &perf_debugfs_fops); |
|---|
| 231 | 216 | return 0; |
|---|
| 232 | | - |
|---|
| 233 | | -fail: |
|---|
| 234 | | - msm_perf_debugfs_cleanup(priv); |
|---|
| 235 | | - return -1; |
|---|
| 236 | 217 | } |
|---|
| 237 | 218 | |
|---|
| 238 | 219 | void msm_perf_debugfs_cleanup(struct msm_drm_private *priv) |
|---|