summaryrefslogtreecommitdiffstats
path: root/src/broadcom/cle/v3d_decoder.c
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2018-06-27 15:16:05 -0700
committerEric Anholt <[email protected]>2018-07-30 14:29:01 -0700
commit6237c6404941e81ce5bde4dd350fad64564ba67b (patch)
tree6cf24149a5b41e897820d274325fbda68126df33 /src/broadcom/cle/v3d_decoder.c
parent8da47b7648f6e785bb0f177d1c3824ca0e1792a4 (diff)
v3d: Print CLIF fixed-point values as just their decimal value.
The parser doesn't handle float input, so we have to dump the raw value.
Diffstat (limited to 'src/broadcom/cle/v3d_decoder.c')
-rw-r--r--src/broadcom/cle/v3d_decoder.c22
1 files changed, 16 insertions, 6 deletions
diff --git a/src/broadcom/cle/v3d_decoder.c b/src/broadcom/cle/v3d_decoder.c
index 084fc64d365..c1e9e50a247 100644
--- a/src/broadcom/cle/v3d_decoder.c
+++ b/src/broadcom/cle/v3d_decoder.c
@@ -925,14 +925,24 @@ v3d_field_iterator_next(struct clif_dump *clif, struct v3d_field_iterator *iter)
iter->field->type.v3d_struct->name);
break;
case V3D_TYPE_SFIXED:
- snprintf(iter->value, sizeof(iter->value), "%f",
- __gen_unpack_sfixed(iter->p, s, e,
- iter->field->type.f));
+ if (clif->pretty) {
+ snprintf(iter->value, sizeof(iter->value), "%f",
+ __gen_unpack_sfixed(iter->p, s, e,
+ iter->field->type.f));
+ } else {
+ snprintf(iter->value, sizeof(iter->value), "%u",
+ (unsigned)__gen_unpack_uint(iter->p, s, e));
+ }
break;
case V3D_TYPE_UFIXED:
- snprintf(iter->value, sizeof(iter->value), "%f",
- __gen_unpack_ufixed(iter->p, s, e,
- iter->field->type.f));
+ if (clif->pretty) {
+ snprintf(iter->value, sizeof(iter->value), "%f",
+ __gen_unpack_ufixed(iter->p, s, e,
+ iter->field->type.f));
+ } else {
+ snprintf(iter->value, sizeof(iter->value), "%u",
+ (unsigned)__gen_unpack_uint(iter->p, s, e));
+ }
break;
case V3D_TYPE_MBO:
break;