@@ -262,12 +262,40 @@ static void drawobj_sync_timeline_fence_work(struct irq_work *work)
262
262
kgsl_drawobj_put (& event -> syncobj -> base );
263
263
}
264
264
265
+ static void trace_syncpoint_timeline_fence (struct kgsl_drawobj_sync * syncobj ,
266
+ struct dma_fence * f , bool expire )
267
+ {
268
+ struct dma_fence_array * array = to_dma_fence_array (f );
269
+ struct dma_fence * * fences = & f ;
270
+ u32 num_fences = 1 ;
271
+ int i ;
272
+
273
+ if (array ) {
274
+ num_fences = array -> num_fences ;
275
+ fences = array -> fences ;
276
+ }
277
+
278
+ for (i = 0 ; i < num_fences ; i ++ ) {
279
+ char fence_name [KGSL_FENCE_NAME_LEN ];
280
+
281
+ snprintf (fence_name , sizeof (fence_name ), "%s:%llu" ,
282
+ fences [i ]-> ops -> get_timeline_name (fences [i ]),
283
+ fences [i ]-> seqno );
284
+ if (expire )
285
+ trace_syncpoint_fence_expire (syncobj , fence_name );
286
+ else
287
+ trace_syncpoint_fence (syncobj , fence_name );
288
+ }
289
+ }
290
+
265
291
static void drawobj_sync_timeline_fence_callback (struct dma_fence * f ,
266
292
struct dma_fence_cb * cb )
267
293
{
268
294
struct kgsl_drawobj_sync_event * event = container_of (cb ,
269
295
struct kgsl_drawobj_sync_event , cb );
270
296
297
+ trace_syncpoint_timeline_fence (event -> syncobj , f , true);
298
+
271
299
/*
272
300
* Mark the event as synced and then fire off a worker to handle
273
301
* removing the fence
@@ -494,9 +522,11 @@ static int drawobj_add_sync_timeline(struct kgsl_device *device,
494
522
}
495
523
496
524
kgsl_drawobj_put (drawobj );
525
+ return ret ;
497
526
}
498
527
499
- return ret ;
528
+ trace_syncpoint_timeline_fence (event -> syncobj , event -> fence , false);
529
+ return 0 ;
500
530
}
501
531
502
532
static int drawobj_add_sync_fence (struct kgsl_device * device ,
0 commit comments