I recently bought a GPD Pocket 2 as a machine to play around with in my spare time. Because I’d like it to be fast and lean, I decided to install Arch Linux running the i3 window manager.

Plymouth being rotated

The GPD Pocket 2 and other GPD models for some reason have an LCD panel that is installed sideways (as in: the top of the panel is on the left of the screen, rotated 90 degrees). This is easily fixed for the console and in by passing a kernel command line parameter and in Xorg by some configuration options, but the Plymouth splash screen and prompt for the disk crypto password are still sideways, which is awkward.

Some initial digging

On reddit I came across Red Hat developer called Hans de Goede who did a lot of good work to get the video to work properly on these little machines. He wrote patches for Plymouth which have been around for a few versions and that should work on many of these small machines, so why didn’t it work for me?

Plymouth uses the DRM (Direct Rendering Manager) subsystem in the kernel for its graphics and also to obtain information on which displays are available. Part of this information is the orientation of the display panel, which on my machine was being reported as normal, not rotated.

The DRM tree in the kernel source has a file called drm_panel_orientation_quirks.c which aims to detect this based on some information:

  • System identifier strings in the DMI. Unfortunately, for the Pocket 2 these are all very generic, so it further relies on:
  • The BIOS firmware version date.

The latter was the problem: my BIOS version was newer than what was listed in the kernel. This caused my panel orientation to be reported incorrectly.

Is it configurable?

The documentation on Plymouth isn’t great, so I did some digging around in the source code to find a configuration option, but that yielded nothing. I came across a PR and issue asking for this exact thing, where was referred to the kernel command line options for DRM. And indeed, since kernel 5.7 there is a configuration option:

- panel_orientation, one of "normal", "upside_down", "left_side_up", or
  "right_side_up". For KMS drivers only, this sets the "panel orientation"
  property on the kms connector as hint for kms users.

At this time of writing, 5.7 had just been released and hadn’t made it into Arch yet, but a few days later it did, and it works!

tl;dr:

Use a version 5.7 or higher kernel and add video=eDP-1:panel_orientation=right_side_up to your kernel command line to fix the rotation in Plymouth on your GPD machine. On Ubuntu 20.04 or higher you should have a version recent enough if you install the HWE kernel image.