feat: log type of assigned planes

Additionally 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 committed by Simon Ser
parent 80a31d0254
commit 06f05bf188
No known key found for this signature in database
GPG key ID: 0FDE7BE0E88F5E48

13
alloc.c
View file

@ -627,7 +627,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;
device = output->device;
@ -691,7 +691,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++;
@ -699,14 +700,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;