[PATCH] Take width into account when choosing default mode

Cyril Brulebois kibi at debian.org
Sun Nov 14 08:44:12 PST 2010


Hi,

some comments about the form follow.

Thierry Vignaud <thierry.vignaud at gmail.com> (14/11/2010):
>      int		    mm_height;
> +    int		    mm_width;
>      
>      mm_height = output->mm_height;
> +    mm_width = output->mm_width;
>      if (!mm_height)
>  	mm_height = (768 * 25.4) / DEFAULT_DPI;
> +    if (!mm_width)
> +	mm_width = 270;	/* 1024 pixels at 96dpi */

Should probably be that instead?
        mm_width = (1024 * 25.4) / DEFAULT_DPI;

>  	if (xf86ModeWidth (mode, output->initial_rotation) > width ||
>  	    xf86ModeHeight (mode, output->initial_rotation) > height)
> @@ -845,6 +849,11 @@ xf86DefaultMode (xf86OutputPtr output, int width, int height)
>  	dpi = (mode->VDisplay * 254) / (mm_height * 10);
>  	diff = dpi - DEFAULT_DPI;
>  	diff = diff < 0 ? -diff : diff;
> +
> +	dpi = (mode->HDisplay * 254) / (mm_width * 10);
> +	diff2 = dpi - 96;

s/96/DEFAULT_DPI/ again?

> -	    for (mode = output->probed_modes; mode; mode = mode->next)
> +	    DisplayModePtr next;
> +
> +	    for (mode = output->probed_modes; mode; mode = next)
>  	    {
> +		next = mode->next;

I'm not sure I get what this change is about?

Mraw,
KiBi.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.x.org/archives/xorg-devel/attachments/20101114/d17ba242/attachment.pgp>


More information about the xorg-devel mailing list