Skip to content

Commit 48dd99a

Browse files
committed
hwcomposer: Always post contents fence
1 parent ade266e commit 48dd99a

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

hwcomposer/hwcomposer.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -410,6 +410,8 @@ static int hwc_set(struct hwc_composer_device_1* dev,size_t numDisplays,
410410
}
411411

412412
hwc_display_contents_1_t* contents = displays[HWC_DISPLAY_PRIMARY];
413+
size_t fb_target = -1;
414+
int err = 0;
413415

414416
if (pdev->display->geo_changed) {
415417
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,
470472
}
471473

472474
property_set("waydroid.open_windows", "0");
473-
return 0;
475+
goto sync;
474476
} else if (active_apps == "Waydroid") {
475477
// Clear all open windows if there's any and just keep "Waydroid"
476478
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,
527529
}
528530

529531
property_set("waydroid.open_windows", "0");
530-
return 0;
532+
goto sync;
531533
}
532534
bool shouldCloseLeftover = true;
533535
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,
595597
}
596598
}
597599

598-
size_t fb_target = -1;
599600
for (size_t l = 0; l < contents->numHwLayers; l++) {
600601
hwc_layer_1_t* fb_layer = &contents->hwLayers[l];
601602
if (fb_layer->compositionType == HWC_FRAMEBUFFER_TARGET) {
@@ -604,7 +605,6 @@ static int hwc_set(struct hwc_composer_device_1* dev,size_t numDisplays,
604605
}
605606
}
606607

607-
int err = 0;
608608
for (size_t l = 0; l < contents->numHwLayers; l++) {
609609
size_t layer = l;
610610
if (l == skipped.first && fb_target >= 0) {
@@ -881,6 +881,7 @@ static int hwc_set(struct hwc_composer_device_1* dev,size_t numDisplays,
881881
wl_surface_commit(it->second->surface);
882882
wl_display_flush(pdev->display->display);
883883

884+
sync:
884885
sw_sync_timeline_inc(pdev->timeline_fd, 1);
885886
contents->retireFenceFd = sw_sync_fence_create(pdev->timeline_fd, "hwc_contents_release", ++pdev->next_sync_point);
886887

0 commit comments

Comments
 (0)