mirror of
https://gitlab.freedesktop.org/emersion/libliftoff.git
synced 2024-12-25 21:59:11 +01:00
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:
parent
80a31d0254
commit
06f05bf188
1 changed files with 9 additions and 4 deletions
13
alloc.c
13
alloc.c
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue