From fe76702dfb428a9e4925244d1b59db326ef350a4 Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Mon, 9 Aug 2021 13:08:48 +0200 Subject: [PATCH] Log number of candidate planes This can be useful to figure out why liftoff_output_apply returns an empty plane allocation. --- alloc.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/alloc.c b/alloc.c index cf6fa72..d8cc472 100644 --- a/alloc.c +++ b/alloc.c @@ -635,7 +635,7 @@ int liftoff_output_apply(struct liftoff_output *output, drmModeAtomicReq *req, struct liftoff_layer *layer; struct alloc_result result; struct alloc_step step; - size_t i; + size_t i, candidate_planes; int ret; device = output->device; @@ -659,10 +659,13 @@ int liftoff_output_apply(struct liftoff_output *output, drmModeAtomicReq *req, } } - /* Disable all planes. Do it before building mappings to make sure not - to hit bandwidth limits because too many planes are enabled. */ + /* Disable all planes we might use. Do it before building mappings to + * make sure not to hit bandwidth limits because too many planes are + * enabled. */ + candidate_planes = 0; liftoff_list_for_each(plane, &device->planes, link) { if (plane->layer == NULL) { + candidate_planes++; liftoff_log(LIFTOFF_DEBUG, "Disabling plane %"PRIu32, plane->id); ret = plane_apply(plane, NULL, req); @@ -705,8 +708,8 @@ int liftoff_output_apply(struct liftoff_output *output, drmModeAtomicReq *req, } liftoff_log(LIFTOFF_DEBUG, - "Found plane allocation for output %p with score=%d:", - (void *)output, result.best_score); + "Found plane allocation for output %p (score: %d, candidate planes: %zu):", + (void *)output, result.best_score, candidate_planes); /* Apply the best allocation */ i = 0;