
High-DPI displays and Linux - jsnell
http://lwn.net/Articles/619784/
======
Aardwolf
Somewhere in the 90's, games were in 320x200 pixel resolution, and the Windows
3.11 desktop was 640x480 pixels or so on a typical 386 computer.

Then up to around the year 2000, resolutions increased, going through such
stages as 800x600, 1024x768 and 1280x1024 (your CRT would flicker if much
higher, and then LCDs came along pinning it at 1280x1024 for 17").

Then the resolution (or especially DPI) growth basically stopped for 10 years
imho ("HD" was not really any higher at all than what a year 2000 CRT could
do).

But now there's some growth again :) Why the problems though? has 10 years of
the same DPI made developers forget about different DPIs?

~~~
bitL
I am guessing - is it because of HDMI and its abysmal bandwidth? Before with
VGA the actual resolution of CRT monitors was limited by RAMDAC. And 10 years
ago I was able to to have 2048x1536@70Hz on a top-end 15" CRT already.

I guess as nowadays all digital signal is routed through content protection
filter, the technology processing these streams wasn't performing well,
causing stagnation in display resolutions for a long time (well, there was
also a limit in DPI of CRTs and immature LCD tech). I guess only nowadays with
HDMI 2.0, DisplayPort 1.3 or Thunderbolt we are getting to the point the
digital signal can be "properly" controlled by content-protection chips, hence
allowing 4K+ resolutions (though it's still a mess).

EDIT: spelling

~~~
tjoff
It was/is because LCDs have fixed resolutions. High DPI displays was a niche,
with CRTs you could satisfy that niche without sacrificing the mainstream
audience since you didn't have to force people to run any specific resolution.

The reason for why high DPI was a niche was because of one thing, and one
thing only: software. You had to have good eyesight and seek a large screen
real estate to even be able to make use of it.

Software didn't scale well. We had small laptop screens with 1920x1200 in the
early 2000s. It barely cost more than lower resolution displays (back then you
typically had three different resolutions to choose from for every laptop
(then came apple)). It was real apparent even back then that high-DPI wasn't
costly at all, it just wasn't mainstream enough for anyone to care.

Fast forward a decade and we have the exact same problem. Software can't scale
shit. The only reason apple was first with high-dpi was because they
controlled the software, and they took the easy way out. They just scaled
everything up 4 times and look at that, exactly the same screen real estate
with just higher DPI. Same thing with iPhone 4 - the only reason they
increased the resolution so much was so that they wouldn't have to bother with
scaling ("retina" was just an added bonus). Remember that niche that sought
large screen real estate and that bought high-resolution CRTs in the 90's?
Well, they are still waiting for a decent LCD...

As for HDMI, no, firstly HDMI was never intended for computers at all. But the
hype in combination with small laptops forced it upon us anyway. But HDMI came
much later anyway, the battle for high-resolution/high-DPI displays was
already lost (because of software). The real technical hurdle was the OSD and
scaling chips. Again, the reason for why apple was first with the 30"
2560x1600 display was because they were the first ones that could ditch both
the OSD and all scaling from the monitor. It only had brightness adjustments
(no OSD) and all of the scaling was done on the graphic card, that way you
couldn't pair it with a regular PC - if you did you would have to use another
monitor to be able to enter BIOS, install the OS, enter safe-mode, or game on
any other resolution (which you pretty much had to). Of course, eventually
most graphic cards could do so but apple were the first to be able to assume
that the monitor would be paired with such a graphic card.

That and the fact that Dual-Link-DVI was quite rare (hardly surprising since
there were no monitors on the market that used it).

Oh and people, I hope you (not parent, but lots of others) didn't run
1280x1024 on your 4:3 CRTs. The only 5:4 monitors that existed were 17" and
19" LCDs. You should have used 1600x1200 or 1280x900, that is, if you didn't
want to stretch everything.

------
toothbrush
I'm surprised that nobody has talked about using the Xorg -dpi flag. I am a
MacBook Retina user (but exclusively run Linux -- a long story) and i actually
find the results reasonable. I had to go to a bit of effort, but finally i
managed a reasonable result by changing the way the X server is started
(adding the -dpi 227 flag) and modifying Firefox's devPerPx option. The rest
sort of "automagically" worked IIRC. I should however add that my setup is
minimalistic -- Xmonad and very few non-terminal apps.

~~~
giveuptheghost
If you ever had time to put together a blog post with your config files, I'm
sure more than a few people would be interested. I know I have struggled with
setting up a reasonably looking Linux on the MBP Retina, and in the end given
up.

------
bryanlarsen
I have a Thinkpad Yoga 2 Pro (3200x1800 @ 13"), and often use an external
monitor. My "solution" is to turn off HiDPI and rely on the zoom features in
all of my apps. (terminal, emacs & browsers)

Browser windows on the laptop usually run at a zoom of 200%, whereas windows
on the external display run at 90%.

Annoying, but the beautiful text is worth the bother.

~~~
graycoder
What OS/Distro do you run? I've read some rather worrying things about the
linux support and haven't taken windows off yet. I've been living in VMs,
which are surprisingly snappy.

~~~
rbanffy
You can probably boot it up from a USB stick and check whether everything
works. Did that on my last Dell before getting rid of Windows.

------
ambrop7
Regarding the problem of the external display, the DPI disparity is "easily"
solved by configuring the external display with a high apparent resolution but
down-scaling to what the device actually supports[1]:

xrandr --output <output_name> \--scale 2.0x2.0

The output_name can be found just by running "xrandr".

A related and more powerful feature is specifying an arbitrary matrix for the
screen-display transformation (e.g. rotation by any angle, shear) (xrandr
--transform).

[1] [http://superuser.com/questions/825688/down-scaling-high-
dens...](http://superuser.com/questions/825688/down-scaling-high-density-
image-for-standard-density-external-display)

------
krmtl
Firefox on Linux currently doesn't support a mixture of HiDPI and non-HiDPI
monitors, it has a single DPI setting. I think it will be supported when this
[1] bug is resolved.

Shameless plug: I have written an addon to workaround this [2].

[1]
[https://bugzilla.mozilla.org/show_bug.cgi?id=975919](https://bugzilla.mozilla.org/show_bug.cgi?id=975919)

[2] [https://addons.mozilla.org/en-
US/firefox/addon/autohidpi/](https://addons.mozilla.org/en-
US/firefox/addon/autohidpi/)

~~~
quotemstr
AutoHiDPI seems to look at the width of the active window rather than the size
of the screen. This behavior seems like a bug.

------
bla2
OS X has the best highdpi implementation at the moment, and use the pixel
scaling approach. It seems to work well there.

~~~
chris_wot
It does work well. The other day, there was an article on someone who did an
extreme test on pixel scaling, and an Apple software engineer wrote the
following comment:

[https://news.ycombinator.com/item?id=8634895](https://news.ycombinator.com/item?id=8634895)

The part of the comment that I found the most interesting was his take on a
solution:

 _1\. Make everything vectors. You 'll have to choose between weird
antialiasing artifacts and potential pixel cracks; either way things will look
bad. And you'll encounter bitmaps eventually, and have to deal with the
necessities of resampling and pixel aligning at that point. 2. Scale only to
integral sizes, and resample. You'll avoid antialiasing and pixel alignment
issues, but pay a performance penalty, and things may look slightly blurry._

~~~
protomyth
I'm curious about this. Aren't fonts vector files with some hinting?

~~~
Someone
I do t know about the "some", but that is what that Apple engineer says:

 _Which leads to the problem of centering. I wish to center a bitmap image
within a button 's border. The image is 101 logical points high, and the
border is 200 logical points high. With a 2x scale factor, I can center
absolutely, and still be aligned to device pixels. With a 1x, 1.25, 1.33, etc.
scale factor, centering will align me on a partial pixel, which looks like
crap. So I have to round. Which way? If the goal is "make it look good," then
the answer is "whichever way looks good," which depends on the visual style of
the bezel, i.e. whether the top or bottom has more visual weight. So now we
need hinting._

 _And that 's where things start to get really nasty. In order to make things
look good at arbitrary resolutions, we want to round to device pixels. But the
rounding direction is not a local question! Consider what happens if we have
two visual elements abutting in logical coordinates, and they round in
opposite directions: now there's a device pixel between them. That's very
visible: you get a pixel crack! So you have to coordinate rounding._

Question: even with hinting, is it actually possible to make a font where two
glyphs align perfectly without white space between them?

 _WPF is a good example of a framework that attempted resolution independence
and encountered this problem. Initially it has the "SnapsToDevicePixels"
property, which triggers rounding behavior at draw time. But draw time is too
late, because of the "abutting elements rounding in opposite directions"
problem. So they introduced the "UseLayoutRounding" property, which
does...something. And the guidance is basically "turn it on and see if it
helps, if not, disable it." Great._

I think a way out of this is way higher DPI with some blurring as the last
step. That's what print does. At 1000 or 2500 DPI nobody will notice aliasing
anymore, and he blurring would take care of small cracks between objects that
supposedly are abutting, make cases where two objects that shouldn't
accidentally do overlap less obnoxious, etc.

------
kps
The saddest thing about this is that X11 was intended from the start to
support multiple DPIs (see e.g. xdpyinfo(1)) and originally shipped with
rasterized fonts in multiple resolutions. Sadly the "year of the desktop"
crowd has been absolutely consistent in forcing *nix UIs down into the Windows
mold.

------
bitL
If your display is over 1080p (I use 1920x1200), Linux (at least Mint 17)
switches to HiDPI by default, reducing my effective resolution to 960x600...
There is some obscure setting that can switch HiDPI off, but it's a mess
overall for the time being as some apps still use HiDPI (like gdm).

~~~
yaantc
I have the same display with Debian and no issue. So it's either introduced by
Mint or Ubuntu (Mint is Ubuntu derived). Most likely by Mint, as the UI
customization is very distro specific.

~~~
sampo
Must be Mint. Ubuntu's Unity has an adjustable slider for scaling under
Display settings.

Or more precisely, this is a Desktop Environment thing, not a distro thing. So
whatever DE /u/bitL is using in their Mint (Cinnamon?) is the culprit.

~~~
bitL
Yep, it's Cinnamon, I've just installed a Debian on a new server and switched
to Cinnamon, and the same happened there as well... Cinnamon has scaling
slider as well, HiDPI is a bit different thing (and a different option in
general settings).

------
phkahler
For web browsers I thought CTRL+ and CRTL- were for dealing with this, but I
think that is stored on a site by site basis. Something similar for the UI
would be nice too, but IMHO should be kept independent of the "data" the app
displays.

~~~
sampo
> _For web browsers I thought CTRL+ and CRTL- were for dealing with this, but
> I think that is stored on a site by site basis._

CTRL-+ can really break the page layout in surprisingly varied ways.

~~~
phkahler
That's why HTML was intended for dynamic layout. People who want to specify
fixed layouts are doing it wrong.

------
klaasvakie
I have a Thinkpad Yoga 2 --- 3800x1800 I think --- I find that the GTK-based
stuff works well on HiDPI, but not automatically, so you need to fiddle with
the GTK settings a bit.

The QT stuff is worse since they cannot be fixed by adjusting only the font
size.

The older (Xaw3D,TK) stuff is really bad.

I have never seen different DPI on different displays working.

99% of my day is spent in the terminal (xfce4-terminal) though and the crisp
text makes it all worth while.

~~~
sciurus
It's 3200x1800, so that with pixel doubling you can an effective 1600x900.

------
marcosdumay
I see that phrasing all the time:

"Well, KDE can do what we are looking for, but GNOME does it in a hackish way.
As we use GNOME, our review is all about it, and as a conclusion, Linux is no
good."

Why do these people insist on using GNOME after all?

~~~
jeorgun
I assume you haven't used both GNOME and KDE on a high-DPI monitor, because
KDE's support for it is certainly not better. Qt themes don't scale, web views
don't scale, icon, window, plasma panel, etc sizes need to be configured
independently of font DPI, some applications just fritz out at high DPI font
sizes. I've tested both 4.13 and 5.3, and haven't noticed any significant
improvement in the latter. I'm a fan of KDE, but on my high-DPI laptop, I'm
using GNOME purely because its "hackish" solution does work a lot better.

~~~
marcosdumay
Well, I didn't. I don't have any HDPI display.

But I've seen that from people complaining about workflow, supporting non-
usual options, and accessibility.

Anyway, yours is the first review I see about KDE in HDPI.

------
jackalope
I thought the whole point of High-DPI was to was to free us from the need to
render graphics pixel-perfect at native resolution. While scaling bitmaps will
probably be necessary for photographs and most video for a long time, can't
everything else be rendered using SVG? Does such an environment already exist?

~~~
wmf
There was a good discussion of this topic yesterday in the iPhone screen
thread:
[https://news.ycombinator.com/item?id=8634662](https://news.ycombinator.com/item?id=8634662)

------
VLM
Its a good article about High-DPI displays and Gnome, as the author writes
"Your editor's experiments have mostly been with GNOME, so this article will
have an unavoidable bias in that direction."

I've had 1600x1200 CRT or LCD on my main desktop since... 00s? Late 90s? If
you make money typing at a desk, you're foolish not to splurge on desk, chair,
lighting, quiet, keyboard... and monitor. I've been dealing with this class of
problem since the 80s although it was a little different back then...

If gnome-less, "linux" or more accurately, FOSS in general, has no problem
with high res displays, in fact its really nice, far from a problem.

I don't know if KDE in general has resolution problems. Konsole looks
beautiful at high res and decent font. The only thing more flame war-ish than
emacs vs vi is font choice, however I have noticed visible quality differences
such that random font A in 2005 at 24 pt size looks much worse than it does at
10pt size, and this varies by font and over time.

An example of the above I have freebsd on the other machine on my desk and
displaying Monospace in a konsole font size 12 is "normal" but when you kick
it up to 13 it looks perma bold because thats the 1 pixel to 2 pixel
transition for Monospace on that platform and exact config. Luxi Mono displays
"normally" at 11, permabold at 12, and at very large sizes like 17 it looks
very peculiar randomish parts of letters display as 1 or 2 pix wide. Nimbus
Mono L Regular 16 looks nice to my eyes and thats mostly what I use on that
machine at 1600x1200.

The biggest problem I have is finding really good UTF8 fonts. There's a nice
test file called UTF-8-demo.txt Its mirrored and copied all over, here is one
link:

[http://www.cl.cam.ac.uk/~mgk25/ucs/examples/UTF-8-demo.txt](http://www.cl.cam.ac.uk/~mgk25/ucs/examples/UTF-8-demo.txt)

I find this a true test of difficult display rendering on linux.

The ergonomics of widescreen for long term anything, including movie viewing,
is another topic and I believe my multiple high res 4:3 monitors are a
productivity booster for me, so until they break I'll keep them.

------
irixusr
My 12 year old irix fuel v10 that I used for my phd has full vector graphics
and fonts and supports monitor resolutions much higher than I can
afford/justify today.

I miss working on my irix :(

------
secure
Another interesting angle is that it’s not only application software we need
to change, but also the hardware drivers are not quite there yet:

I have a Dell UP2414Q (3840x2160 resolution, driven via DisplayPort 1.2)
connected to a nVidia GTX 660 card, which was one of the cheapest ones that
support DP 1.2.

With the proprietary nvidia driver, I need to manually edit the xorg
configuration file to have the correct modes and most importantly disable
XRandR in favor of Xinerama.

This in turn breaks e.g. GNOME shell on Fedora 20 (without RandR, you’ll just
get an exception in your syslog), and in general prevents plenty of use-cases
(e.g. redshift for controlling display brightness, or changing rotation
settings without restarting X11).

The reason for having to disable RandR is that there is not currently a
standard way on how to represent multi-stream transport (MST) connections, and
4K displays require 2 streams (1920x1080 each) at the same time. With RandR
enabled, what you’ll see is 2 connected outputs, and all applications will
treat them as such, even though you have only one monitor connected.

Fixing this requires changes in RandR (i.e. the X server) and each driver.
AFAIK, on the intel driver this should work, on nouveau there’s work under
way, no clue about the proprietary nvidia driver.

~~~
Excavator
I'm running 3840x2160 on a Samsung U28D590 with the GeForce GTX 780 6GB card
over DisplayPort 1.2 with 4 lanes @ 5.4GB/s.

Driver version: 346.16 XOrg server version: 1.16.1 (11601000)

The only issue I've ran into is that Gnome Shell won't respond to clicks when
I run in 30bits/pixel mode.

------
jblow
Random mom-and-pop folks have been able to buy high-DPI laptops at Best Buy
for well over a year. (And higher DPI than discussed in this article; for
example, 3200x1800).

In computer lifecycle terms that is a _long_ time and it is a little bit
embarrassing that Linux works as poorly as it does in these situations.
(Windows ain't so great at it either, which reflects poorly on Microsoft, but
it still handles the situation a lot better than Linux does.)

------
viseztrance
My 11 inch asus laptop has a full hd display. So it's somewhere in the middle.

Gnome's hidpi support doesn't allow float values, making this a serious issue
to me. On top of that, you'll have to change the cursor size manually by
diving into the config.

The iphone 6+ display uses downsampling, so perhaps that's the way to go. But
as things stand, I don't see my self using an external monitor in the near
future, even after wayland becomes mainstream.

~~~
adrusi
You have a 200dpi screen. Using a scalling factor of 2, you'd still have a
higher than average dpi.

~~~
viseztrance
Unfortunately, that's not the case. I have tried it and the usable screen real
state is so small, that gnome is unusable. I like big fonts, and found that a
scaling of 1.5 is about right.

------
lazerscience
Because the article mentions that Chromium doesnt have HighDPI support right
now: You can actually compile it with the -Denable_hidpi=1 flag which at least
displays most web sites in the right way though the menu/navigation is broken
(which is probably the main reason it isnt enabled by default).

~~~
enobrev
There's also a setting in chrome://flags (ctrl+f search for dpi: "Overrides
the device scale factor on the device"), although the dropdowns no longer work
and the tabs look ridiculous when set to anything above 1.

------
dharma1
unity8 on ubuntu has a good resolution independent framework and high dpi
support. legacy apps are a bit harder to sort out

------
andmarios
Imo Linux, KDE and most other software works nicely with HiDPI.

A small issue is GTK apps that don't respect DPI settings.

The most significant problem AFAIK is for people who switch frequently between
different displays. There are a few settings here and there you have to adjust
every time you switch between Hi and Lo-DPI.

~~~
ultramancool
> Imo Linux, KDE and most other software works nicely with HiDPI.

Having written some Qt apps and used them on scaled screens... eh. It's got
some work to go, but we're making progress. Apparently Qt 5.4 will have
further improvements in this field too.

~~~
andmarios
If we are talking about complete resolution independence I agree.

Currently on two monitors with the same physical dimensions but different
resolution you can't get a common rendering. But you can get a decent
rendering from both of them, albeit a bit different; one for example will have
a tad larger icons, the other maybe a little larger fonts,etc.

~~~
simonh
I suppose this is why Apple went to 5K for the 27" iMac. It's exactly double
the pixel dimensions of the non-5K version, so everything looks exactly the
same size but with higher fidelity.

Not necessarily a big deal for consumers, but vital for professionals that
have preferred working screen layouts on their old machines and don't want to
change that on the new ones.

------
chroma
What a mess. I didn't know HiDPI was so spotty on Linux. It's unclear to me
why people would subject themselves to such an experience. If you want a HiDPI
laptop, why not spend a little more to get a retina mac? On a developer's
salary, the difference is a rounding error.

~~~
hpaavola
I would not call it a mess. I run Ubuntu on Lenovo X1 Carbon and Asus Zenbook
UX31A and on both machines all the software that I run except Steam work just
fine.

And OSX is not Linux. I don't want non-Linux OS.

~~~
bitL
How do you survive with UX31A's touchpad in Linux? On my UX32VD it's the most
horrible part of Linux experience (also battery drained while idle in 2 hours
(2 SSDs) doesn't help)

~~~
klaasvakie
I don't have an UX31A, but an UX31E --- the touchpad is brilliant (I think
mine has the elantech one)

Also, I get 7.5 hours on the battery, I wonder what went wrong between the
UX31E and the UX31A?

~~~
jcagalawan
I have a UX31A and my experience is like yours with Ubuntu 14.04.

Only quirk I have with the touchpad is that on Windows, with 1 finger idle on
the touchpad and another finger moving the cursor would still move with the
moving finger. On Ubuntu, the cursor remains stationary any time there are two
fingers on it. I probably would not have noticed it if I weren't already so
used to the Windows functionality so it isn't a big deal at all.

