Skip layer debug early

If the verbosity is low we can skip logging layer information early and do not
need to run the loop.
This commit is contained in:
Roman Gilg 2020-02-26 12:24:12 +01:00 committed by Simon Ser
parent d68b1fc8d7
commit 375a8123d2
No known key found for this signature in database
GPG key ID: 0FDE7BE0E88F5E48

View file

@ -59,6 +59,10 @@ void output_log_layers(struct liftoff_output *output) {
struct liftoff_layer *layer; struct liftoff_layer *layer;
size_t i; size_t i;
if (!log_has(LIFTOFF_DEBUG)) {
return;
}
liftoff_log(LIFTOFF_DEBUG, "Layers on CRTC %"PRIu32":", output->crtc_id); liftoff_log(LIFTOFF_DEBUG, "Layers on CRTC %"PRIu32":", output->crtc_id);
liftoff_list_for_each(layer, &output->layers, link) { liftoff_list_for_each(layer, &output->layers, link) {
liftoff_log(LIFTOFF_DEBUG, " Layer %p:", (void *)layer); liftoff_log(LIFTOFF_DEBUG, " Layer %p:", (void *)layer);