From 71bd11377a0cc05a8a887a4319a64b8e524c6e33 Mon Sep 17 00:00:00 2001 From: Roman Gilg Date: Wed, 26 Feb 2020 12:45:33 +0100 Subject: [PATCH] Respect implicit type on layer props log The CRTC_X and CRTC_Y values can be negative. Log respectively. Additionally the SRC_W and SRC_H values are shifted. Shift these values back for the log. --- output.c | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/output.c b/output.c index a070165..1c2b56b 100644 --- a/output.c +++ b/output.c @@ -67,9 +67,21 @@ void output_log_layers(struct liftoff_output *output) { liftoff_list_for_each(layer, &output->layers, link) { liftoff_log(LIFTOFF_DEBUG, " Layer %p:", (void *)layer); for (i = 0; i < layer->props_len; i++) { - liftoff_log(LIFTOFF_DEBUG, " %s = %"PRIu64, - layer->props[i].name, - layer->props[i].value); + char *name = layer->props[i].name; + uint64_t value = layer->props[i].value; + + if (strcmp(name, "CRTC_X") == 0 || + strcmp(name, "CRTC_Y") == 0) { + liftoff_log(LIFTOFF_DEBUG, " %s = %"PRIi32, + name, (int32_t)value); + } else if (strcmp(name, "SRC_W") == 0 || + strcmp(name, "SRC_H") == 0) { + liftoff_log(LIFTOFF_DEBUG, " %s = %"PRIu64, + name, value >> 16); + } else { + liftoff_log(LIFTOFF_DEBUG, " %s = %"PRIu64, + name, value); + } } } }