Skip to content
This repository has been archived by the owner on Oct 25, 2021. It is now read-only.

Commit

Permalink
feat: indent log on property applying and layer assignment
Browse files Browse the repository at this point in the history
Indent when applying properties and assigning the layers. The log is better to
read this way. Example:

Apply on output 0x55c447db2b50.
Layers on CRTC 62:
  Layer 0x55c447db2a40:
    FB_ID = 108
    zpos = 0
    alpha = 65535
    SRC_X = 0
    SRC_Y = 0
    SRC_W = 3840
    SRC_H = 2160
    CRTC_X = 0
    CRTC_Y = 0
    CRTC_W = 3840
    CRTC_H = 2160
Disabling planes: 55 52 49 46 43 40 71 69 67 65 63 61 58
Performing allocation for plane 55 (1/13)
  Layer 0x55c447db2a40 -> plane 55: applying properties...
  Layer 0x55c447db2a40 -> plane 55: incompatible properties
Performing allocation for plane 61 (12/13)
  Layer 0x55c447db2a40 -> plane 61: applying properties...
  Layer 0x55c447db2a40 -> plane 61: incompatible properties
Performing allocation for plane 58 (13/13)
  Layer 0x55c447db2a40 -> plane 58: applying properties...
  Layer 0x55c447db2a40 -> plane 58: success
Found a better allocation with score=1
Found plane allocation for output 0x55c447db2b50 with score=1
Assigning layers to planes:
  Layer 0x55c447db2a40 -> plane 58
  • Loading branch information
romangg committed Feb 26, 2020
1 parent d99499e commit 9668bb3
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions alloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -406,15 +406,15 @@ bool output_choose_layers(struct liftoff_output *output,
}

/* Try to use this layer for the current plane */
liftoff_log(LIFTOFF_DEBUG, "Layer %p -> plane %"PRIu32": "
liftoff_log(LIFTOFF_DEBUG, " Layer %p -> plane %"PRIu32": "
"applying properties...",
(void *)layer, plane->id);
if (!plane_apply(plane, layer, result->req, &compatible)) {
return false;
}
if (!compatible) {
liftoff_log(LIFTOFF_DEBUG,
"Layer %p -> plane %"PRIu32": "
" Layer %p -> plane %"PRIu32": "
"incompatible properties",
(void *)layer, plane->id);
continue;
Expand All @@ -425,7 +425,7 @@ bool output_choose_layers(struct liftoff_output *output,
}
if (compatible) {
liftoff_log(LIFTOFF_DEBUG,
"Layer %p -> plane %"PRIu32": success",
" Layer %p -> plane %"PRIu32": success",
(void *)layer, plane->id);
/* Continue with the next plane */
plane_step_init_next(&next_step, step, layer);
Expand Down Expand Up @@ -667,6 +667,7 @@ bool liftoff_output_apply(struct liftoff_output *output, drmModeAtomicReq *req)
"score=%d", (void *)output, result.best_score);

/* Apply the best allocation */
liftoff_log(LIFTOFF_DEBUG, "Assigning layers to planes:");
i = 0;
liftoff_list_for_each(plane, &device->planes, link) {
layer = result.best[i];
Expand All @@ -675,8 +676,7 @@ bool liftoff_output_apply(struct liftoff_output *output, drmModeAtomicReq *req)
continue;
}

liftoff_log(LIFTOFF_DEBUG,
"Assigning layer %p to plane %"PRIu32,
liftoff_log(LIFTOFF_DEBUG, " Layer %p -> plane %"PRIu32,
(void *)layer, plane->id);

assert(plane->layer == NULL);
Expand All @@ -685,6 +685,8 @@ bool liftoff_output_apply(struct liftoff_output *output, drmModeAtomicReq *req)
layer->plane = plane;
}

liftoff_log(LIFTOFF_DEBUG, "");

if (!apply_current(device, req)) {
return false;
}
Expand Down

0 comments on commit 9668bb3

Please sign in to comment.