[Intel-gfx] [PATCH] Test the first mode if there is no preferred mode.

Paul Menzel paulepanter at users.sourceforge.net
Tue May 31 11:04:31 CEST 2011


Dear Hai,


Am Dienstag, den 31.05.2011, 17:24 -0400 schrieb Hai Lan:
> For a TV device, there  might be no preferred mode.

is that an error of the device or is this a driver “feature”?

> In this case, we can test the first mode.

Is a Signed-off-by line needed to get your patch accepted? You can add
it automatically passing `-s` to `git commit` or `git format-patch`.

> ---
>  tests/testdisplay.c |   13 ++++++++++---
>  1 files changed, 10 insertions(+), 3 deletions(-)
> 
> diff --git a/tests/testdisplay.c b/tests/testdisplay.c
> index 41a5753..ef194fe 100644
> --- a/tests/testdisplay.c
> +++ b/tests/testdisplay.c
> @@ -280,9 +280,16 @@ static void connector_find_preferred_mode(struct connector *c)
>  	}
>  
>  	if (!c->mode_valid) {
> -		fprintf(stderr, "failed to find any modes on connector %d\n",
> -			c->id);
> -		return;
> +		if (connector->count_modes > 0) {
> +			/* use the first mode as test mode */
> +			c->mode = connector->modes[0];
> +			c->mode_valid = 1;
> +		}
> +		else {
> +			fprintf(stderr, "failed to find any modes on connector %d\n",
> +				c->id);
> +			return;
> +		}
>  	}
>  
>  	/* Now get the encoder */

Reviewed-by: Paul Menzel <paulepanter at users.sourceforge.net>


Thanks,

Paul
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part
URL: <http://lists.freedesktop.org/archives/intel-gfx/attachments/20110531/b5c4739d/attachment.sig>


More information about the Intel-gfx mailing list