Log type of assigned planes

On apply log the type of planes in the final assignment for a direct overview
of the result.
This commit is contained in:
Roman Gilg 2020-02-27 00:08:01 +01:00
parent 950e100d7e
commit 3cb6cd04b5

13
alloc.c
View file

@ -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;