Incorrect physical screen size values reported on Wayland
Affected version
OS: Fedora, edition 38.
Installed:
$ dnf --installed rq --qf '%{name} %{version}' gnome-session-wayland-* libwayland-client xorg-x11-server-Xwayland
gnome-session-wayland-session 44.0
libwayland-client 1.22.0
xorg-x11-server-Xwayland 22.1.9
mesa3d.org's drivers: v. 23.0.3
Summary
Incorrect physical screen size values reported on Wayland
Context
Hello. Be an image size in full screen as measured with a physical ruler for x and y axis: 344 mm x 193 mm (diagonal size: 15.529237982 inches. When rounded to two decimals, 15.53 inches).
Note: It is a laptop screen. The laptop is presented by the vendor for the relevant part as "15.6-inch, FHD (1920 x 1080) 16:9 aspect ratio". Rounding 15.53 to one decimal makes 15.5, not 15.6. The abuse of language in respect to the diagonal size is out of scope here.
Investigations
Involved in path: EDID reported by the kernel DRM interface in order to obtain relevant values reported by the monitor.
$ edid-decode /sys/class/drm/card1/card1-eDP-1/edid | grep -E 'Maxi|DTD'
Maximum image size: 34 cm x 19 cm
DTD 1: 1920x1080 60.007852 Hz 16:9 67.929 kHz 152.840000 MHz (344 mm x 193 mm)
The values reported as maximum image size by the base EDID are thus incorrect. As shown, it is due to an inadequate accuracy, a low one, for instance illustrated by the unit cm and no decimal accuracy. Nonetheless the values "344 mm x 193 mm" as part of DTD (Detailed Timing Descriptors) are the ones that represent the maximum image size.
$ monitor-get-edid | monitor-parse-edid | awk 'NF' | sed -n '4p;6,8p'
Screen size: 34.4 cm x 19.3 cm (15.53 inches, aspect ratio 16/9 = 1.78)
Digital signal
# Monitor preferred modeline (60.0 Hz vsync, 67.9 kHz hsync, ratio 16/9, 141 dpi)
ModeLine "1920x1080" 152.84 1920 2000 2060 2250 1080 1086 1094 1132 -hsync -vsync
- On X.org session
$ xdpyinfo | grep -i ^x.org
X.Org version: 1.20.14
$ xrandr | grep ' connected'
eDP-1 connected primary 1920x1080+0+0 (normal left inverted right x axis y axis) 344mm x 193mm
The reported size values match the ones obtained by physical measurements. That might indicate that X.org parses some extension blocks with higher resolution information within them.
- On Wayland session
$ xdpyinfo | grep -i ^x.org
X.Org version: 22.1.9
$ xrandr | grep ' connected'
XWAYLAND0 connected primary 1920x1080+0+0 (normal left inverted right x axis y axis) 340mm x 190mm
$ wayland-info
(...)
interface: 'wl_output', version: 4, name: 4
name: eDP-1
description: Built-in display
x: 0, y: 0, scale: 1,
physical_width: 340 mm, physical_height: 190 mm,
make: 'CMN', model: '0x15f5',
subpixel_orientation: unknown, output_transform: normal,
mode:
width: 1920 px, height: 1080 px, refresh: 60.007 Hz,
flags: current preferred
Conclusions
edid-decode
reports the same size values as Mutter as illustrated by wayland-info
whereas monitor-parse-edid
reports the same size values as X.org as illustrated by xrandr
. Xwayland is probably configured to fetch the screen size values reported by the Wayland compositor.