summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIlia Mirkin <imirkin@alum.mit.edu>2017-04-18 08:54:11 -0400
committerIlia Mirkin <imirkin@alum.mit.edu>2017-04-19 23:25:43 -0400
commit691a21579962d2db2d5cb1de5286fa86ef22214f (patch)
tree756ecd430d16392d2400a83f52c2ec31b47d4a98
parent7cfcd5ef4b394f66c4a6fde705cf7c583a0b0c7b (diff)
modetest: fix printing of fourcc on BE machines
fourcc is not a string, it's a packed integer. This happens to work out on LE, but gets reversed on BE. Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu> Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
-rw-r--r--tests/modetest/modetest.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/tests/modetest/modetest.c b/tests/modetest/modetest.c
index c390d875..b8891ff5 100644
--- a/tests/modetest/modetest.c
+++ b/tests/modetest/modetest.c
@@ -174,6 +174,15 @@ static const char *mode_flag_names[] = {
static bit_name_fn(mode_flag)
+static void dump_fourcc(uint32_t fourcc)
+{
+ printf(" %c%c%c%c",
+ fourcc,
+ fourcc >> 8,
+ fourcc >> 16,
+ fourcc >> 24);
+}
+
static void dump_encoders(struct device *dev)
{
drmModeEncoder *encoder;
@@ -443,7 +452,7 @@ static void dump_planes(struct device *dev)
printf(" formats:");
for (j = 0; j < ovr->count_formats; j++)
- printf(" %4.4s", (char *)&ovr->formats[j]);
+ dump_fourcc(ovr->formats[j]);
printf("\n");
if (plane->props) {