[PATCH libdrm 2/2] modetest: print signed values correctly

Emil Velikov emil.l.velikov at gmail.com
Mon Mar 28 21:12:29 UTC 2016


Hi Gustavo,

On 22 March 2016 at 21:42, Gustavo Padovan <gustavo at padovan.org> wrote:
> From: Gustavo Padovan <gustavo.padovan at collabora.co.uk>
>
> Signed-off-by: Gustavo Padovan <gustavo.padovan at collabora.co.uk>
> ---
>  tests/modetest/modetest.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/tests/modetest/modetest.c b/tests/modetest/modetest.c
> index a5ac5bd..21d5438 100644
> --- a/tests/modetest/modetest.c
> +++ b/tests/modetest/modetest.c
> @@ -314,6 +314,8 @@ static void dump_prop(struct device *dev, drmModePropertyPtr prop,
>         printf("\t\tvalue:");
>         if (drm_property_type_is(prop, DRM_MODE_PROP_BLOB))
>                 dump_blob(dev, value);
> +       else if (drm_property_type_is(prop, DRM_MODE_PROP_SIGNED_RANGE))
> +               printf(" %"PRId64"\n", value);
>         else
>                 printf(" %"PRIu64"\n", value);
Looks like proptest needs a similar fix. I'll push that alongside this patch.

A few suggestions for follow up work (in case you get bored)
 - factor dump_prop/blob into tests/util/kms.c and use it in proptest + modetest
 - prepend "current" or alike to "value". or any other way to make
"value" stand out from "values".
 - handle DRM_MODE_PROP_OBJECT :-)

Thanks
Emil


More information about the dri-devel mailing list