[PATCH weston v12 16/40] compositor-drm: Allow disabling atomic

Daniel Stone daniels at collabora.com
Tue Sep 26 17:15:49 UTC 2017


Add a test environment variable to allow disabling atomic modesetting.

Signed-off-by: Daniel Stone <daniels at collabora.com>
---
 libweston/compositor-drm.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/libweston/compositor-drm.c b/libweston/compositor-drm.c
index d04ba12f..8cd69f1f 100644
--- a/libweston/compositor-drm.c
+++ b/libweston/compositor-drm.c
@@ -3240,11 +3240,13 @@ init_kms_caps(struct drm_backend *b)
 		   b->universal_planes ? "supports" : "does not support");
 
 #ifdef HAVE_DRM_ATOMIC
-	ret = drmGetCap(b->drm.fd, DRM_CAP_CRTC_IN_VBLANK_EVENT, &cap);
-	if (ret != 0)
-		cap = 0;
-	ret = drmSetClientCap(b->drm.fd, DRM_CLIENT_CAP_ATOMIC, 1);
-	b->atomic_modeset = ((ret == 0) && (cap == 1));
+	if (!getenv("DRM_DISABLE_ATOMIC")) {
+		ret = drmGetCap(b->drm.fd, DRM_CAP_CRTC_IN_VBLANK_EVENT, &cap);
+		if (ret != 0)
+			cap = 0;
+		ret = drmSetClientCap(b->drm.fd, DRM_CLIENT_CAP_ATOMIC, 1);
+		b->atomic_modeset = ((ret == 0) && (cap == 1));
+	{
 #endif
 	weston_log("DRM: %s atomic modesetting\n",
 		   b->atomic_modeset ? "supports" : "does not support");
-- 
2.14.1



More information about the wayland-devel mailing list