[PATCH v4 08/21] modetest: Add a command line parameter to set properties

Laurent Pinchart laurent.pinchart at ideasonboard.com
Thu Mar 28 05:23:40 PDT 2013


On Tuesday 19 March 2013 15:55:49 Laurent Pinchart wrote:
> The -w parameter can be used to set a property value from the command
> line, using the target object ID and the property name.
> 
> Signed-off-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com>
> ---
>  tests/modetest/modetest.c | 108 ++++++++++++++++++++++++++++++++++++++++++-
>  1 file changed, 106 insertions(+), 2 deletions(-)
> 
> diff --git a/tests/modetest/modetest.c b/tests/modetest/modetest.c
> index f58c01d..7153a40 100644
> --- a/tests/modetest/modetest.c
> +++ b/tests/modetest/modetest.c

[snip]

> @@ -1122,6 +1210,19 @@ int main(int argc, char **argv)
>  		case 'v':
>  			test_vsync = 1;
>  			break;
> +		case 'w':
> +			prop_args = realloc(prop_args,
> +					   (prop_count + 1) * sizeof *prop_args);
> +			if (con_args == NULL) {

This should obviously be prop_args. I'll fix it in v5.

> +				fprintf(stderr, "memory allocation failed\n");
> +				return 1;
> +			}
> +
> +			if (parse_property(&prop_args[prop_count], optarg) < 0)
> +				usage(argv[0]);
> +
> +			prop_count++;
> +			break;
>  		default:
>  			usage(argv[0]);
>  			break;

-- 
Regards,

Laurent Pinchart



More information about the dri-devel mailing list