[weston,07/13] compositor-drm: Enable the stereo capability.

Submitted by Emmanuel Gil Peyrot on Nov. 14, 2017, 3:05 p.m.

Details

Message ID 20171114150600.1763-8-linkmauve@linkmauve.fr
State New
Headers show
Series "Add stereoscopy support" ( rev: 1 ) in Wayland

Not browsing as part of any series.

Commit Message

Emmanuel Gil Peyrot Nov. 14, 2017, 3:05 p.m.
From: Emmanuel Gil Peyrot <emmanuel.peyrot@collabora.com>

This makes DRM list the stereo modes in addition to the usual mono
ones, it’s now just a matter of modeset whether we enable stereo or
not.

Signed-off-by: Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
---
 libweston/compositor-drm.c | 7 +++++++
 1 file changed, 7 insertions(+)

Patch hide | download patch | download mbox

diff --git a/libweston/compositor-drm.c b/libweston/compositor-drm.c
index b641d61e..d3480f08 100644
--- a/libweston/compositor-drm.c
+++ b/libweston/compositor-drm.c
@@ -2081,6 +2081,13 @@  init_kms_caps(struct drm_backend *b)
 
 	weston_log("using %s\n", b->drm.filename);
 
+	if (!b->use_pixman) {
+		ret = drmSetClientCap(b->drm.fd, DRM_CLIENT_CAP_STEREO_3D, 1);
+		if (ret == 0)
+			b->compositor->capabilities |= WESTON_CAP_STEREOSCOPY;
+		weston_log("DRM: %sstereo support\n", ret != 0 ? "no " : "");
+	}
+
 	ret = drmGetCap(b->drm.fd, DRM_CAP_TIMESTAMP_MONOTONIC, &cap);
 	if (ret == 0 && cap == 1)
 		clk_id = CLOCK_MONOTONIC;