@@ -276,8 +276,42 @@ struct mtk_ddp_comp *mtk_drm_ddp_comp_for_plane(struct drm_crtc *crtc,
276
276
#if IS_REACHABLE (CONFIG_MTK_CMDQ )
277
277
static void ddp_cmdq_cb (struct mbox_client * cl , void * mssg )
278
278
{
279
+ struct cmdq_cb_data * data = mssg ;
279
280
struct cmdq_client * cmdq_cl = container_of (cl , struct cmdq_client , client );
280
281
struct mtk_drm_crtc * mtk_crtc = container_of (cmdq_cl , struct mtk_drm_crtc , cmdq_client );
282
+ struct mtk_crtc_state * state ;
283
+ unsigned int i ;
284
+
285
+ if (data -> sta < 0 )
286
+ return ;
287
+
288
+ state = to_mtk_crtc_state (mtk_crtc -> base .state );
289
+
290
+ state -> pending_config = false;
291
+
292
+ if (mtk_crtc -> pending_planes ) {
293
+ for (i = 0 ; i < mtk_crtc -> layer_nr ; i ++ ) {
294
+ struct drm_plane * plane = & mtk_crtc -> planes [i ];
295
+ struct mtk_plane_state * plane_state ;
296
+
297
+ plane_state = to_mtk_plane_state (plane -> state );
298
+
299
+ plane_state -> pending .config = false;
300
+ }
301
+ mtk_crtc -> pending_planes = false;
302
+ }
303
+
304
+ if (mtk_crtc -> pending_async_planes ) {
305
+ for (i = 0 ; i < mtk_crtc -> layer_nr ; i ++ ) {
306
+ struct drm_plane * plane = & mtk_crtc -> planes [i ];
307
+ struct mtk_plane_state * plane_state ;
308
+
309
+ plane_state = to_mtk_plane_state (plane -> state );
310
+
311
+ plane_state -> pending .async_config = false;
312
+ }
313
+ mtk_crtc -> pending_async_planes = false;
314
+ }
281
315
282
316
mtk_crtc -> cmdq_vblank_cnt = 0 ;
283
317
}
@@ -433,7 +467,8 @@ static void mtk_crtc_ddp_config(struct drm_crtc *crtc,
433
467
state -> pending_vrefresh , 0 ,
434
468
cmdq_handle );
435
469
436
- state -> pending_config = false;
470
+ if (!cmdq_handle )
471
+ state -> pending_config = false;
437
472
}
438
473
439
474
if (mtk_crtc -> pending_planes ) {
@@ -453,9 +488,12 @@ static void mtk_crtc_ddp_config(struct drm_crtc *crtc,
453
488
mtk_ddp_comp_layer_config (comp , local_layer ,
454
489
plane_state ,
455
490
cmdq_handle );
456
- plane_state -> pending .config = false;
491
+ if (!cmdq_handle )
492
+ plane_state -> pending .config = false;
457
493
}
458
- mtk_crtc -> pending_planes = false;
494
+
495
+ if (!cmdq_handle )
496
+ mtk_crtc -> pending_planes = false;
459
497
}
460
498
461
499
if (mtk_crtc -> pending_async_planes ) {
@@ -475,9 +513,12 @@ static void mtk_crtc_ddp_config(struct drm_crtc *crtc,
475
513
mtk_ddp_comp_layer_config (comp , local_layer ,
476
514
plane_state ,
477
515
cmdq_handle );
478
- plane_state -> pending .async_config = false;
516
+ if (!cmdq_handle )
517
+ plane_state -> pending .async_config = false;
479
518
}
480
- mtk_crtc -> pending_async_planes = false;
519
+
520
+ if (!cmdq_handle )
521
+ mtk_crtc -> pending_async_planes = false;
481
522
}
482
523
}
483
524
0 commit comments