mirror of
https://gitlab.freedesktop.org/emersion/libliftoff.git
synced 2024-12-26 21:59:18 +01:00
Don't allocate planes for layers without a FB
When FB_ID is unet or zero, don't try to allocate a plane for the layer. There's nothing to display anyway.
This commit is contained in:
parent
799f694587
commit
53a7bfebc9
3 changed files with 11 additions and 0 deletions
3
alloc.c
3
alloc.c
|
@ -418,6 +418,9 @@ bool output_choose_layers(struct liftoff_output *output,
|
|||
if (layer->plane != NULL || layer->force_composition) {
|
||||
continue;
|
||||
}
|
||||
if (!layer_has_fb(layer)) {
|
||||
continue; /* no FB set, nothing to display */
|
||||
}
|
||||
if (!check_layer_plane_compatible(step, layer, plane)) {
|
||||
continue;
|
||||
}
|
||||
|
|
|
@ -84,6 +84,7 @@ void layer_get_rect(struct liftoff_layer *layer, struct liftoff_rect *rect);
|
|||
bool layer_intersects(struct liftoff_layer *a, struct liftoff_layer *b);
|
||||
void layer_mark_clean(struct liftoff_layer *layer);
|
||||
void layer_update_priority(struct liftoff_layer *layer, bool make_current);
|
||||
bool layer_has_fb(struct liftoff_layer *layer);
|
||||
|
||||
struct liftoff_plane *plane_create(struct liftoff_device *device, uint32_t id);
|
||||
void plane_destroy(struct liftoff_plane *plane);
|
||||
|
|
7
layer.c
7
layer.c
|
@ -160,3 +160,10 @@ void layer_update_priority(struct liftoff_layer *layer, bool make_current) {
|
|||
(void *)layer, layer->current_priority);
|
||||
}
|
||||
}
|
||||
|
||||
bool layer_has_fb(struct liftoff_layer *layer) {
|
||||
struct liftoff_layer_property *fb_id_prop;
|
||||
|
||||
fb_id_prop = layer_get_property(layer, "FB_ID");
|
||||
return fb_id_prop != NULL && fb_id_prop->value != 0;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue