Screen DPI detected incorrectly by xdpyinfo

Bug #201491 reported by Alexander Jones on 2008-03-12
22
This bug affects 3 people
Affects Status Importance Assigned to Milestone
X.Org X server
Unknown
Medium
xorg-server (Ubuntu)
Medium
Unassigned

Bug Description

Binary package hint: xorg

It seems tools like xdpyinfo are reporting screen sizes as 300x230 mm in a lot of cases when they are not.

On my own Iiyama ProLite E431S with an ATI Radeon 9800 Pro connected over DVI using the "ati" driver, I get this from xdpyinfo:

screen #0:
  dimensions: 1280x1024 pixels (300x230 millimeters)
  resolution: 108x113 dots per inch

ddcprobe correctly detects the screen physical dimensions:

screensize: 34 27

In another report, https://bugs.launchpad.net/ubuntu/+source/xserver-xorg-video-intel/+bug/201032 the reporter shows that xdpyinfo quotes:

screen #0:
  dimensions: 1280x800 pixels (300x230 millimeters)
  resolution: 108x88 dots per inch

and ddcprobe reports:

screensize: 33 21

Notice that the screens are actually different dimensions, both in physical terms and pixel terms, yet xdpyinfo thinks they are 300x230 mm. Also, the other reporter is using the intel driver.

This did indeed used to work correctly in the early Hardy alphas, and previous releases of Ubuntu.

ProblemType: Bug
Architecture: i386
Date: Wed Mar 12 17:34:11 2008
DistroRelease: Ubuntu 8.04
Package: xorg 1:7.3+10ubuntu6
PackageArchitecture: i386
SourcePackage: xorg
Uname: Linux 2.6.24-11-386 i686

Alexander Jones (alex-weej) wrote :
Timo Aaltonen (tjaalton) wrote :

Please attach your Xorg.0.log

Changed in xorg:
status: New → Incomplete
Alexander Jones (alex-weej) wrote :

Attached

Changed in xorg:
status: Incomplete → Confirmed
Alexander Jones (alex-weej) wrote :

(II) RADEON(0): Setting screen physical size to 340 x 270

Alexander Jones (alex-weej) wrote :

ddcprobe thinks: 34 x 27 (cm) (approx. 95.6 x 96.3 dpi) - Correct!
So radeon thinks 340 x 270 (mm) - yep... correct
xdpyinfo thinks 300 x 230 ((approx. 108.4 x 113.1 dpi) WRONG!

Where is X getting this number from?

Alexander Jones (alex-weej) wrote :

Additionally:

alex@flash:~$ xrandr
Screen 0: minimum 320 x 200, current 1280 x 1024, maximum 1280 x 1200
VGA-0 disconnected (normal left inverted right x axis y axis)
DVI-0 connected 1280x1024+0+0 (normal left inverted right x axis y axis) 340mm x 270mm
   1280x1024 75.0*+ 59.9
   1152x864 74.8
   1024x768 75.1 70.1 60.0
   832x624 74.6
   800x600 72.2 75.0 60.3 56.2
   640x480 75.0 72.8 66.7 60.0
   720x400 70.1
S-video disconnected (normal left inverted right x axis y axis)

So xrandr is getting it right too...

Bryce Harrington (bryce) wrote :

Hmm, sounds like a quirk might be needed or something.

Changed in xorg:
assignee: nobody → bryceharrington
importance: Undecided → Medium
status: Confirmed → Triaged

I'm forwarding this bug report from a Ubuntu user:
https://bugs.launchpad.net/ubuntu/+source/xorg/+bug/201491

With a Iiyama monitor, xdpyinfo reports 300x230mm yet the actual physical size differs. Xorg.0.log lists the correct dimensions (no mention of 300x230mm in the log), and ddcprobe and xrandr also both report the correct dimensions.

Looking through the xdpyinfo code and referring to xlib's implementation of DisplayHeightMM() and DisplayWidthMM(), I didn't spot code that manipulates those values or sets them to default values, so my guess is the EDID from the monitor simply needs quirked? Does it need quirk_detailed_use_maximum_size() like the LPL monitors?

Iiyama ProLite E431S, ATI Radeon 9800 Pro, DVI, -ati
Manufacturer: IVM Model: 46ac Serial#: 16832

== Original Report ==
Binary package hint: xorg

It seems tools like xdpyinfo are reporting screen sizes as 300x230 mm in a lot of cases when they are not.

On my own Iiyama ProLite E431S with an ATI Radeon 9800 Pro connected over DVI using the "ati" driver, I get this from xdpyinfo:

screen #0:
  dimensions: 1280x1024 pixels (300x230 millimeters)
  resolution: 108x113 dots per inch

ddcprobe correctly detects the screen physical dimensions:

screensize: 34 27

In another report, https://bugs.launchpad.net/ubuntu/+source/xserver-xorg-video-intel/+bug/201032 the reporter shows that xdpyinfo quotes:

screen #0:
  dimensions: 1280x800 pixels (300x230 millimeters)
  resolution: 108x88 dots per inch

and ddcprobe reports:

screensize: 33 21

Notice that the screens are actually different dimensions, both in physical terms and pixel terms, yet xdpyinfo thinks they are 300x230 mm. Also, the other reporter is using the intel driver.

This did indeed used to work correctly in the early Hardy alphas, and previous releases of Ubuntu.

======

[Note that the bug the user references is about a LGPhilipsLCD LP154W01-TLD (LPL prod id 48128) monitor, which might be similar to the LGPhilipsLCD LP154W01-A5 from bug #10304, which is quirked with quirk_detailed_use_maximum_size().]

http://launchpadlibrarian.net/13009368/Xorg.0.log

ddcprobe thinks: 34 x 27 (cm) (approx. 95.6 x 96.3 dpi) - Correct!
So radeon thinks 340 x 270 (mm) - yep... correct
xrandr thinks 340mm x 270mm - correct
xdpyinfo thinks 300 x 230 ((approx. 108.4 x 113.1 dpi) WRONG!

In case it wasn't obvious, this only became an issue fairly recently. In Ubuntu 7.10 which shipped Xorg 7.3 (I think), this seemed to work OK.

Bryce Harrington (bryce) wrote :

Hi Alex,

I've forwarded your bug upstream to https://bugs.freedesktop.org/show_bug.cgi?id=15682. I would encourage you to subscribe to that bug in case they have questions or need additional information, so you could provide it directly.

Changed in xorg-server:
status: New → Unknown
Changed in xorg-server:
status: Unknown → Confirmed
Bryce Harrington (bryce) on 2008-05-28
Changed in xorg:
assignee: bryceharrington → nobody
Tormod Volden (tormodvolden) wrote :

Alexander, do you have a chance to test this in Jaunty? If so, please attach the log.

Sorry, no access to the monitor till Easter.

Bryce Harrington (bryce) wrote :

I have also written up a troubleshooting guide for incorrect dpi detection issues:
https://wiki.ubuntu.com/X/Troubleshooting/HugeFonts

After reviewing that, could you restate the problem? I'd like to get this bug resolved one way or another.

Alexander Jones (alex-weej) wrote :

Honestly, the monitor is 250 miles away. I can't get at it till I'm back
home which might not be for months...!

Andreas Rottmann (rotty) wrote :

Although I'm not an Ubuntu user (I'm on Debian sid), I've a similar problem with the RadeonHD driver:

* Configuration

- On-Board Radeon chip; lspci info:
   01:05.0 VGA compatible controller: ATI Technologies Inc Radeon HD 3200 Graphics
- radeonhd driver 1.2.5
- xorg-server 1.6.1.901 (from experimental)

* Symptoms

- ddcprobe shows correct dimensions: "screensize: 51 29"
- Xorg seems to know proper size (from Xorg.0.log):

(II) RADEONHD(0): Max Image Size [cm]: horiz.: 51 vert.: 29

- But later somehow comes up with incorrect numbers, which
  propagate into xpdyinfo:

(II) RADEONHD(0): clock: 138.5 MHz Image Size: 477 x 268 mm

- xdpyinfo:

  dimensions: 1920x1080 pixels (477x268 millimeters)

- xrandr has the wrong numbers as well (this is different from the original reporter, who had xrandr being right):

  DVI-D_1 connected 1920x1080+0+0 (0x3d) normal (normal left inverted right x axis y axis) 477mm x 268mm

I'm sitting just in front of that monitor, and can help debugging this issue (assuming it's the same issue as the original reporter's). It seems to me that X is using two different ways to get physical screen size, and then chooses the
wrong one.

Bryce Harrington (bryce) on 2009-08-13
tags: added: hardy
Bryce Harrington (bryce) wrote :

[This is an automatic notification.]

Hi Alexander,

This bug was reported against an earlier version of Ubuntu, can you
test if it still occurs on Lucid?

Please note we also provide technical support for older versions of
Ubuntu, but not in the bug tracker. Instead, to raise the issue through
normal support channels, please see:

    http://www.ubuntu.com/support

If you are the original reporter and can still reproduce the issue on
Lucid, please run the following command to refresh the report:

  apport-collect 201491

If you are not the original reporter, please file a new bug report, so
we can work with you as the original reporter instead (you can reference
bug 201491 in your report if you think it may be related):

  ubuntu-bug xorg

If by chance you can no longer reproduce the issue on Lucid or if you
feel it is no longer relevant, please mark the bug report 'Fix Released'
or 'Invalid' as appropriate, at the following URL:

  https://bugs.launchpad.net/ubuntu/+bug/201491

Changed in xorg-server (Ubuntu):
status: Triaged → Incomplete
tags: added: needs-retested-on-lucid-by-june
Phill (phill.l) wrote :

I've got a similar issue, but not sure if it's exactly the same cause. My Xorg.0.log file starts with the right idea and changes its mind at the end.

Initially it looks OK with these log lines showing correct values:
(II) intel(0): Max Image Size [cm]: horiz.: 38 vert.: 30
(II) intel(0): clock: 108.0 MHz Image Size: 376 x 301 mm
(**) intel(0): Display dimensions: (380, 300) mm
(**) intel(0): DPI set to (85, 86)

Then, towards the end it changes it's mind, only the one line I can see:
(II) intel(0): Setting screen physical size to 338 x 270

(I'll attach the full file after this comment). This gives you about 96x96 dpi I think, which is what xdpyinfo reports.

I use "xrandr -dpi 85" to get around the problem (fixes document-viewer and GIMP), and change the DPI settings in gnome (fixes window fonts).

Phill (phill.l) wrote :

Attaching my log file. Version of Ubuntu is 10.04 with latest upgrades to date (except proposed and backports).

Tormod Volden (tormodvolden) wrote :

Phill, did you see what Bryce wrote in his last comment:

If you are not the original reporter, please file a new bug report, so
we can work with you as the original reporter instead (you can reference
bug 201491 in your report if you think it may be related):

 ubuntu-bug xorg

Changed in xorg-server:
importance: Unknown → Medium
Changed in xorg-server:
importance: Medium → Unknown
Changed in xorg-server:
importance: Unknown → Medium
Bryce Harrington (bryce) wrote :

We're closing this bug since it is has been some time with no response from the original bug reporter. However, if the issue still exists in the latest development version of Ubuntu and you are the original reporter please feel free to reopen with the requested information. If you are not the original reporter, please don't reopen this one but instead file a new bug and reference this one.

Changed in xorg-server (Ubuntu):
status: Incomplete → Invalid

Xorg reports wrong screen size by design. See bug 23705

This bug is still present. xdpyinfo reports always 96x96 dpi resulting in wrong screen dimensions and incorrect scaling.

$ xdpyinfo | grep -B2 resolution
screen #0:
  dimensions: 3840x2160 pixels (1016x571 millimeters)
  resolution: 96x96 dots per inch

however, xrandr is right;

$ xrandr | grep DP1
DP1 connected primary 3840x2160+0+0 (normal left inverted right x axis y axis) 600mm x 340mm

I have something maybe related to this problem. Incorrect resolution detected:

screen #0:
  dimensions: 5120x1024 pixels (1354x270 millimeters)
  resolution: -2147483648x-2147483648 dots per inch

More on https://bugs.launchpad.net/xorg-server/+bug/1650192

xdpyinfo on XRandR 1.2+ screen really reports wrong DPI information. Last version of patch for xdpyinfo which fixes this problem is there: https://lists.x.org/archives/xorg-devel/2017-May/053743.html

Also this patch (v2) fixes reporing of negative values in resolution information.

-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/xorg/xserver/issues/366.

Changed in xorg-server:
status: Confirmed → Unknown
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.