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:
Simon Ser 2019-12-19 17:49:18 +01:00
parent 799f694587
commit 53a7bfebc9
No known key found for this signature in database
GPG key ID: 0FDE7BE0E88F5E48
3 changed files with 11 additions and 0 deletions

View file

@ -418,6 +418,9 @@ bool output_choose_layers(struct liftoff_output *output,
if (layer->plane != NULL || layer->force_composition) { if (layer->plane != NULL || layer->force_composition) {
continue; continue;
} }
if (!layer_has_fb(layer)) {
continue; /* no FB set, nothing to display */
}
if (!check_layer_plane_compatible(step, layer, plane)) { if (!check_layer_plane_compatible(step, layer, plane)) {
continue; continue;
} }

View file

@ -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); bool layer_intersects(struct liftoff_layer *a, struct liftoff_layer *b);
void layer_mark_clean(struct liftoff_layer *layer); void layer_mark_clean(struct liftoff_layer *layer);
void layer_update_priority(struct liftoff_layer *layer, bool make_current); 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); struct liftoff_plane *plane_create(struct liftoff_device *device, uint32_t id);
void plane_destroy(struct liftoff_plane *plane); void plane_destroy(struct liftoff_plane *plane);

View file

@ -160,3 +160,10 @@ void layer_update_priority(struct liftoff_layer *layer, bool make_current) {
(void *)layer, layer->current_priority); (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;
}