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.
This commit is contained in:
Roman Gilg 2020-02-26 12:45:33 +01:00 committed by Simon Ser
parent 6b2cbeb0d4
commit 71bd11377a
No known key found for this signature in database
GPG key ID: 0FDE7BE0E88F5E48

View file

@ -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++) {
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,
layer->props[i].name,
layer->props[i].value);
name, value >> 16);
} else {
liftoff_log(LIFTOFF_DEBUG, " %s = %"PRIu64,
name, value);
}
}
}
}