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