diff --git a/alloc.c b/alloc.c index 6f5526f..6bce50a 100644 --- a/alloc.c +++ b/alloc.c @@ -589,7 +589,7 @@ bool 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, j; bool compatible; device = output->device; @@ -662,7 +662,8 @@ bool liftoff_output_apply(struct liftoff_output *output, drmModeAtomicReq *req) "score=%d:", (void *)output, result.best_score); /* Apply the best allocation */ - i = 0; + liftoff_log(LIFTOFF_DEBUG, "Final assignment of layers to planes:"); + i = j = 0; liftoff_list_for_each(plane, &device->planes, link) { layer = result.best[i]; i++; @@ -670,14 +671,18 @@ bool liftoff_output_apply(struct liftoff_output *output, drmModeAtomicReq *req) continue; } - liftoff_log(LIFTOFF_DEBUG, " Layer %p -> plane %"PRIu32, - (void *)layer, plane->id); + j++; + liftoff_log(LIFTOFF_DEBUG, " [%zu] Layer %p -> plane %"PRIu32 + " (%s)", j, (void *)layer, plane->id, + plane->type == DRM_PLANE_TYPE_PRIMARY ? "primary" : + DRM_PLANE_TYPE_OVERLAY ? "overlay" : "cursor"); assert(plane->layer == NULL); assert(layer->plane == NULL); plane->layer = layer; layer->plane = plane; } + liftoff_log(LIFTOFF_DEBUG, "%s", i > 0 ? " " : " No planes assigned!"); if (!apply_current(device, req)) { return false;