hc
2024-05-16 8d2a02b24d66aa359e83eebc1ed3c0f85367a1cb
kernel/drivers/gpu/arm/bifrost/mali_kbase_reset_gpu.h
....@@ -1,7 +1,7 @@
11 /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
22 /*
33 *
4
- * (C) COPYRIGHT 2019-2021 ARM Limited. All rights reserved.
4
+ * (C) COPYRIGHT 2019-2022 ARM Limited. All rights reserved.
55 *
66 * This program is free software and is provided to you under the terms of the
77 * GNU General Public License version 2 as published by the Free Software
....@@ -91,7 +91,8 @@
9191 * Refer to kbase_reset_gpu_prevent_and_wait() for more information.
9292 *
9393 * Return: 0 on success. -EAGAIN if a reset is currently happening. Other
94
- * negative error codes on failure.
94
+ * negative error codes on failure, where -ENOMEM indicates that GPU reset
95
+ * had failed.
9596 */
9697 int kbase_reset_gpu_try_prevent(struct kbase_device *kbdev);
9798
....@@ -143,9 +144,10 @@
143144 void kbase_reset_gpu_assert_failed_or_prevented(struct kbase_device *kbdev);
144145
145146 /**
146
- * Flags for kbase_prepare_to_reset_gpu
147
+ * RESET_FLAGS_NONE - Flags for kbase_prepare_to_reset_gpu
147148 */
148
-#define RESET_FLAGS_NONE ((unsigned int)0)
149
+#define RESET_FLAGS_NONE (0U)
150
+
149151 /* This reset should be treated as an unrecoverable error by HW counter logic */
150152 #define RESET_FLAGS_HWC_UNRECOVERABLE_ERROR ((unsigned int)(1 << 0))
151153
....@@ -168,7 +170,7 @@
168170 * kbase_prepare_to_reset_gpu - Prepare for resetting the GPU.
169171 * @kbdev: Device pointer
170172 * @flags: Bitfield indicating impact of reset (see flag defines)
171
-
173
+ *
172174 * Return: a boolean which should be interpreted as follows:
173175 * - true - Prepared for reset, kbase_reset_gpu should be called.
174176 * - false - Another thread is performing a reset, kbase_reset_gpu should
....@@ -235,6 +237,18 @@
235237 bool kbase_reset_gpu_is_active(struct kbase_device *kbdev);
236238
237239 /**
240
+ * kbase_reset_gpu_not_pending - Reports if the GPU reset isn't pending
241
+ *
242
+ * @kbdev: Device pointer
243
+ *
244
+ * Note that unless appropriate locks are held when using this function, the
245
+ * state could change immediately afterwards.
246
+ *
247
+ * Return: True if the GPU reset isn't pending.
248
+ */
249
+bool kbase_reset_gpu_is_not_pending(struct kbase_device *kbdev);
250
+
251
+/**
238252 * kbase_reset_gpu_wait - Wait for a GPU reset to complete
239253 * @kbdev: Device pointer
240254 *