Re: [PATCH resent] Option to use DPI calculated from EDID

2016-01-04 Thread Michal Suchanek
Hello,

On 4 January 2016 at 00:26, Guillem Jover  wrote:
> Hi!
>
> On Mon, 2011-10-31 at 13:16:21 +0100, Michal Suchanek wrote:
>> It adds back functionality lost a few years ago which makes X
>> needlessly hard to use on devices that report correct DPI and aren't
>> 96 DPI which is the value unconditionally set since commit fff00d
>
> This affected me recently too when setting up a new laptop, quite
> annoying. Here's a quick review.

This seems to be no longer the case on recent Debian systems:

xdpyinfo | grep resol
  resolution:100x100 dots per inch

Screen 0: minimum 320 x 200, current 2560 x 1440, maximum 8192 x 8192
DisplayPort-0 connected primary 2560x1440+0+0 (normal left inverted
right x axis y axis) 597mm x 336mm

I am not sure where this comes from since the actual DPI seems to be
more like 109 rather than 100:

2560*25.4/597
108.91792
1440*25.4/336
108.85714

xdpyinfo | grep resol
  resolution:94x94 dots per inch

Screen 0: minimum 320 x 200, current 2400 x 1600, maximum 8192 x 8192
DVI-I-1 connected primary 1200x1600+1200+0 (normal left inverted right
x axis y axis) 324mm x 432mm
   1200x1600 59.96*+
HDMI-1 connected 1200x1600+0+0 left (normal left inverted right x axis
y axis) 408mm x 306mm
   1600x1200 60.00*+

Here 94 DPI is precise for the first display and the second 100 DPI
display is not taken into account:

1200*25.4/306
99.60784
1600*25.4/408
99.60784
1200*25.4/324
94.07407
1600*25.4/432
94.07407

Linux 3.16.0-4-amd64 #1 SMP Debian 3.16.7-ckt11-1+deb8u4
xserver-xorg-core 2:1.17.3-2
xserver-xorg-video-radeon 1:7.5.0-1+b1
xserver-xorg-video-nouveau1:1.0.12-1

Thanks

Michal
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Re: [PATCH resent] Option to use DPI calculated from EDID

2016-01-03 Thread Guillem Jover
Hi!

On Mon, 2011-10-31 at 13:16:21 +0100, Michal Suchanek wrote:
> It adds back functionality lost a few years ago which makes X
> needlessly hard to use on devices that report correct DPI and aren't
> 96 DPI which is the value unconditionally set since commit fff00d

This affected me recently too when setting up a new laptop, quite
annoying. Here's a quick review.

> From 33a200fa5b670a9e479e8d9be533ec1112867213 Mon Sep 17 00:00:00 2001
> From: Michal Suchanek 
> Date: Sat, 24 Sep 2011 18:46:29 +0200
> Subject: [PATCH] Add option to set default DPI
> 
>  The default DPI can be either specified as fixed value or 'auto'
>  meaning DDC is used when available.
> 
>  Based on patch by Nick Bowler

> Index: xserver/hw/xfree86/common/xf86Config.c
> ===
> --- xserver.orig/hw/xfree86/common/xf86Config.c   2011-10-11 
> 18:58:07.0 +0200
> +++ xserver/hw/xfree86/common/xf86Config.c2011-10-11 18:59:40.0 
> +0200
> @@ -880,6 +883,15 @@
>   }
>  }
>  
> +
> +xf86Info.defaultDPI = DEFAULT_DPI;
> +if ((s = xf86GetOptValString(FlagOptions, FLAG_DEFAULT_DPI))) {
> + if (!xf86NameCmp(s, "auto")) {
> + xf86Info.defaultDPI = 0;
> + } else {
> + xf86Info.defaultDPI = strtoul(s, NULL, 0);

This does not check for parsing errors.

> + }
> +}
>  #ifdef RANDR
>  xf86Info.disableRandR = FALSE;
>  xf86Info.randRFrom = X_DEFAULT;
> Index: xserver/hw/xfree86/man/xorg.conf.man
> ===
> --- xserver.orig/hw/xfree86/man/xorg.conf.man 2011-10-10 17:52:26.0 
> +0200
> +++ xserver/hw/xfree86/man/xorg.conf.man  2011-10-11 18:59:40.0 
> +0200
> @@ -544,6 +544,12 @@
>  and are passed to clients.
>  Default: off.
>  .TP 7
> +.BI "Option \*qDefaultDPI\*q  \*q" string \*q
> +This option allows to set a fixed DPI which is reported for all screens or 
> the

"allows to" is not correct, I guess either "makes it possible to" or
some sentence rewording to avoid the usage.

> +special value \*qauto\*q which infers DPI from screen size read from DDC. The
> +fallback in case DDC reading fails is 96.
> +Default: 96.
> +.TP 7
>  .BI "Option \*qDisableVidModeExtension\*q  \*q" boolean \*q
>  This disables the parts of the VidMode extension used by the xvidtune client
>  that can be used to change the video modes.
> Index: xserver/hw/xfree86/modes/xf86RandR12.c
> ===
> --- xserver.orig/hw/xfree86/modes/xf86RandR12.c   2011-10-11 
> 18:58:07.0 +0200
> +++ xserver/hw/xfree86/modes/xf86RandR12.c2011-10-11 18:59:40.0 
> +0200
> @@ -807,6 +807,7 @@
>   else
>   {
>   xf86OutputPtr   output = xf86CompatOutput(pScrn);
> + xf86CrtcPtr crtc   = output->crtc;
>  
>   if (output &&
>   output->conf_monitor &&
> @@ -819,11 +820,27 @@
>   mmWidth = output->conf_monitor->mon_width;
>   mmHeight = output->conf_monitor->mon_height;
>   }
> - else
> + else if (!xf86Info.defaultDPI && crtc && crtc->mode.HDisplay &&
> +  output->mm_width && output->mm_height)

You could move the «else if (xf86Info.defaultDPI)» before this one and
avoid having to check for !xf86Info.defaultDPI.

> + {
> + /*
> +  * If the output has a mode and a declared size, use that
> +  * to scale the screen size
> +  */
> + DisplayModePtr  mode = &crtc->mode;
> + mmWidth = output->mm_width * width / mode->HDisplay;
> + mmHeight = output->mm_height * height / mode->VDisplay;
> + }
> + else if (xf86Info.defaultDPI)
>   {
>   /*
>* Otherwise, just set the screen to DEFAULT_DPI
>*/

This comment seems misplaced.

> + mmWidth = width * 25.4 / xf86Info.defaultDPI;
> + mmHeight = height * 25.4 / xf86Info.defaultDPI;
> + }
> + else
> + {
>   mmWidth = width * 25.4 / DEFAULT_DPI;
>   mmHeight = height * 25.4 / DEFAULT_DPI;
>   }

Thanks,
Guillem
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

[PATCH resent] Option to use DPI calculated from EDID

2011-10-31 Thread Michal Suchanek
Hello,

anybody can look at this patch?

It adds back functionality lost a few years ago which makes X
needlessly hard to use on devices that report correct DPI and aren't
96 DPI which is the value unconditionally set since commit fff00d

Thanks

Michal


0001-Add-option-to-set-default-DPI.patch
Description: plain/text
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel