Skip to content

Commit

Permalink
hwcomposer: Always post contents fence
Browse files Browse the repository at this point in the history
  • Loading branch information
aleasto committed Jan 29, 2023
1 parent f53e314 commit 9eeaebb
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions hwcomposer/hwcomposer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -411,6 +411,8 @@ static int hwc_set(struct hwc_composer_device_1* dev,size_t numDisplays,
}

hwc_display_contents_1_t* contents = displays[HWC_DISPLAY_PRIMARY];
size_t fb_target = -1;
int err = 0;

if (pdev->display->geo_changed) {
for (auto it = pdev->display->buffer_map.begin(); it != pdev->display->buffer_map.end(); it++) {
Expand Down Expand Up @@ -469,7 +471,7 @@ static int hwc_set(struct hwc_composer_device_1* dev,size_t numDisplays,
}

property_set("waydroid.open_windows", "0");
return 0;
goto sync;
} else if (active_apps == "Waydroid") {
// Clear all open windows if there's any and just keep "Waydroid"
if (pdev->windows.find(active_apps) == pdev->windows.end() || !pdev->windows[active_apps]->isActive) {
Expand Down Expand Up @@ -526,7 +528,7 @@ static int hwc_set(struct hwc_composer_device_1* dev,size_t numDisplays,
}

property_set("waydroid.open_windows", "0");
return 0;
goto sync;
}
bool shouldCloseLeftover = true;
for (auto it = pdev->windows.cbegin(); it != pdev->windows.cend();) {
Expand Down Expand Up @@ -594,7 +596,6 @@ static int hwc_set(struct hwc_composer_device_1* dev,size_t numDisplays,
}
}

size_t fb_target = -1;
for (size_t l = 0; l < contents->numHwLayers; l++) {
hwc_layer_1_t* fb_layer = &contents->hwLayers[l];
if (fb_layer->compositionType == HWC_FRAMEBUFFER_TARGET) {
Expand All @@ -603,7 +604,6 @@ static int hwc_set(struct hwc_composer_device_1* dev,size_t numDisplays,
}
}

int err = 0;
for (size_t l = 0; l < contents->numHwLayers; l++) {
size_t layer = l;
if (l == skipped.first && fb_target >= 0) {
Expand Down Expand Up @@ -876,6 +876,7 @@ static int hwc_set(struct hwc_composer_device_1* dev,size_t numDisplays,
wl_surface_commit(it->second->surface);
wl_display_flush(pdev->display->display);

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

Expand Down

0 comments on commit 9eeaebb

Please sign in to comment.