With Louis's configfs series [1], a VKMS connector can read an EDID. An EDID whose HDMI Vendor-Specific Data Block declares 3D (HDMI 1.4b) makes the EDID parser list stereo modes, but the probe helper drops them because VKMS never sets stereo_allowed, and VKMS would not show them right anyway: a frame packing mode describes one eye, while its frame holds both eyes and the vertical blanking between them.
This series lets the composer and the writeback connector use the frame of both eyes, allows stereo modes, and adds KUnit tests. A VKMS connector then behaves like an HDMI 3D sink for compositor and IGT tests: a test sets a stereo mode with a known left and right eye and reads each eye back from the writeback buffer, with no 3D display. Tested in QEMU/KVM on the base below, with Louis's v5 and the two v5 fixes proposed in [2] and [3] applied: - KUnit: vkms-stereo passes next to vkms-config, vkms-configfs, vkms-format and vkms-color. Without patches 1 and 2, the test reports all 14 stereo formats of its EDID as not listed; with patch 2 but not patch 1, frame packing fails both writeback size checks (the frame-sized buffer is refused, the one-eye buffer accepted). - A userspace test that sets every stereo mode a test EDID and a Sony KDL-46HX855's EDID (a 3D TV) give, with known eyes, and compares the writeback buffer pixel by pixel: 91 of 91 checks pass. Frame packing 1080p is 1920x2205 with the right eye from line 1125, 720p is 1280x1470 from line 750; top-and-bottom and side by side (half) stay in the 2D frame; one plane per eye at its place gives the same frame; a 2D mode stays 2D; the vblank period of 1080p24 frame packing is the same 41666.7 us as 1080p24. Without patch 1, every frame packing commit with a frame-sized writeback buffer is refused. - IGT kms_3d: pass, ten stereo modes set. This needs the PATH fix [2]: with v5 as posted, kms_3d fails in kmstest_get_path_blob() on any VKMS connector. - With KASAN on, the three runs above give no report. - The same changes on a 7.3-rc1 based tree, with a KWin build that supports HDMI 3D modes (Sparky Stereo OS): KWin lists the stereo modes of the VKMS connector, sets them, and its frames hold each eye where the layout puts it. Not covered: interlaced stereo modes (VKMS does not set interlace_allowed, so the mandatory 1080i side by side (half) formats are not listed), and the HDMI vendor InfoFrame, which VKMS has no link to send. The test and its EDIDs: https://github.com/Sparky-OS/sparky-stereo-os/tree/main/tools/vkms-stereo-bench [1] https://lore.kernel.org/dri-devel/[email protected]/ [2] https://lore.kernel.org/dri-devel/[email protected]/ [3] https://lore.kernel.org/dri-devel/[email protected]/ Daniel Campos Ramos (3): drm/vkms: Compose the frame of both eyes for stereo modes drm/vkms: Allow stereo modes drm/vkms: Add KUnit tests for stereo modes drivers/gpu/drm/vkms/Kconfig | 1 + drivers/gpu/drm/vkms/tests/Makefile | 1 + drivers/gpu/drm/vkms/tests/vkms_stereo_test.c | 476 ++++++++++++++++++ drivers/gpu/drm/vkms/vkms_composer.c | 9 +- drivers/gpu/drm/vkms/vkms_connector.c | 2 + drivers/gpu/drm/vkms/vkms_output.c | 2 + drivers/gpu/drm/vkms/vkms_writeback.c | 11 +- 7 files changed, 494 insertions(+), 8 deletions(-) create mode 100644 drivers/gpu/drm/vkms/tests/vkms_stereo_test.c base-commit: 6648301c5bb2ef23f0fb15bcb01d21ff66f36799 prerequisite-message-id: <[email protected]>
