wlc icon indicating copy to clipboard operation
wlc copied to clipboard

Incorrect display resolution

Open janhieber opened this issue 8 years ago • 9 comments

Hi, I have a incorrect resolution in TTY/sway/wayland. My system:

  • Thinkpad T440s with Intel HD4400
  • Lenovo Ultra dock (DP MST hub/switch)

On my dock are 2 screens:

  • Screen 1: 1920x1200 connected via DP (FlexScan EV2416W)
  • Screen 2: 1920x1080 connected via DVI

When I boot to TTY, Screen 1 reports 1680x1050, Screen 2 is OK. I think because of this, wlc cant display correctly.

Normally, the incorrect resolution would not bother me because in X11 it works, but I want to use Sway with Wayland. Sway uses WLC, which seems not to be able to switch TTY resolution.

So I end up with 1920x1200 (from WLC/sway/wayland) downscaled to 1680x1050 (by drm I guess) and then from the Eizo monitor upscaled to 1920x1200. Looks terrible.

I tried forcing the resolution with video=DP-3:1920x1200 but then all screen (incl Notebook display) stay black. IMHO Intel driver is complete crap with DP MST.

Is there a way to get this working? It holds me from switching to sway.

When i boot up in display manager and switch to TTY, this are the available drm modes: /sys/class/drm/card.../modes output but: When i login to wm and set the correct resolutions (xrandr) in X11 and switch back to TTY, the 1920x1200 suddenly is available (but not set): http://pastebin.com/txCZ18v0

Is this a i915 bug since the resolution suddenly appears when using xrandr?

dmesg output

janhieber avatar May 17 '16 20:05 janhieber

Yup wlc still just autochooses the resolution TTY has, so if it has 1680x1050 it will also be in graphical session. There is currently no modesetting in any form to change this outside of hacking wlc. (Maybe adding some env variable for now would be fair enough.)

If you know C and are interested in hacking, this is the relevant place https://github.com/Cloudef/wlc/blob/master/src/platform/backend/drm.c#L356-L378 where detection is done under drm backend.

Cloudef avatar May 17 '16 21:05 Cloudef

Hmm, I would love to contribute but I currently write my bachelor thesis and can not spend much time. Maybe in summer.

I guess this is a display detection bug in intel drm. So the quick fix would be to force a different resoltuion. Maybe I can force an different EDID or something like that.

But I wonder how wlc sets the correct resolution of 1920x1200 when the display has the wrong resoltion.

janhieber avatar May 18 '16 07:05 janhieber

If you mean sway output configuration, the wlc's resolution and modeline are different. The resolution in wlc is basically opengl viewport size (which will look odd if differs from modeline, but can be useful for e.g. having fractional DPI at cost of slight blur). Wlc doesn't have modeline api yet, and thus just chooses something automatically at startup (preferring the current mode TTY has).

I'm wondering if choosing mode that is PREFERRED (hinted by driver) instead of current is better heuristics as well for now.

Cloudef avatar May 18 '16 08:05 Cloudef

Yeah I know what you mean, it's strange and I don't get it. I'll try to force a different EDID, that should "solve" the problem.

janhieber avatar May 18 '16 08:05 janhieber

@janhieber I am having the same problem. Did you have any luck solving that?

adouzzy avatar Oct 27 '16 22:10 adouzzy

Nope, currently I continue using i3 on X11.

But ATM I don't use the 1920x1200 screen any more, last time i checked it worked fine as expected.

Lets hope that someone will implement this modeline API, I would do it but I have not much time and no idea if I have enough knowledge for this. Good luck!

janhieber avatar Oct 28 '16 15:10 janhieber

It's a shame. I tried the edid setting in the grub. It get the resolution right. However, the other laptop screen won't light up.

My i3 have some driver issue with my laptop. Switching between windows become slow after use. Now I am using awesome on X11. Miss stacking ~

adouzzy avatar Oct 31 '16 00:10 adouzzy

As reported here: https://github.com/SirCmpwn/sway/issues/1090 and as per https://github.com/Cloudef/wlc/issues/167#issuecomment-219957792 it would indeed be preferred to select the preferred (:D) mode during the initial mode selection.

linkmauve avatar Feb 27 '17 17:02 linkmauve

I had a similar problem with an external VGA 1600x900 samsung monitor. I was able to fix it by forcing the EDID as described in https://wiki.archlinux.org/index.php/Kernel_mode_setting and https://www.kernel.org/doc/Documentation/EDID/HOWTO.txt , using the information from get-edid / parse-edid / xrandr --verbose.

1600x900.S

spelufo avatar Apr 17 '17 16:04 spelufo