@@ -410,6 +410,8 @@ static int hwc_set(struct hwc_composer_device_1* dev,size_t numDisplays,
410
410
}
411
411
412
412
hwc_display_contents_1_t * contents = displays[HWC_DISPLAY_PRIMARY];
413
+ size_t fb_target = -1 ;
414
+ int err = 0 ;
413
415
414
416
if (pdev->display ->geo_changed ) {
415
417
for (auto it = pdev->display ->buffer_map .begin (); it != pdev->display ->buffer_map .end (); it++) {
@@ -470,7 +472,7 @@ static int hwc_set(struct hwc_composer_device_1* dev,size_t numDisplays,
470
472
}
471
473
472
474
property_set (" waydroid.open_windows" , " 0" );
473
- return 0 ;
475
+ goto sync ;
474
476
} else if (active_apps == " Waydroid" ) {
475
477
// Clear all open windows if there's any and just keep "Waydroid"
476
478
if (pdev->windows .find (active_apps) == pdev->windows .end () || !pdev->windows [active_apps]->isActive ) {
@@ -527,7 +529,7 @@ static int hwc_set(struct hwc_composer_device_1* dev,size_t numDisplays,
527
529
}
528
530
529
531
property_set (" waydroid.open_windows" , " 0" );
530
- return 0 ;
532
+ goto sync ;
531
533
}
532
534
bool shouldCloseLeftover = true ;
533
535
for (auto it = pdev->windows .cbegin (); it != pdev->windows .cend ();) {
@@ -595,7 +597,6 @@ static int hwc_set(struct hwc_composer_device_1* dev,size_t numDisplays,
595
597
}
596
598
}
597
599
598
- size_t fb_target = -1 ;
599
600
for (size_t l = 0 ; l < contents->numHwLayers ; l++) {
600
601
hwc_layer_1_t * fb_layer = &contents->hwLayers [l];
601
602
if (fb_layer->compositionType == HWC_FRAMEBUFFER_TARGET) {
@@ -604,7 +605,6 @@ static int hwc_set(struct hwc_composer_device_1* dev,size_t numDisplays,
604
605
}
605
606
}
606
607
607
- int err = 0 ;
608
608
for (size_t l = 0 ; l < contents->numHwLayers ; l++) {
609
609
size_t layer = l;
610
610
if (l == skipped.first && fb_target >= 0 ) {
@@ -881,6 +881,7 @@ static int hwc_set(struct hwc_composer_device_1* dev,size_t numDisplays,
881
881
wl_surface_commit (it->second ->surface );
882
882
wl_display_flush (pdev->display ->display );
883
883
884
+ sync :
884
885
sw_sync_timeline_inc (pdev->timeline_fd , 1 );
885
886
contents->retireFenceFd = sw_sync_fence_create (pdev->timeline_fd , " hwc_contents_release" , ++pdev->next_sync_point );
886
887
0 commit comments