mirror of
https://gitlab.freedesktop.org/emersion/libliftoff.git
synced 2024-12-25 21:59:11 +01:00
feat: log output relevant data
Log the creation of outputs and simplify output-specific data on apply.
This commit is contained in:
parent
afef092218
commit
31024f307e
2 changed files with 14 additions and 16 deletions
15
alloc.c
15
alloc.c
|
@ -568,20 +568,6 @@ static void log_reuse(struct liftoff_output *output)
|
|||
output->alloc_reused_counter++;
|
||||
}
|
||||
|
||||
static void log_no_reuse(struct liftoff_output *output)
|
||||
{
|
||||
liftoff_log(LIFTOFF_DEBUG, "Computing plane allocation on output %p",
|
||||
(void *)output);
|
||||
|
||||
if (output->alloc_reused_counter != 0) {
|
||||
liftoff_log(LIFTOFF_DEBUG,
|
||||
"Stopped reusing previous plane allocation on "
|
||||
"output %p (had reused it %d times)",
|
||||
(void *)output, output->alloc_reused_counter);
|
||||
output->alloc_reused_counter = 0;
|
||||
}
|
||||
}
|
||||
|
||||
bool liftoff_output_apply(struct liftoff_output *output, drmModeAtomicReq *req)
|
||||
{
|
||||
struct liftoff_device *device;
|
||||
|
@ -600,7 +586,6 @@ bool liftoff_output_apply(struct liftoff_output *output, drmModeAtomicReq *req)
|
|||
log_reuse(output);
|
||||
return true;
|
||||
}
|
||||
log_no_reuse(output);
|
||||
|
||||
output_log_layers(output);
|
||||
|
||||
|
|
15
output.c
15
output.c
|
@ -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;
|
||||
|
@ -63,7 +66,17 @@ 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_reused_counter != 0) {
|
||||
liftoff_log(LIFTOFF_DEBUG,
|
||||
" Note: Reused previous plane allocation %d times.",
|
||||
output->alloc_reused_counter);
|
||||
output->alloc_reused_counter = 0;
|
||||
}
|
||||
|
||||
liftoff_log(LIFTOFF_DEBUG, "Active layers:");
|
||||
|
||||
liftoff_list_for_each(layer, &output->layers, link) {
|
||||
if (layer->force_composition) {
|
||||
liftoff_log(LIFTOFF_DEBUG, " Layer %p "
|
||||
|
|
Loading…
Reference in a new issue