summaryrefslogtreecommitdiff
path: root/mali_kbase/mali_kbase_defs.h
diff options
context:
space:
mode:
authorAnkit Goyal <layog@google.com>2021-07-08 20:31:53 +0800
committerAnkit Goyal <layog@google.com>2021-07-21 21:11:46 +0800
commitced6904b8892e23333566105d5266515532a9c2c (patch)
treee51c0d47a79fe4f893564c242de494029e49e71f /mali_kbase/mali_kbase_defs.h
parentb2f3e45b252b412e220522adb6cf720ed2f1a4ae (diff)
downloadgpu-ced6904b8892e23333566105d5266515532a9c2c.tar.gz
mali_kbase: platform: Add per-process and global accounting for dma-buf pages
This adds dma_buf_pages alongside total_gpu_pages to track GPU addressable dmabuf pages for each process and for complete device. Bug: 191966412 Signed-off-by: Ankit Goyal <layog@google.com> Change-Id: I29da69e469395d30e784ea9c2ffddcf6fab688fd
Diffstat (limited to 'mali_kbase/mali_kbase_defs.h')
-rw-r--r--mali_kbase/mali_kbase_defs.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/mali_kbase/mali_kbase_defs.h b/mali_kbase/mali_kbase_defs.h
index 13bba29..97c03cd 100644
--- a/mali_kbase/mali_kbase_defs.h
+++ b/mali_kbase/mali_kbase_defs.h
@@ -617,6 +617,9 @@ struct kbase_devfreq_queue_info {
* @total_gpu_pages: Total gpu pages allocated across all the contexts
* of this process, it accounts for both native allocations
* and dma_buf imported allocations.
+ * @dma_buf_pages: Total dma_buf pages allocated across all the contexts
+ * of this process, native allocations can be accounted for
+ * by subtracting this from &total_gpu_pages.
* @kctx_list: List of kbase contexts created for the process.
* @kprcs_node: Node to a rb_tree, kbase_device will maintain a rb_tree
* based on key tgid, kprcs_node is the node link to
@@ -630,6 +633,7 @@ struct kbase_devfreq_queue_info {
struct kbase_process {
pid_t tgid;
size_t total_gpu_pages;
+ size_t dma_buf_pages;
struct list_head kctx_list;
struct rb_node kprcs_node;
@@ -926,6 +930,7 @@ struct kbase_process {
* mapping and gpu memory usage at device level and
* other one at process level.
* @total_gpu_pages: Total GPU pages used for the complete GPU device.
+ * @dma_buf_pages: Total dma_buf pages used for GPU platform device.
* @dma_buf_lock: This mutex should be held while accounting for
* @total_gpu_pages from imported dma buffers.
* @gpu_mem_usage_lock: This spinlock should be held while accounting
@@ -1206,6 +1211,7 @@ struct kbase_device {
struct rb_root dma_buf_root;
size_t total_gpu_pages;
+ size_t dma_buf_pages;
struct mutex dma_buf_lock;
spinlock_t gpu_mem_usage_lock;