Force re-alloc when previous FB_ID was 0

This commit is contained in:
Simon Ser 2020-12-05 12:34:25 +01:00
parent b936348acc
commit 89b37acd98
No known key found for this signature in database
GPG key ID: 0FDE7BE0E88F5E48

12
alloc.c
View file

@ -503,15 +503,15 @@ static bool layer_needs_realloc(struct liftoff_layer *layer)
/* If FB_ID changes from non-zero to zero, we don't need to
* display this layer anymore, so we may be able to re-use its
* plane for another layer. If FB_ID changes from
* non-zero to non-zero, we can try to re-use the previous
* allocation. */
* plane for another layer. If FB_ID changes from zero to
* non-zero, we might be able to find a plane for this layer.
* If FB_ID changes from non-zero to non-zero, we can try to
* re-use the previous allocation. */
if (strcmp(prop->name, "FB_ID") == 0) {
if (prop->value == 0) {
if (prop->value == 0 || prop->prev_value == 0) {
return true;
}
/* TODO: check format/modifier is the same. Check
* previous value isn't zero. */
/* TODO: check format/modifier is the same? */
continue;
}