Re: [PATCH v2 3/3] modetest: Add a command line parameter to select the driver

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Monday 11 February 2013 21:13:45 Laurent Pinchart wrote:
> If the -M parameter is specific, modetest will use the requested device
> name instead of trying its builtin list of device names.
> 
> Signed-off-by: Laurent Pinchart <laurent.pinchart@xxxxxxxxxxxxxxxx>
> ---
>  tests/modetest/modetest.c | 41 ++++++++++++++++++++++++++++-------------
>  1 file changed, 28 insertions(+), 13 deletions(-)
> 
> diff --git a/tests/modetest/modetest.c b/tests/modetest/modetest.c
> index 34457e2..9a2d1f8 100644
> --- a/tests/modetest/modetest.c
> +++ b/tests/modetest/modetest.c

[snip]

> @@ -989,14 +996,27 @@ int main(int argc, char **argv)
>  	if (argc == 1)
>  		encoders = connectors = crtcs = planes = modes = framebuffers = 1;
> 
> -	for (i = 0; i < ARRAY_SIZE(modules); i++) {
> -		printf("trying to load module %s...", modules[i]);
> -		fd = drmOpen(modules[i], NULL);
> +	if (module) {
> +		fd = drmOpen(module, NULL);
>  		if (fd < 0) {
> -			printf("failed.\n");
> -		} else {
> -			printf("success.\n");
> -			break;
> +			fprintf(stderr, "failed to open device '%s'.\n", module);
> +			return 1;
> +		}
> +	} else {
> +		for (i = 0; i < ARRAY_SIZE(modules); i++) {
> +			printf("trying to open device '%s'...", modules[i]);
> +			fd = drmOpen(modules[i], NULL);
> +			if (fd < 0) {
> +				printf("failed.\n");
> +			} else {
> +				printf("success.\n");
> +				break;
> +			}
> +		}
> +
> +		if (fd < 0) {
> +			fprintf(stderr, "no device found.\n", module);

I should sleep before sending patches... Sorry for the noise, v3 will fix 
that.

> +			return 1;
>  		}
>  	}

-- 
Regards,

Laurent Pinchart

_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/dri-devel


[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux