summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@ti.com>2015-11-11 20:50:55 +0200
committerTomi Valkeinen <tomi.valkeinen@ti.com>2015-11-11 20:50:55 +0200
commit131a6e455743b757f8a5f79aefa956b046dce4ba (patch)
tree7d79caf493fd734df9acb8480f7af85b0f4183ce
parent3ba7c3f1d0298306af37471027a5fc9e204ece8c (diff)
card: fix has_atomic if libdrm does not have atomic support
If libdrm was missing DRM_CLIENT_CAP_ATOMIC, but the driver still supported atomic modesetting, m_has_atomic was set to true. The end result was that test apps thought they can use atomic modesetting, but it wasn't functional in the libkmsxx.
-rw-r--r--libkms++/card.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/libkms++/card.cpp b/libkms++/card.cpp
index 2bb6673..a0e395e 100644
--- a/libkms++/card.cpp
+++ b/libkms++/card.cpp
@@ -11,10 +11,6 @@
#include "kms++.h"
-#ifndef DRM_CLIENT_CAP_ATOMIC
-#define DRM_CLIENT_CAP_ATOMIC 3
-#endif
-
using namespace std;
namespace kms
@@ -42,12 +38,16 @@ Card::Card()
m_has_universal_planes = false;
}
+#ifdef DRM_CLIENT_CAP_ATOMIC
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;
}
+#else
+ m_has_atomic = false;
+#endif
uint64_t has_dumb;
r = drmGetCap(fd, DRM_CAP_DUMB_BUFFER, &has_dumb);