summaryrefslogtreecommitdiff
path: root/mali_kbase/mali_kbase.h
diff options
context:
space:
mode:
authorSidath Senanayake <sidaths@google.com>2021-02-05 01:51:51 +0000
committerSidath Senanayake <sidaths@google.com>2021-02-10 12:02:48 +0000
commite6fbaabd258bfe4cc3d75fa0bbeef0c6c5138740 (patch)
tree4531266fcab676cde143e57a056f24b94e218466 /mali_kbase/mali_kbase.h
parent56b86e48fffad349cccb1c3831a9cd58562abed6 (diff)
parent9748305a584b9f1f7705303ce6e33a5e8b923e60 (diff)
downloadgpu-e6fbaabd258bfe4cc3d75fa0bbeef0c6c5138740.tar.gz
Merge r29p0 from upstream into android-gs-pixel-mainline
This commit updates the Mali KMD to version r29p0 from commit 9748305a584b9f1f7705303ce6e33a5e8b923e60 Bug: 178778804 Change-Id: Ie20425d4ea5c1529e299ca9a0454a56afb0fba95
Diffstat (limited to 'mali_kbase/mali_kbase.h')
-rw-r--r--mali_kbase/mali_kbase.h39
1 files changed, 30 insertions, 9 deletions
diff --git a/mali_kbase/mali_kbase.h b/mali_kbase/mali_kbase.h
index c9d1d6e..d2346e1 100644
--- a/mali_kbase/mali_kbase.h
+++ b/mali_kbase/mali_kbase.h
@@ -1,6 +1,6 @@
/*
*
- * (C) COPYRIGHT 2010-2020 ARM Limited. All rights reserved.
+ * (C) COPYRIGHT ARM Limited. All rights reserved.
*
* This program is free software and is provided to you under the terms of the
* GNU General Public License version 2 as published by the Free Software
@@ -18,10 +18,27 @@
*
* SPDX-License-Identifier: GPL-2.0
*
+ *//* SPDX-License-Identifier: GPL-2.0 */
+/*
+ *
+ * (C) COPYRIGHT 2010-2020 ARM Limited. All rights reserved.
+ *
+ * This program is free software and is provided to you under the terms of the
+ * GNU General Public License version 2 as published by the Free Software
+ * Foundation, and any use by you of this program is subject to the terms
+ * of such GNU license.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, you can access it online at
+ * http://www.gnu.org/licenses/gpl-2.0.html.
+ *
*/
-
-
#ifndef _KBASE_H_
#define _KBASE_H_
@@ -38,7 +55,7 @@
#include <linux/mutex.h>
#include <linux/rwsem.h>
#include <linux/sched.h>
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0))
+#if (KERNEL_VERSION(4, 11, 0) <= LINUX_VERSION_CODE)
#include <linux/sched/mm.h>
#endif
#include <linux/slab.h>
@@ -94,11 +111,11 @@
#endif
#if MALI_USE_CSF
-/* Physical memory group ID for command stream frontend user I/O.
+/* Physical memory group ID for CSF user I/O.
*/
#define KBASE_MEM_GROUP_CSF_IO BASE_MEM_GROUP_DEFAULT
-/* Physical memory group ID for command stream frontend firmware.
+/* Physical memory group ID for CSF firmware.
*/
#define KBASE_MEM_GROUP_CSF_FW BASE_MEM_GROUP_DEFAULT
#endif
@@ -156,9 +173,9 @@ void kbase_release_device(struct kbase_device *kbdev);
* the flag @ref KBASE_REG_TILER_ALIGN_TOP (check the flags of the kbase
* region):
* - alignment offset is set to the difference between the kbase region
- * extent (converted from the original value in pages to bytes) and the kbase
+ * extension (converted from the original value in pages to bytes) and the kbase
* region initial_commit (also converted from the original value in pages to
- * bytes); alignment mask is set to the kbase region extent in bytes and
+ * bytes); alignment mask is set to the kbase region extension in bytes and
* decremented by 1.
*
* Return: if successful, address of the unmapped area aligned as required;
@@ -457,7 +474,11 @@ static inline bool kbase_pm_is_gpu_lost(struct kbase_device *kbdev)
static inline void kbase_pm_set_gpu_lost(struct kbase_device *kbdev,
bool gpu_lost)
{
- atomic_set(&kbdev->pm.gpu_lost, (gpu_lost ? 1 : 0));
+ const int new_val = (gpu_lost ? 1 : 0);
+ const int cur_val = atomic_xchg(&kbdev->pm.gpu_lost, new_val);
+
+ if (new_val != cur_val)
+ KBASE_KTRACE_ADD(kbdev, ARB_GPU_LOST, NULL, new_val);
}
#endif