MALI: midgard: RK: add separate src dir of Midgard driver for RK Linux device
[firefly-linux-kernel-4.4.55.git] / drivers / gpu / arm / midgard_for_linux / mali_kbase_mem_profile_debugfs.h
1 /*
2  *
3  * (C) COPYRIGHT 2012-2015 ARM Limited. All rights reserved.
4  *
5  * This program is free software and is provided to you under the terms of the
6  * GNU General Public License version 2 as published by the Free Software
7  * Foundation, and any use by you of this program is subject to the terms
8  * of such GNU licence.
9  *
10  * A copy of the licence is included with the program, and can also be obtained
11  * from Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
12  * Boston, MA  02110-1301, USA.
13  *
14  */
15
16
17
18
19
20 /**
21  * @file mali_kbase_mem_profile_debugfs.h
22  * Header file for mem profiles entries in debugfs
23  *
24  */
25
26 #ifndef _KBASE_MEM_PROFILE_DEBUGFS_H
27 #define _KBASE_MEM_PROFILE_DEBUGFS_H
28
29 #include <mali_kbase.h>
30 #include <linux/debugfs.h>
31 #include <linux/seq_file.h>
32
33 /**
34  * @brief Remove entry from Mali memory profile debugfs
35  */
36 void kbasep_mem_profile_debugfs_remove(struct kbase_context *kctx);
37
38 /**
39  * @brief Insert @p data to the debugfs file so it can be read by userspace
40  *
41  * The function takes ownership of @p data and frees it later when new data
42  * is inserted.
43  *
44  * If the debugfs entry corresponding to the @p kctx doesn't exist,
45  * an attempt will be made to create it.
46  *
47  * @param kctx The context whose debugfs file @p data should be inserted to
48  * @param data A NULL-terminated string to be inserted to the debugfs file,
49  *             without the trailing new line character
50  * @param size The length of the @p data string
51  * @return 0 if @p data inserted correctly
52  *         -EAGAIN in case of error
53  * @post @ref mem_profile_initialized will be set to @c true
54  *       the first time this function succeeds.
55  */
56 int kbasep_mem_profile_debugfs_insert(struct kbase_context *kctx, char *data,
57                                         size_t size);
58
59 #endif  /*_KBASE_MEM_PROFILE_DEBUGFS_H*/
60