DisplaySize setting not honored

Bug #135738 reported by Ka-Hing Cheung
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
X.Org X server
Unknown
Low
xorg-server (Ubuntu)
Fix Released
Low
Unassigned

Bug Description

Binary package hint: xorg

I have this in my xorg.conf:

Section "Monitor"
        Identifier "VG2230wm"
        Option "DPMS"
        DisplaySize 444 277
        HorizSync 24-82
        VertRefresh 50-85
EndSection

However, xdpyinfo reports that it's not using it:

screen #0:
  dimensions: 1680x1050 pixels (474x303 millimeters)

This was working in 7.04, but broke when I upgraded to gusty somewhere around tribe 5.

Related branches

Revision history for this message
In , Pebender (pebender) wrote :

Created an attachment (id=8498)
DisplaySize patch

Revision history for this message
In , Daniel Stone (daniels) wrote :

Sorry about the phenomenal bug spam, guys. Adding xorg-team@ to the QA contact so bugs don't get lost in future.

Revision history for this message
In , Max Arnold (amv-cbx-deactivatedaccount) wrote :

Confirm! After update to Xorg-7.2 all fonts screwed up (looks like condensed and overlapped letters) at resolution 1152x864. Driver is VIA (unichrome). Specifying dpi in command line solves problem.

Revision history for this message
Ka-Hing Cheung (kahing) wrote :

Binary package hint: xorg

I have this in my xorg.conf:

Section "Monitor"
        Identifier "VG2230wm"
        Option "DPMS"
        DisplaySize 444 277
        HorizSync 24-82
        VertRefresh 50-85
EndSection

However, xdpyinfo reports that it's not using it:

screen #0:
  dimensions: 1680x1050 pixels (474x303 millimeters)

This was working in 7.04, but broke when I upgraded to gusty somewhere around tribe 5.

Changed in xorg-server:
status: Unknown → Confirmed
Timo Aaltonen (tjaalton)
Changed in xorg:
importance: Undecided → Low
status: New → Confirmed
Revision history for this message
Timo Aaltonen (tjaalton) wrote :

Please try Hardy alpha3. There should be a fix for this.

Changed in xorg-server:
status: Confirmed → Incomplete
Revision history for this message
In , Timo Aaltonen (tjaalton) wrote :

Redhat has carried a version of this patch for some time now, how about applying it on master?

Revision history for this message
Launchpad Janitor (janitor) wrote :
Download full text (3.3 KiB)

This bug was fixed in the package xorg-server - 2:1.4.1~git20080131-1ubuntu1

---------------
xorg-server (2:1.4.1~git20080131-1ubuntu1) hardy; urgency=low

  [ Timo Aaltonen ]
  * Merge with Debian unstable, remaining changes:
  * debian/control:
    - Change maintainer address.
    - set Conflicts: xkb-data (<< 0.9), since xkb-path is
      different compared to Dapper.
    - xvfb Depends on xauth, xfonts-base.
  * debian/patches:
    - 101_fedora-apm-typedefs.patch:
      Temporary hack from Fedora for broken kernels that don't publish the
      /dev/apm_bios types.
    - 102_ubuntu_sharevts_load_cpu.patch:
      Close console fd only when using --sharevts.
    - 103_fedora_openchrome.patch:
      Patch from Fedora to use openchrome instead of via.
    - 104_fedora_init_origins_fix.patch
      Multihead initialization.
    - 105_reduce_wakeups_from_smart_scheduler.diff:
      Patch from upstream to reduce wakeups and improve battery life.
    - 106_ubuntu_fpic_libxf86config.patch
      Add -fPIC to makefiles for xfree86/parser.
    - 107_fedora_dont_backfill_bg_none.patch
      Disable backfilling of windows created with bg=none, which
      otherwise would force a framebuffer readback.
    - 110_fedora_no_move_damage.patch
      Disable damage notifications on move for manually redirected windows.
    - 120_fedora_xserver-xaa-evict-pixmaps.patch:
      New version of the hack to copy textures from video memory. Shouldn't
      break EXA anymore.
    - 121_only_switch_vt_when_active.diff
      Add a check to prevent the X server from changing the VT when
      killing GDM from the console.
    - 123_no_composite_for_xvfb_run.patch
      Use "-extension Composite" to fix xvfb-run crashing.
    - 133_psb_auto.patch
      Add automatic detection of Poulsbo hardware when running
      without a Device definition.
    - 139_fedora_xserver-1.3.0-document-fontpath-correctly.patch
      Fixes document fontpaths shown in the man page.
    - 142_fedora_xserver-1.3.0-no-pseudocolor-composite.patch
      Composite on 8bpp pseudocolor root windows appears to fail, so just
      disable it on anything pseudocolor for safety.
    - 144_fedora_xserver-1.3.0-xnest-exposures.patch:
      Only collect xnest exposures for xexposes with non-zero height and width.
  * 108_fedora_honor_displaysize.patch:
    - Patch from upstream/Fedora to honor the DisplaySize-setting.
      (LP: #135738, b.fd.o #9758)
  * Drop patch 100_avoid_acpi_insanity.diff, superseded by patch 45.

  [ Bart Trojanowski, Martin-Eric Racine ]
  * 146_X86EMU-added-blacklist-for-I-O-port-in-0-0xFF-range.patch
    - Restrict access to I/O ports in range 0-0xFF from x86emu.
    (LP: #140051)
  * 147_X86EMU-pass-the-correct-bus-dev-fn-tag-to-pci-emula.patch
    - Fix improper emulation of PCI access General Software BIOS.
    (LP: #140051)

xorg-server (2:1.4.1~git20080131-1) unstable; urgency=low

  [ Brice Goglin ]
  * Add 45_only_XF86_APM_CAPABILITY_CHANGED_for_video_change_acpi_events.diff
    to prevent XF86_APM_CAPABILITY_CHANGED from being issued for all ACPI
    events, thanks Sjoerd Simons, closes: #461463.

  [ David Nusinow ]
  * Update Japanese translation from Hideki Yamane. closes:...

Read more...

Changed in xorg-server:
status: Incomplete → Fix Released
Revision history for this message
In , Jm-jm10 (jm-jm10) wrote :

Created an attachment (id=14642)
Updated patch (for xorg-server 1.4.1~git20080131)

I confirm the bug. DisplaySize is broken, with a side effect: the log never reports that DPI settings have be probed ("**" instead of "--").
So I think it's better not to modify widthmm & heightmm at all in xf86DDCMonitorSet.

I've updated the patch against a recent version of xorg-server (1.4.1~git20080131 is the latest version packaged by Debian).

Please consider apply it.

See also Debian bug http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=421772

Revision history for this message
In , Jamessp (jamessp) wrote :

I'd like to add that the above patch fixes the chronic text clipping I was getting with KHTML in KDE 4 on my ancient CRT that is very much fond of being able to manually set DisplaySize. (My HW is a CRT + x700 AGP video card with the radeon driver.)

Revision history for this message
In , Daniel Stone (daniels) wrote :

i assume this is still broken, making the overrides work would almost certainly be useful.

Revision history for this message
In , Peter Hutterer (peter-hutterer) wrote :

Fixed by ajax in commit 3b73d62791d925c465ec855f96981d151dd3c179.

Revision history for this message
In , Nico R. (n-roeser) wrote :

I haven’t read much of the code, only some bits in Monitor.c, Configint.h and scan.c. But …

    if (Monitor->widthmm <= 0 && Monitor->heightmm <= 0) {
 Monitor->widthmm = 10 * DDC->features.hsize;
 Monitor->heightmm = 10 * DDC->features.vsize;
    }

only overwrites the values if *both*, widthmm and heightmm, are <= 0. If I read the code correctly, this happens
a) if atof returned an error, or
b) if the user explicitly set a negative or zero value in the config file, or
c) if the value is not set in the config file at all.

Shouldn’t this be

    if (Monitor->widthmm <= 0 || Monitor->heightmm <= 0) {
 Monitor->widthmm = 10 * DDC->features.hsize;
 Monitor->heightmm = 10 * DDC->features.vsize;
    }

instead? Or – even better – check/set the values separately, one by one?

Changed in xorg-server:
status: Confirmed → Fix Released
Revision history for this message
In , Peter Hutterer (peter-hutterer) wrote :

Nico: thanks for that, fixed as 83023ffd09a84ff48e6b99f57ebad101a00478db

Revision history for this message
In , Jm-jm10 (jm-jm10) wrote :

comment #9 is wrong.
Did you read last attachment (patch) and the code of xf86SetDpi (hw/xfree86/common/xf86Helper.c) ?

I don't know which is the better between commit 3b73d62 and the suggested patch. It depends if xf86SetDpi will be always called or not after. For me, commit 3b73d62 does useless work.

But I can't agree with commit 83023ff because it doesn't allow to set only 1 dimension (either height or width). As you can see in xf86SetDpi, if only Monitor->widthmm is > 0 (and Monitor->heightmm == 0)(or vice versa), the code automatically set the same DPI for height and width.

Changed in xorg-server:
status: Fix Released → Confirmed
Changed in xorg-server:
importance: Unknown → Low
Changed in xorg-server:
importance: Low → Unknown
Changed in xorg-server:
importance: Unknown → Low
Revision history for this message
In , S-j-newbury (s-j-newbury) wrote :

There are still bugs here with the current git version.

in hw/xfree86/modes/xf86Crtc.c:

handle_detailed_physical_size()

        p->output->mm_width = det_mon->section.d_timings.h_size;
        p->output->mm_height = det_mon->section.d_timings.v_size;

This unconditionally sets mm width and height from the detailed timings.

hw/xfree86/ddc/interpret_edid.c:

encode_aspect_ratio()

This function contains a quirk which determines whether the mm width and height in the detailed timings presented by the monitor are actually the aspect ratio.
If so:

        m->features.hsize = m->features.vsize = 0;

This results in a message like this in the log:
  "Quirked EDID physical size to 0x0 cm"

Back to hw/xfree86/modes/xf86Crtc.c:

xf86OutputSetEDID()

In this function, if the mm width and height haven't been determined by the DDC detailed timings probe (with no check whether they are valid), they are then set to values in the max size field (features.hsize and features.vsize) as long as it wasn't quirked to 0x0 due to the detailed timings being invalid... ...too late now!

Of course, if no information is available, the xrandr output dimensions needs to be set to something, whether that's 0x0 or 160x90 mm doesn't matter so much, either way it's not reflecting reality. However, all this convolution completely overrides the DisplaySize value the user may have set. Since it's sourced in hw/xfree86/modes/xf86RandR12.c, but then overridden during DDC mode probes it makes no difference.

Revision history for this message
In , S-j-newbury (s-j-newbury) wrote :

Created attachment 87022
patch against current git master to respect DisplaySize

By setting the output "mm sizes" to the user values from DisplaySize after the DDC probe but before checking whether they are set and falling back to the max size field gives priority to the user config.

(copied from hw/xfree86/modes/xf86RandR12.c)

Revision history for this message
In , S-j-newbury (s-j-newbury) wrote :

Hoped that would be enough, but it seems there's also need to address the issue of unconditionally overriding the value in the handle_detailed_physical_size().

I've just removed the code here (which works with my test case), but that could well break something else... :/

Revision history for this message
In , S-j-newbury (s-j-newbury) wrote :

Just to add for clarity, it shouldn't be surprising that I had to remove:

hw/xfree86/modes/xf86Crtc.c:

handle_detailed_physical_size() ...
      p->output->mm_width = det_mon->section.d_timings.h_size;
      p->output->mm_height = det_mon->section.d_timings.v_size;

since it seems to be called on each DDC probe and not just when the connected output device has changed. This should at least be conditional on DisplaySize not being set.

I don't think this has really been noticed since the core DPI is no longer tied to the output size/resolution, but any app wanting to make use of the actual display characteristics via randr will potentially get some very wrong values!

Revision history for this message
In , S-j-newbury (s-j-newbury) wrote :

Created attachment 88557
patch against current git master to respect DisplaySize (20131103)

This should be sufficient to make it work.

Always uses user supplied DisplaySize in preference to detected size if specified.

Also reports if monitor features and detailed timings report differing sizes, this is/was just to help debug and can be dropped.

Revision history for this message
In , Gitlab-migration (gitlab-migration) wrote :

-- 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/246.

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

Other bug subscribers

Remote bug watches

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