mirror of
https://gitlab.freedesktop.org/emersion/libliftoff.git
synced 2024-12-26 21:59:18 +01:00
Log re-use only on change
On debug verbosity logging every reuse of planes is spamming the log making it difficult to debug the process. With this patch only the change of reusing the same allocation is logged and how often the allocation was reused after this changed back again.
This commit is contained in:
parent
7f5b699f2c
commit
b713b17d31
2 changed files with 28 additions and 1 deletions
27
alloc.c
27
alloc.c
|
@ -558,6 +558,30 @@ static void update_layers_priority(struct liftoff_device *device)
|
|||
}
|
||||
}
|
||||
|
||||
static void log_reuse(struct liftoff_output *output)
|
||||
{
|
||||
if (output->alloc_reused_counter == 0) {
|
||||
liftoff_log(LIFTOFF_DEBUG,
|
||||
"Reusing previous plane allocation on output %p",
|
||||
(void *)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;
|
||||
|
@ -573,9 +597,10 @@ bool liftoff_output_apply(struct liftoff_output *output, drmModeAtomicReq *req)
|
|||
update_layers_priority(device);
|
||||
|
||||
if (reuse_previous_alloc(output, req)) {
|
||||
liftoff_log(LIFTOFF_DEBUG, "Re-using previous plane allocation");
|
||||
log_reuse(output);
|
||||
return true;
|
||||
}
|
||||
log_no_reuse(output);
|
||||
|
||||
output_log_layers(output);
|
||||
|
||||
|
|
|
@ -32,6 +32,8 @@ struct liftoff_output {
|
|||
struct liftoff_list layers; /* liftoff_layer.link */
|
||||
/* layer added or removed, or composition layer changed */
|
||||
bool layers_changed;
|
||||
|
||||
int alloc_reused_counter;
|
||||
};
|
||||
|
||||
struct liftoff_layer {
|
||||
|
|
Loading…
Reference in a new issue