hc
2023-12-06 08f87f769b595151be1afeff53e144f543faa614
kernel/drivers/gpu/arm/bifrost/mali_kbase_jm.c
....@@ -1,7 +1,7 @@
11 // SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note
22 /*
33 *
4
- * (C) COPYRIGHT 2014-2021 ARM Limited. All rights reserved.
4
+ * (C) COPYRIGHT 2013-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
....@@ -37,15 +37,13 @@
3737 *
3838 * Return: true if slot can still be submitted on, false if slot is now full.
3939 */
40
-static bool kbase_jm_next_job(struct kbase_device *kbdev, int js,
41
- int nr_jobs_to_submit)
40
+static bool kbase_jm_next_job(struct kbase_device *kbdev, unsigned int js, int nr_jobs_to_submit)
4241 {
4342 struct kbase_context *kctx;
4443 int i;
4544
4645 kctx = kbdev->hwaccess.active_kctx[js];
47
- dev_dbg(kbdev->dev,
48
- "Trying to run the next %d jobs in kctx %pK (s:%d)\n",
46
+ dev_dbg(kbdev->dev, "Trying to run the next %d jobs in kctx %pK (s:%u)\n",
4947 nr_jobs_to_submit, (void *)kctx, js);
5048
5149 if (!kctx)
....@@ -60,7 +58,7 @@
6058 kbase_backend_run_atom(kbdev, katom);
6159 }
6260
63
- dev_dbg(kbdev->dev, "Slot ringbuffer should now be full (s:%d)\n", js);
61
+ dev_dbg(kbdev->dev, "Slot ringbuffer should now be full (s:%u)\n", js);
6462 return false;
6563 }
6664
....@@ -72,7 +70,7 @@
7270 dev_dbg(kbdev->dev, "JM kick slot mask 0x%x\n", js_mask);
7371
7472 while (js_mask) {
75
- int js = ffs(js_mask) - 1;
73
+ unsigned int js = ffs(js_mask) - 1;
7674 int nr_jobs_to_submit = kbase_backend_slot_free(kbdev, js);
7775
7876 if (kbase_jm_next_job(kbdev, js, nr_jobs_to_submit))
....@@ -111,14 +109,14 @@
111109
112110 void kbase_jm_idle_ctx(struct kbase_device *kbdev, struct kbase_context *kctx)
113111 {
114
- int js;
112
+ unsigned int js;
115113
116114 lockdep_assert_held(&kbdev->hwaccess_lock);
117115
118116 for (js = 0; js < BASE_JM_MAX_NR_SLOTS; js++) {
119117 if (kbdev->hwaccess.active_kctx[js] == kctx) {
120
- dev_dbg(kbdev->dev, "Marking kctx %pK as inactive (s:%d)\n",
121
- (void *)kctx, js);
118
+ dev_dbg(kbdev->dev, "Marking kctx %pK as inactive (s:%u)\n", (void *)kctx,
119
+ js);
122120 kbdev->hwaccess.active_kctx[js] = NULL;
123121 }
124122 }
....@@ -132,13 +130,17 @@
132130 dev_dbg(kbdev->dev, "Atom %pK is returning with event code 0x%x\n",
133131 (void *)katom, katom->event_code);
134132
133
+ KBASE_KTRACE_ADD_JM(kbdev, JM_RETURN_ATOM_TO_JS, katom->kctx, katom,
134
+ katom->jc, katom->event_code);
135
+
135136 if (katom->event_code != BASE_JD_EVENT_STOPPED &&
136137 katom->event_code != BASE_JD_EVENT_REMOVED_FROM_NEXT) {
137138 return kbase_js_complete_atom(katom, NULL);
138
- } else {
139
- kbase_js_unpull(katom->kctx, katom);
140
- return NULL;
141139 }
140
+
141
+ kbase_js_unpull(katom->kctx, katom);
142
+
143
+ return NULL;
142144 }
143145
144146 struct kbase_jd_atom *kbase_jm_complete(struct kbase_device *kbdev,