Xrandr scale 2×2 for multi display (4K HiDPI and Full HD mix) – blurred output

dpimulti-monitorx11xorgxrandr

On Kubuntu 17.04 with nouveau, I'm trying to obtain a dual monitor setup with a 4K as main one and a Full HD (actually 1920×1200 but makes no difference) on the right.

I'm using double KDE system scale (as described in https://wiki.archlinux.org/index.php/HiDPI#Using_KDE_system_settings) along with xrandr scaling (as described in https://wiki.archlinux.org/index.php/HiDPI#Side_display). More specifically:

xrandr \
    --output eDP-1 --mode 3840x2160 --pos 0x0    --auto \
    --output DP-2  --mode 1920x1200 --pos 3840x0 --auto \
        --panning 3840x2400+3840+0 --scale 2.0x2.0 \
    --fb 7680x2400

The problem is that DP-2 has slight blur, especially on the fonts, due to downsampling from 3840×2400 to 1920×1200. This is noted at the end of https://wiki.archlinux.org/index.php/HiDPI#Side_display, with the suggested solution being the sharpness setting on the monitor. Tried it, doesn't work.

The filter being used when scaling is bilinear: https://cgit.freedesktop.org/xorg/app/xrandr/tree/xrandr.c?id=5d5db88d106a49d7560a8042fa054df8b609f00a#n2993. Nearest neighbor is also supported with "nearest" but looks abysmal even though it is exactly 2×2 downsampling, which I don't understand. I went ahead and built this with "lanczos" instead of "bilinear". Apparently, this is not supported:

X Error of failed request:  BadName (named color or font does not exist)
  Major opcode of failed request:  140 (RANDR)
  Minor opcode of failed request:  26 (RRSetCrtcTransform)
  Serial number of failed request:  36
  Current serial number in output stream:  37

Is there a way to support lanczos (or a better filter)? I don't mind filtering done in software.

Right now, I have double KDE scaling and xrandr scaling disabled with 1920×1080 native resolution on my main display as a workaround. The secondary display is super sharp, including the fonts, as expected. However, from normal viewing distance, the main display looks even worse than the scaled secondary, which is also weird as half resolution is still Full HD, which looks amazingly sharp on other displays that are not 4K.

So the real question is, there any way of getting sharp images on both displays?

Edit: Forgot to mention the important fact that I'm on an Nvidia PRIME system with GeForce 940MX and Intel HD Graphics 620. On nvidia-384 the results are the same when using Intel, i.e the same blurs. When using GeForce, --scale 2x2 option has no effect and --panning option generates a Failed Request error similar to the above.

Best Answer

I also have 4k monitor on my notebook. What I am typically doing is just setting 1920x1080 mode for 4k monitor and it looks perfect actually, exactly as 1080p monitor. Just do not scale or antialias, you need to find a way to just have 2x2 pixels.

Related Question