winft / disman

Qt/C++ display management library
GNU Lesser General Public License v2.1
2 stars 1 forks source link

kwinft/disman not resilient toward nonsensical display modes offered by modesetting DDX, causing corrupted output #32

Closed romangg closed 7 months ago

romangg commented 3 years ago

In GitLab by @aufkrawall on Oct 9, 2020, 01:25

I use a custom single resolution 85Hz EDID for my display. With it, modesetting DDX offers nonsensical modes: https://gitlab.freedesktop.org/xorg/xserver/-/issues/956

Screenshot_20201009_003839 Screenshot_20201009_004013

When I set resolution and refresh rate to auto in kwinft/disman settings, display output is a distorted mess. With vanilla kwin/kdisplay, they seem to just ignore such modes when setting them in the UI. While this is probably not a bug in kwinft/disman at all, it might be the lesser evil if the system remains usable. ;)

The issue does not exist with xf86-video-amdgpu DDX or on Wayland. Without custom EDID, the auto mode also works with modesetting DDX and kwinft/disman.

Xorg.0.log

Aforementioned EDID:

edid.zip

Loaded as described here: https://wiki.archlinux.org/index.php/kernel_mode_setting#Forcing_modes_and_EDID

romangg commented 3 years ago

moved from kwinft#83

romangg commented 3 years ago

In GitLab by @Kodehawa on Oct 19, 2020, 01:44

What is the output of xrandr?

Wanna check if they're the preferred modes to see if a MR that does #35 fixes this or not.

romangg commented 3 years ago

In GitLab by @aufkrawall on Oct 19, 2020, 13:49

You might be right about this, I suppose given that either the + or * indicates the preferred mode.

amdgpu:

Screen 0: minimum 320 x 200, current 2560 x 1440, maximum 16384 x 16384
DisplayPort-2 disconnected (normal left inverted right x axis y axis)
DisplayPort-3 disconnected (normal left inverted right x axis y axis)
HDMI-A-3 disconnected (normal left inverted right x axis y axis)
HDMI-A-4 disconnected (normal left inverted right x axis y axis)
DVI-D-0 connected primary 2560x1440+0+0 (normal left inverted right x axis y axis) 640mm x 360mm
   2560x1440     85.00*+
   1920x1200     85.00  
   1920x1080     85.00  
   1600x1200     85.00  
   1680x1050     85.00  
   1280x1024     85.00  
   1440x900      85.00  
   1280x800      85.00  
   1280x720      85.00  
   1024x768      85.00  
   800x600       85.00  
   640x480       85.00

modesetting:

Screen 0: minimum 320 x 200, current 2560 x 1440, maximum 16384 x 16384
DP-3 disconnected (normal left inverted right x axis y axis)
DP-4 disconnected (normal left inverted right x axis y axis)
HDMI-4 disconnected (normal left inverted right x axis y axis)
HDMI-5 disconnected (normal left inverted right x axis y axis)
DVI-D-1 connected primary 2560x1440+0+0 (normal left inverted right x axis y axis) 640mm x 360mm
   2560x1440     85.00*+  59.99    59.99    59.96    59.95  
   1920x1440     85.00    75.00    60.00  
   1856x1392     75.00    60.01  
   1792x1344     75.00    60.01  
   2048x1152     59.99    59.98    59.90    59.91  
   1920x1200     85.00    59.88    59.95  
   1920x1080     60.01    85.00    59.97    59.96    59.93  
   1600x1200     85.00    85.00    75.00    70.00    65.00    60.00  
   1680x1050     85.00    59.95    59.88  
   1400x1050     74.76    59.98  
   1600x900      59.99    59.94    59.95    59.82  
   1280x1024     85.00    85.02    75.02    60.02  
   1440x900      85.00  
   1400x900      59.96    59.88  
   1280x960      85.00    60.00  
   1440x810      60.00    59.97  
   1368x768      59.88    59.85  
   1280x800      85.00    59.99    59.97    59.81    59.91  
   1152x864      75.00  
   1280x720      85.00    60.00    59.99    59.86    59.74  
   1024x768      85.00    85.00    75.05    60.04    85.00    75.03    70.07    60.00  
   960x720       85.00    75.00    60.00  
   928x696       75.00    60.05  
   896x672       75.05    60.01  
   1024x576      59.95    59.96    59.90    59.82  
   960x600       59.93    60.00  
   832x624       74.55  
   960x540       59.96    59.99    59.63    59.82  
   800x600       85.00    85.00    75.00    70.00    65.00    60.00    85.14    72.19    75.00    60.32    56.25  
   840x525       60.01    59.88  
   864x486       59.92    59.57  
   700x525       74.76    59.98  
   800x450       59.95    59.82  
   640x512       85.02    75.02    60.02  
   700x450       59.96    59.88  
   640x480       85.00    85.09    60.00    85.01    72.81    75.00    59.94  
   720x405       59.51    58.99  
   720x400       85.04  
   684x384       59.88    59.85  
   640x400       59.88    59.98    85.08  
   576x432       75.00  
   640x360       59.86    59.83    59.84    59.32  
   640x350       85.08  
   512x384       85.00    75.03    70.07    60.00  
   512x288       60.00    59.92  
   416x312       74.66  
   480x270       59.63    59.82  
   400x300       85.27    72.19    75.12    60.32    56.34  
   432x243       59.92    59.57  
   320x240       85.18    72.81    75.00    60.05  
   360x202       59.51    59.13  
   360x200       85.04  
   320x200       85.27  
   320x180       59.84    59.32  
   320x175       85.27  
DP-1-1 disconnected (normal left inverted right x axis y axis)
HDMI-1-1 disconnected (normal left inverted right x axis y axis)
HDMI-1-2 disconnected (normal left inverted right x axis y axis)
HDMI-1-3 disconnected (normal left inverted right x axis y axis)
DP-1-2 disconnected (normal left inverted right x axis y axis)
romangg commented 3 years ago

In GitLab by @Kodehawa on Oct 25, 2020, 21:22

You might be right about this, I suppose given that either the + or * indicates the preferred mode.

Yup, it does. According to xrandr, the prefered mode is 2560x1440 85.00*+ (so 2560x1440 @ 85Hz). If that's so, that should be fine, and #35 will fix this issue on automatic mode.

btw, @romangg that xrandr output isn't showing the 120Hz mode. (Highest is 2560x1440 85.00*+ 59.99 59.99 59.96 59.95, according to XRandR, even on modesetting)

Where is disman getting it from?

EDIT: After a little big of digging on gitter; I think we know what causes this.

Links attached.

https://bugs.freedesktop.org/show_bug.cgi?id=16952 (Matches this bug report perfectly)

Which was fixed by https://gitlab.freedesktop.org/xorg/app/xrandr/-/commit/7509ecb290689e0b1d5e1000c9fbd312f1efb4ca (https://gitlab.freedesktop.org/xorg/app/xrandr/-/blob/master/xrandr.c#L925)

And, related but not proper: https://gitlab.freedesktop.org/xorg/app/xrandr/-/commit/7fd4f18b649f22fad4dbf9fc64b69b3e7f172207

romangg commented 3 years ago

In GitLab by @Kodehawa on Nov 26, 2020, 19:47

Hello. Could you test https://gitlab.com/Kodehawa/disman/-/commits/randr-skip-double?

Sorry for the delay. I had a surgery on my arm ,w,

EDIT: was confirmed to work by someone else with the issue :p

romangg commented 3 years ago

In GitLab by @Kodehawa on Nov 29, 2020, 16:39

This will be fixed by !24 (both commits are important to this issue)

romangg commented 3 years ago

In GitLab by @Kodehawa on Dec 9, 2020, 20:47

mentioned in commit 24f833d1229a175752da67cf78f6d603b561bff6