Allow disabling atomic modeset with LIBKMSXX_DISABLE_ATOMIC
[android/external-libkmsxx.git] / libkms++ / card.cpp
index 7fb910fda38956bf437527ece402252654836cf7..d652093b3b109b654373da24e986145cd27fd615 100644 (file)
@@ -38,8 +38,12 @@ Card::Card()
        r = drmSetClientCap(m_fd, DRM_CLIENT_CAP_UNIVERSAL_PLANES, 1);
        m_has_universal_planes = r == 0;
 
-       r = drmSetClientCap(m_fd, DRM_CLIENT_CAP_ATOMIC, 1);
-       m_has_atomic = r == 0;
+       if (getenv("LIBKMSXX_DISABLE_ATOMIC") == 0) {
+               r = drmSetClientCap(m_fd, DRM_CLIENT_CAP_ATOMIC, 1);
+               m_has_atomic = r == 0;
+       } else {
+               m_has_atomic = false;
+       }
 
        uint64_t has_dumb;
        r = drmGetCap(fd, DRM_CAP_DUMB_BUFFER, &has_dumb);