From: GitLab M. <git...@ke...> - 2022-05-09 13:13:55
|
tests/modeprint/modeprint.c | 2 +- tests/modetest/modetest.c | 2 +- tests/proptest/proptest.c | 2 +- xf86drm.c | 3 ++- 4 files changed, 5 insertions(+), 4 deletions(-) New commits: commit ae6d81da2093b139ece952913f8f00dcc26ce7b9 Author: Eleni Maria Stea <ele...@gm...> Date: Mon May 9 15:00:54 2022 +0300 tests/modeprint: fix argument type Replaced the type PRId64 with PRIu64 in a printf as the argument was unsigned to fix the related compiler warning. Signed-off-by: Eleni Maria Stea <ele...@gm...> Reviewed-by: Simon Ser <co...@em...> diff --git a/tests/modeprint/modeprint.c b/tests/modeprint/modeprint.c index 880269b0..9372ad92 100644 --- a/tests/modeprint/modeprint.c +++ b/tests/modeprint/modeprint.c @@ -113,7 +113,7 @@ static int printProperty(int fd, drmModeResPtr res, drmModePropertyPtr props, ui } else { for (j = 0; j < props->count_enums; j++) { - printf("\t\t%" PRId64" = %s\n", (uint64_t)props->enums[j].value, props->enums[j].name); + printf("\t\t%" PRIu64" = %s\n", (uint64_t)props->enums[j].value, props->enums[j].name); if (props->enums[j].value == value) name = props->enums[j].name; } commit 4caec56fb8ebfe475a83315a12941d80808f4dee Author: Eleni Maria Stea <ele...@gm...> Date: Mon May 9 14:59:37 2022 +0300 modeprint, modetest, proptest: cast __u64 to uint64_t It seems that __u64 values are defined differently across systems. In glibc it's defined as unsigned long, in Linux kernel headers (int-ll64.h) as unsigned long long, and on FreeBSD as uint64_t so it matches glibc. A temporal solution is to cast all __u64 values to uint64_t to avoid warnings on Linux, but ideally we'd like a better fix in the future. See also: https://gitlab.freedesktop.org/mesa/drm/-/merge_requests/212 for discussion. Signed-off-by: Eleni Maria Stea <ele...@gm...> diff --git a/tests/modeprint/modeprint.c b/tests/modeprint/modeprint.c index f424f19d..880269b0 100644 --- a/tests/modeprint/modeprint.c +++ b/tests/modeprint/modeprint.c @@ -113,7 +113,7 @@ static int printProperty(int fd, drmModeResPtr res, drmModePropertyPtr props, ui } else { for (j = 0; j < props->count_enums; j++) { - printf("\t\t%" PRId64 " = %s\n", props->enums[j].value, props->enums[j].name); + printf("\t\t%" PRId64" = %s\n", (uint64_t)props->enums[j].value, props->enums[j].name); if (props->enums[j].value == value) name = props->enums[j].name; } diff --git a/tests/modetest/modetest.c b/tests/modetest/modetest.c index 5fd22f79..d6ab9dc8 100644 --- a/tests/modetest/modetest.c +++ b/tests/modetest/modetest.c @@ -376,7 +376,7 @@ static void dump_prop(struct device *dev, drmModePropertyPtr prop, printf("\t\tenums:"); for (i = 0; i < prop->count_enums; i++) printf(" %s=%"PRIu64, prop->enums[i].name, - prop->enums[i].value); + (uint64_t)prop->enums[i].value); printf("\n"); } else if (drm_property_type_is(prop, DRM_MODE_PROP_BITMASK)) { printf("\t\tvalues:"); diff --git a/tests/proptest/proptest.c b/tests/proptest/proptest.c index 0ab0907d..88bed10b 100644 --- a/tests/proptest/proptest.c +++ b/tests/proptest/proptest.c @@ -127,7 +127,7 @@ dump_prop(uint32_t prop_id, uint64_t value) printf("\t\tenums:"); for (i = 0; i < prop->count_enums; i++) printf(" %s=%"PRIu64, prop->enums[i].name, - prop->enums[i].value); + (uint64_t)prop->enums[i].value); printf("\n"); } else if (drm_property_type_is(prop, DRM_MODE_PROP_BITMASK)) { printf("\t\tvalues:"); commit c907d4ade13a0ef883972f4bafdc94bc8c1f3573 Author: Eleni Maria Stea <ele...@gm...> Date: Mon May 9 14:56:11 2022 +0300 xf86drm.c: fix C99 warning Moved declaration to the top to resolve C99 compliance warning. Signed-off-by: Eleni Maria Stea <ele...@gm...> Reviewed-by: Simon Ser <co...@em...> diff --git a/xf86drm.c b/xf86drm.c index 5933e4bc..76fdfaab 100644 --- a/xf86drm.c +++ b/xf86drm.c @@ -261,6 +261,7 @@ drmGetAfbcFormatModifierNameFromArm(uint64_t modifier, FILE *fp) static bool drmGetAfrcFormatModifierNameFromArm(uint64_t modifier, FILE *fp) { + bool scan_layout; for (unsigned int i = 0; i < 2; ++i) { uint64_t coding_unit_block = (modifier >> (i * 4)) & AFRC_FORMAT_MOD_CU_SIZE_MASK; @@ -292,7 +293,7 @@ drmGetAfrcFormatModifierNameFromArm(uint64_t modifier, FILE *fp) } } - bool scan_layout = + scan_layout = (modifier & AFRC_FORMAT_MOD_LAYOUT_SCAN) == AFRC_FORMAT_MOD_LAYOUT_SCAN; if (scan_layout) { fprintf(fp, "SCAN"); |