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

Commit

Permalink
feat: log output relevant data
Browse files Browse the repository at this point in the history
Log the creation of outputs and simplify output-specific data on apply.
  • Loading branch information
romangg committed Feb 26, 2020
1 parent 32f8241 commit 4ff8682
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 17 deletions.
16 changes: 0 additions & 16 deletions alloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -571,21 +571,6 @@ static void log_reuse(struct liftoff_output *output)
output->alloc_reuse++;
}

static void log_no_reuse(struct liftoff_output *output)
{
if (!log_has(LIFTOFF_DEBUG)) {
return;
}

liftoff_log(LIFTOFF_DEBUG, "\nApply on output %p.", (void *) output);

if (output->alloc_reuse != 0) {
liftoff_log(LIFTOFF_DEBUG, "Stopped reusing previous plane allocation on output %p. "
"Had reused it %d times.", (void *) output, output->alloc_reuse);
output->alloc_reuse = 0;
}
}

bool liftoff_output_apply(struct liftoff_output *output, drmModeAtomicReq *req)
{
struct liftoff_device *device;
Expand All @@ -604,7 +589,6 @@ bool liftoff_output_apply(struct liftoff_output *output, drmModeAtomicReq *req)
log_reuse(output);
return true;
}
log_no_reuse(output);

output_log_layers(output);

Expand Down
13 changes: 12 additions & 1 deletion output.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,11 @@ struct liftoff_output *liftoff_output_create(struct liftoff_device *device,
return NULL;
}

liftoff_log(LIFTOFF_DEBUG, "Creating output for CRTC id: %"PRIu32 " index: %zu", crtc_id, crtc_index);

output = calloc(1, sizeof(*output));
if (output == NULL) {
liftoff_log_errno(LIFTOFF_ERROR, "calloc");
return NULL;
}
output->device = device;
Expand Down Expand Up @@ -63,7 +66,15 @@ void output_log_layers(struct liftoff_output *output) {
return;
}

liftoff_log(LIFTOFF_DEBUG, "Layers on CRTC %"PRIu32":", output->crtc_id);
liftoff_log(LIFTOFF_DEBUG, "\n== Apply request for output %"PRIu32" ==", output->crtc_id);

if (output->alloc_reuse != 0) {
liftoff_log(LIFTOFF_DEBUG, " Note: Reused previous plane allocation %d times.",
output->alloc_reuse);
output->alloc_reuse = 0;
}

liftoff_log(LIFTOFF_DEBUG, "Active layers:");

liftoff_list_for_each(layer, &output->layers, link) {
if (layer->force_composition) {
Expand Down

0 comments on commit 4ff8682

Please sign in to comment.