Displayport over USB Type C not working on GPD Pocket

I have the original model of the GPD Pocket, bought in 2017. Tried many Linux distros before until installing Ubuntu Mate definitely for some years now. Recently I bought a USB Type C to Displayport cable, in order to use an external monitor with the laptop. Originally didn't worked, so I had to downgrade the BIOS from the latest version to the unlocked one (dated June 28th, 2017, as seen here), enabled the DP Over Type C option.

At first it worked, I could see the boot screen on the external monitor, but soon after it stopped when the system loaded. Connecting the cable after the system booted also doesn't work. Is there any work being made to support Displayport over Type C on the GPD Pocket? I believe that is an old issue still opened on other distros, none of them as organized as Ubuntu Mate.

After some more research, looks like there's already a solution for that: https://github.com/stockmind/gpd-pocket-ubuntu-respin/issues/98#issuecomment-467014805

Does anyone knows how can I verify if this option is available on current Ubuntu Mate kernel? If not, it'll probably need a kernel compilation if I'm not mistaken.

Just for completion's sake, I'll transcribe a reply from an email message I've sent some months ago to the author of the link above (substitute GH into github.com):

On 4/9/21 1:18 AM, Vinicius Cordeiro wrote:

Good evening, Hans! I hope you are well.

I have a GPD Pocket 1 running Ubuntu Mate for some years now. Tried many other distros, including stockmind's Ubuntu respin, but Ubuntu Mate suited me better.

Two years ago you announced here ‐ GH/stockmind/gpd‐pocket‐ubuntu‐respin/issues/98#issuecomment‐467014805 ‐ that Displayport over USB type C was supported from that date on. I have the unlocked BIOS installed with the /DP Over Type C/ option enabled. Bought a USB Type C to Displayport cable on Aliexpress that works on my Windows 10 laptop, and it partially worked on the GPD Pocket: the boot screen appeared on the external monitor, as well as the screen to type the password to access the encrypted disk, but when the OS loads it stops working.

Is there any way I can check if my current kernel has support for Displayport enabled? If not, will I have to compile a custom kernel to enable it? Or am I missing something here?

You will need to build a custom kernel, there was some resistance to my solution for fixing this and I dropped the ball a bit on refactoring it.

Fixing this consists of 2 parts:

  1. Pass info about DP‐altmode being available to the kernel's typec subsystem, I actually have been working on that the last 2 days and those changes should land in 5.13 with some luck. With this in place things mostly work, but you need to manually run "xrandr" when hot‐plugging in the Type‐C dongle while Linux is running. To add this "part 1" to an existing kernel you need to add the following 3 patches:

GH/jwrdegoede/linux‐sunxi/commit/665639003f0c81a18ad96fea065865cf60357b5a
GH/jwrdegoede/linux‐sunxi/commit/3341418366fbe686b86b2e66575dbdc28b726e6d
GH/jwrdegoede/linux‐sunxi/commit/cf36cecb8277300b607b823d237a24b89bc97f27

  1. Add a notifier between the Type‐C DP‐altmode code and the i915 driver to avoid the need to run "xrandr" to force a refresh of the monitor settings on hotplug:

GH/jwrdegoede/linux‐sunxi/commit/cf36cecb8277300b607b823d237a24b89bc97f27
GH/jwrdegoede/linux‐sunxi/commit/adf64422a9c894ca5c3f599df22067d9ec773bcf
GH/jwrdegoede/linux‐sunxi/commit/e23ead9c40f731652763f7e1af804add62d5bd74

Note the last 3 can be omitted if you wish, but they certainly make things work better.

You can change the URLs to plain .patch files by adding .patch at the end.

Regards,

Hans