@@ -99,12 +99,35 @@ struct xe_eu_stall_data_pvc {
99
99
__u64 unused [6 ];
100
100
} __packed ;
101
101
102
+ /*
103
+ * EU stall data format for Xe2 arch GPUs (LNL, BMG).
104
+ */
105
+ struct xe_eu_stall_data_xe2 {
106
+ __u64 ip_addr :29 ; /* Bits 0 to 28 */
107
+ __u64 tdr_count :8 ; /* Bits 29 to 36 */
108
+ __u64 other_count :8 ; /* Bits 37 to 44 */
109
+ __u64 control_count :8 ; /* Bits 45 to 52 */
110
+ __u64 pipestall_count :8 ; /* Bits 53 to 60 */
111
+ __u64 send_count :8 ; /* Bits 61 to 68 */
112
+ __u64 dist_acc_count :8 ; /* Bits 69 to 76 */
113
+ __u64 sbid_count :8 ; /* Bits 77 to 84 */
114
+ __u64 sync_count :8 ; /* Bits 85 to 92 */
115
+ __u64 inst_fetch_count :8 ; /* Bits 93 to 100 */
116
+ __u64 active_count :8 ; /* Bits 101 to 108 */
117
+ __u64 ex_id :3 ; /* Bits 109 to 111 */
118
+ __u64 end_flag :1 ; /* Bit 112 */
119
+ __u64 unused_bits :15 ;
120
+ __u64 unused [6 ];
121
+ } __packed ;
122
+
102
123
static size_t xe_eu_stall_data_record_size (struct xe_device * xe )
103
124
{
104
125
size_t record_size = 0 ;
105
126
106
127
if (xe -> info .platform == XE_PVC )
107
128
record_size = sizeof (struct xe_eu_stall_data_pvc );
129
+ else if (GRAPHICS_VER (xe ) >= 20 )
130
+ record_size = sizeof (struct xe_eu_stall_data_xe2 );
108
131
109
132
xe_assert (xe , is_power_of_2 (record_size ));
110
133
@@ -345,10 +368,16 @@ static bool eu_stall_data_buf_poll(struct xe_eu_stall_data_stream *stream)
345
368
346
369
static void clear_dropped_eviction_line_bit (struct xe_gt * gt , u16 group , u16 instance )
347
370
{
371
+ struct xe_device * xe = gt_to_xe (gt );
348
372
u32 write_ptr_reg ;
349
373
350
- /* On PVC, the overflow bit has to be cleared by writing 1 to it. */
351
- write_ptr_reg = _MASKED_BIT_ENABLE (XEHPC_EUSTALL_REPORT_OVERFLOW_DROP );
374
+ /* On PVC, the overflow bit has to be cleared by writing 1 to it.
375
+ * On Xe2 and later GPUs, the bit has to be cleared by writing 0 to it.
376
+ */
377
+ if (GRAPHICS_VER (xe ) >= 20 )
378
+ write_ptr_reg = _MASKED_BIT_DISABLE (XEHPC_EUSTALL_REPORT_OVERFLOW_DROP );
379
+ else
380
+ write_ptr_reg = _MASKED_BIT_ENABLE (XEHPC_EUSTALL_REPORT_OVERFLOW_DROP );
352
381
353
382
xe_gt_mcr_unicast_write (gt , XEHPC_EUSTALL_REPORT , write_ptr_reg , group , instance );
354
383
}
@@ -785,7 +814,7 @@ static const struct file_operations fops_eu_stall = {
785
814
786
815
static inline bool has_eu_stall_sampling_support (struct xe_device * xe )
787
816
{
788
- return xe -> info .platform == XE_PVC ;
817
+ return xe -> info .platform == XE_PVC || GRAPHICS_VER ( xe ) >= 20 ;
789
818
}
790
819
791
820
static int xe_eu_stall_stream_open_locked (struct drm_device * dev ,
0 commit comments