mirror of
https://gitlab.freedesktop.org/emersion/libliftoff.git
synced 2025-01-18 10:27:00 +01:00
Fix early bailout when we already have a better allocation
In case we can't do better than the current best allocation even if we manage to allocate all remaining planes, we bail out early. However the bailout condition was incorrect and didn't account for the current score.
This commit is contained in:
parent
1509e50fd5
commit
fc901d0e26
1 changed files with 1 additions and 1 deletions
|
@ -322,7 +322,7 @@ bool output_choose_layers(struct hwc_output *output, struct plane_alloc *alloc,
|
|||
next_data.alloc = data->alloc;
|
||||
|
||||
remaining_planes = alloc->planes_len - data->plane_idx;
|
||||
if (alloc->best_score >= (int)remaining_planes) {
|
||||
if (alloc->best_score >= data->score + (int)remaining_planes) {
|
||||
/* Even if we find a layer for all remaining planes, we won't
|
||||
* find a better allocation. Give up. */
|
||||
return true;
|
||||
|
|
Loading…
Reference in a new issue