[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#746966: HiDPI support



Package: debian-installer
Followup-For: Bug #746966
X-Debbugs-Cc: diegoe@gnome.org

I was trying to figure out how to fix this so that there's a smarter
default that figures out if the screen is way too "big" (hinting that it
is HIDPI).

I thought this should go in console-setup, but perhaps it rather has to
be here. Figuring out the system's condition is not _that_ complex I
think, here's the snippet I was testing in console-setup:

```
    # Our minimal HIDPI screen size defaults to 1600px wide, a common
    # resolution on 13-14" panels.
    #
    # For example, a 2560x1600px screen will behave like this:
    # * Using Terminus16 it will fit 320 cols (5px/col)
    # * Using Terminus32x16 it will fit 160 cols (10px/col)

    MIN_WIDTH_HIDPI=1600
    virtual_size=/sys/class/graphics/fb0/virtual_size

    if [ "$kernel" = linux -a -e "$virtual_size" ]; then
        width=`cut -d',' -f2 < "$virtual_size"`

        if [ "$width" -ge "$MIN_WIDTH_HIDPI" ]; then
            FONTSIZE="16x32"
        fi
    else
        FONTSIZE=16
    fi
```

No doubt the check for the fb0 device could be more elegant, but I think
it's a _reasonable_ assumption that when a framebuffer device is
present, we are on a modern system + if the `virtual_size` is BIG, we
can reasonably assume it's a HIDPI screen.

On further reflection I think perhaps this should be in the startup or
configuration scripts of `debian-installer` (?), rather than
`console-setup`, and then, during the installation, inherit the detected
FONTSIZE to `console-setup` via debconf.

Note that there's also:
  https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=859458

which points out that `console-setup` has some issues with not running
`setupcon` early enough in initramfs, which also needs a solution to make
sure we get proper, readable fonts as early as possible.

I would like to help fix this but I'm not familiar enough with
_conceptually_ who should be changing this setting, but surprisingly it
seems to be rather simple to gather the info we need to make the
decision in whatever script should make it.

Thanks!

-- System Information:
Debian Release: bullseye/sid
  APT prefers unstable-debug
  APT policy: (500, 'unstable-debug'), (500, 'unstable')
Architecture: amd64 (x86_64)

Kernel: Linux 5.7.0-2-amd64 (SMP w/4 CPU threads)
Kernel taint flags: TAINT_OOT_MODULE, TAINT_UNSIGNED_MODULE
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE=en_US:en
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled


Reply to: