Log number of candidate planes

This can be useful to figure out why liftoff_output_apply returns
an empty plane allocation.
This commit is contained in:
Simon Ser 2021-08-09 13:08:48 +02:00
parent 30ba835645
commit fe76702dfb

13
alloc.c
View file

@ -635,7 +635,7 @@ int liftoff_output_apply(struct liftoff_output *output, drmModeAtomicReq *req,
struct liftoff_layer *layer; struct liftoff_layer *layer;
struct alloc_result result; struct alloc_result result;
struct alloc_step step; struct alloc_step step;
size_t i; size_t i, candidate_planes;
int ret; int ret;
device = output->device; 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 /* Disable all planes we might use. Do it before building mappings to
to hit bandwidth limits because too many planes are enabled. */ * make sure not to hit bandwidth limits because too many planes are
* enabled. */
candidate_planes = 0;
liftoff_list_for_each(plane, &device->planes, link) { liftoff_list_for_each(plane, &device->planes, link) {
if (plane->layer == NULL) { if (plane->layer == NULL) {
candidate_planes++;
liftoff_log(LIFTOFF_DEBUG, liftoff_log(LIFTOFF_DEBUG,
"Disabling plane %"PRIu32, plane->id); "Disabling plane %"PRIu32, plane->id);
ret = plane_apply(plane, NULL, req); ret = plane_apply(plane, NULL, req);
@ -705,8 +708,8 @@ int liftoff_output_apply(struct liftoff_output *output, drmModeAtomicReq *req,
} }
liftoff_log(LIFTOFF_DEBUG, liftoff_log(LIFTOFF_DEBUG,
"Found plane allocation for output %p with score=%d:", "Found plane allocation for output %p (score: %d, candidate planes: %zu):",
(void *)output, result.best_score); (void *)output, result.best_score, candidate_planes);
/* Apply the best allocation */ /* Apply the best allocation */
i = 0; i = 0;