mirror of
https://gitlab.freedesktop.org/emersion/libliftoff.git
synced 2024-12-25 21:59:11 +01:00
Improve prop value pretty-printing in output_log_layers
Always print the sign when logging a signed value. Print the full floating point value when logging an fp16 prop. SRC_X amd SRC_Y are fp16 too.
This commit is contained in:
parent
6321e7c5aa
commit
7f07d398d1
1 changed files with 10 additions and 4 deletions
14
output.c
14
output.c
|
@ -68,6 +68,10 @@ bool liftoff_output_needs_composition(struct liftoff_output *output)
|
|||
return false;
|
||||
}
|
||||
|
||||
double fp16_to_double(uint64_t val) {
|
||||
return (double)(val >> 16) + (double)(val & 0xFFFF) / 0xFFFF;
|
||||
}
|
||||
|
||||
void output_log_layers(struct liftoff_output *output) {
|
||||
struct liftoff_layer *layer;
|
||||
size_t i;
|
||||
|
@ -98,12 +102,14 @@ void output_log_layers(struct liftoff_output *output) {
|
|||
|
||||
if (strcmp(name, "CRTC_X") == 0 ||
|
||||
strcmp(name, "CRTC_Y") == 0) {
|
||||
liftoff_log(LIFTOFF_DEBUG, " %s = %"PRIi32,
|
||||
liftoff_log(LIFTOFF_DEBUG, " %s = %+"PRIi32,
|
||||
name, (int32_t)value);
|
||||
} else if (strcmp(name, "SRC_W") == 0 ||
|
||||
} else if (strcmp(name, "SRC_X") == 0 ||
|
||||
strcmp(name, "SRC_Y") == 0 ||
|
||||
strcmp(name, "SRC_W") == 0 ||
|
||||
strcmp(name, "SRC_H") == 0) {
|
||||
liftoff_log(LIFTOFF_DEBUG, " %s = %"PRIu64,
|
||||
name, value >> 16);
|
||||
liftoff_log(LIFTOFF_DEBUG, " %s = %f",
|
||||
name, fp16_to_double(value));
|
||||
} else {
|
||||
liftoff_log(LIFTOFF_DEBUG, " %s = %"PRIu64,
|
||||
name, value);
|
||||
|
|
Loading…
Reference in a new issue