hc
2024-05-10 61598093bbdd283a7edc367d900f223070ead8d2
kernel/drivers/gpu/arm/bifrost/tl/backend/mali_kbase_timeline_csf.c
....@@ -25,6 +25,8 @@
2525
2626 #include <mali_kbase.h>
2727
28
+#define GPU_FEATURES_CROSS_STREAM_SYNC_MASK (1ull << 3ull)
29
+
2830 void kbase_create_timeline_objects(struct kbase_device *kbdev)
2931 {
3032 unsigned int as_nr;
....@@ -33,6 +35,21 @@
3335 struct kbase_timeline *timeline = kbdev->timeline;
3436 struct kbase_tlstream *summary =
3537 &kbdev->timeline->streams[TL_STREAM_TYPE_OBJ_SUMMARY];
38
+ u32 const kbdev_has_cross_stream_sync =
39
+ (kbdev->gpu_props.props.raw_props.gpu_features &
40
+ GPU_FEATURES_CROSS_STREAM_SYNC_MASK) ?
41
+ 1 :
42
+ 0;
43
+ u32 const arch_maj = (kbdev->gpu_props.props.raw_props.gpu_id &
44
+ GPU_ID2_ARCH_MAJOR) >>
45
+ GPU_ID2_ARCH_MAJOR_SHIFT;
46
+ u32 const num_sb_entries = arch_maj >= 11 ? 16 : 8;
47
+ u32 const supports_gpu_sleep =
48
+#ifdef KBASE_PM_RUNTIME
49
+ kbdev->pm.backend.gpu_sleep_supported;
50
+#else
51
+ false;
52
+#endif /* KBASE_PM_RUNTIME */
3653
3754 /* Summarize the Address Space objects. */
3855 for (as_nr = 0; as_nr < kbdev->nr_hw_address_spaces; as_nr++)
....@@ -51,10 +68,11 @@
5168 kbdev);
5269
5370 /* Trace the creation of a new kbase device and set its properties. */
54
- __kbase_tlstream_tl_kbase_new_device(summary,
55
- kbdev->gpu_props.props.raw_props.gpu_id,
56
- kbdev->gpu_props.num_cores, kbdev->csf.global_iface.group_num,
57
- kbdev->nr_hw_address_spaces);
71
+ __kbase_tlstream_tl_kbase_new_device(summary, kbdev->gpu_props.props.raw_props.gpu_id,
72
+ kbdev->gpu_props.num_cores,
73
+ kbdev->csf.global_iface.group_num,
74
+ kbdev->nr_hw_address_spaces, num_sb_entries,
75
+ kbdev_has_cross_stream_sync, supports_gpu_sleep);
5876
5977 /* Lock the context list, to ensure no changes to the list are made
6078 * while we're summarizing the contexts and their contents.
....@@ -74,9 +92,10 @@
7492 kbdev->csf.scheduler.csg_slots[slot_i].resident_group;
7593
7694 if (group)
77
- __kbase_tlstream_tl_kbase_device_program_csg(summary,
95
+ __kbase_tlstream_tl_kbase_device_program_csg(
96
+ summary,
7897 kbdev->gpu_props.props.raw_props.gpu_id,
79
- group->handle, slot_i);
98
+ group->kctx->id, group->handle, slot_i, 0);
8099 }
81100
82101 /* Reset body stream buffers while holding the kctx lock.
....@@ -145,7 +164,7 @@
145164
146165 if (kcpu_queue)
147166 __kbase_tlstream_tl_kbase_new_kcpuqueue(
148
- body, kcpu_queue, kcpu_queue->kctx->id,
167
+ body, kcpu_queue, kcpu_queue->id, kcpu_queue->kctx->id,
149168 kcpu_queue->num_pending_cmds);
150169 }
151170