forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-05-13 9d77db3c730780c8ef5ccd4b66403ff5675cfe4e
kernel/drivers/gpu/drm/msm/msm_perf.c
....@@ -1,18 +1,7 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * Copyright (C) 2013 Red Hat
34 * 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/>.
165 */
176
187 /* For profiling, userspace can:
....@@ -26,6 +15,9 @@
2615 #ifdef CONFIG_DEBUG_FS
2716
2817 #include <linux/debugfs.h>
18
+#include <linux/uaccess.h>
19
+
20
+#include <drm/drm_file.h>
2921
3022 #include "msm_drv.h"
3123 #include "msm_gpu.h"
....@@ -205,7 +197,6 @@
205197 {
206198 struct msm_drm_private *priv = minor->dev->dev_private;
207199 struct msm_perf_state *perf;
208
- struct dentry *ent;
209200
210201 /* only create on first minor: */
211202 if (priv->perf)
....@@ -220,19 +211,9 @@
220211 mutex_init(&perf->read_lock);
221212 priv->perf = perf;
222213
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);
231216 return 0;
232
-
233
-fail:
234
- msm_perf_debugfs_cleanup(priv);
235
- return -1;
236217 }
237218
238219 void msm_perf_debugfs_cleanup(struct msm_drm_private *priv)