Allow disabling universal planes with LIBKMSXX_DISABLE_UNIVERSAL_PLANES
[android/external-libkmsxx.git] / libkms++ / card.cpp
index d652093b3b109b654373da24e986145cd27fd615..5f8dbd14fd6da02df86edbf13ea1eff0b43686cb 100644 (file)
@@ -35,8 +35,12 @@ Card::Card()
        r = drmSetMaster(fd);
        m_master = r == 0;
 
-       r = drmSetClientCap(m_fd, DRM_CLIENT_CAP_UNIVERSAL_PLANES, 1);
-       m_has_universal_planes = r == 0;
+       if (getenv("LIBKMSXX_DISABLE_UNIVERSAL_PLANES") == 0) {
+               r = drmSetClientCap(m_fd, DRM_CLIENT_CAP_UNIVERSAL_PLANES, 1);
+               m_has_universal_planes = r == 0;
+       } else {
+               m_has_universal_planes = false;
+       }
 
        if (getenv("LIBKMSXX_DISABLE_ATOMIC") == 0) {
                r = drmSetClientCap(m_fd, DRM_CLIENT_CAP_ATOMIC, 1);