Pimax VR headsets not recognized as non-desktop output
To get a list of all EDID product IDs for Pimax, you can install their "Pimax Play" software on a Windows VM and check the file %LOCALAPPDATA%\Pimax\PiService\tmp.json
. Current version: pimax.json
The following jq
expression returns a list of pid and vids for every device in that file:
$ jq -r '.hmds[].displays | select(. != null) | .[] | [.edid_vid, .edid_pid] | @tsv' tmp.json | sort | uniq
53822 3
53826 4121
53826 4122
53826 4123
53838 4121
Short python script to convert the little-endian vendor ids to their ascii representation:
import struct
import sys
pid_le = int(sys.argv[1])
pid_be = struct.pack('<H', pid_le)
pid = struct.unpack('>H', pid_be)[0]
# bit 15 has to be 0
assert pid ^ (1 << 15)
# 5 bits per letter
mask = 0b11111
letters = [
((pid >> 10) & mask),
((pid >> 5) & mask),
((pid >> 0) & mask),
]
# Print as char
print(*map(lambda x: chr(x + 64), letters))
This yields
$ python pimax.py 53822
O V R
$ python pimax.py 53826
P V R
$ python pimax.py 53838
S V R
@Coreforge pointed out that the S V R and O V R ones already have quirks, so it leaves us with the following patch:
From ed3f43e17f5af5350bb66ac9cabf517a4932cdde Mon Sep 17 00:00:00 2001
From: Sefa Eyeoglu <contact@scrumplex.net>
Date: Mon, 20 May 2024 18:28:39 +0200
Subject: [PATCH] drm/edid: add non-desktop quirk to Pimax VR headsets
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
---
drivers/gpu/drm/drm_edid.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
index 0f7c4c5b14b9..80341f11ef40 100644
--- a/drivers/gpu/drm/drm_edid.c
+++ b/drivers/gpu/drm/drm_edid.c
@@ -237,6 +237,11 @@ static const struct edid_quirk {
EDID_QUIRK('S', 'E', 'C', 0x144a, EDID_QUIRK_NON_DESKTOP),
EDID_QUIRK('A', 'U', 'S', 0xc102, EDID_QUIRK_NON_DESKTOP),
+ /* Pimax VR Headsets */
+ EDID_QUIRK('P', 'V', 'R', 0x1019, EDID_QUIRK_NON_DESKTOP),
+ EDID_QUIRK('P', 'V', 'R', 0x101a, EDID_QUIRK_NON_DESKTOP),
+ EDID_QUIRK('P', 'V', 'R', 0x101b, EDID_QUIRK_NON_DESKTOP),
+
/* Sony PlayStation VR Headset */
EDID_QUIRK('S', 'N', 'Y', 0x0704, EDID_QUIRK_NON_DESKTOP),
--
2.44.1
But I am unsure if we should push this as is, as I would like people to actually confirm if these do anything first.