summaryrefslogtreecommitdiff
path: root/kms++util
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2019-06-17 02:31:28 +0300
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2021-09-05 00:54:49 +0300
commit70ed259ba057e629ad22ac93168a438dbd93113f (patch)
tree91df416b0d08c6231975e94a96da84a9c0df4ebc /kms++util
parent77eedf7574809ce5edf4d4ea6aa55542b3045c02 (diff)
card: Add support for writeback connectors
Enable enumeration of writeback connectors if both libdrm and the device support it. The new Card::has_writeback() method report if the card support writeback connectors. Existing code that expect all connectors to model an output may be confused by the sudden availability of new connectors. To handle this issue, - add a KMSXX_DISABLE_WRITEBACK_CONNECTORS environment variable to disable enumeration of writeback connectors, similarly to universal planes ; and - ignore writeback connectors where no specific connector is requested (Card::get_first_connected_connector(), ResourceManager::reserve_connector() if no connector name is specified, and applications that use all connected outputs). Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Diffstat (limited to 'kms++util')
-rw-r--r--kms++util/meson.build2
-rw-r--r--kms++util/src/resourcemanager.cpp5
2 files changed, 6 insertions, 1 deletions
diff --git a/kms++util/meson.build b/kms++util/meson.build
index 9df75e1..6dfce8f 100644
--- a/kms++util/meson.build
+++ b/kms++util/meson.build
@@ -34,7 +34,7 @@ if thread_dep.found()
libkmsxxutil_args += [ '-DHAS_PTHREAD' ]
endif
-libkmsxxutil_deps = [ libkmsxx_dep, libfmt_dep, thread_dep ]
+libkmsxxutil_deps = [ libkmsxx_dep, libdrm_dep, libfmt_dep, thread_dep ]
libkmsxxutil = library('kms++util',
libkmsxxutil_sources,
diff --git a/kms++util/src/resourcemanager.cpp b/kms++util/src/resourcemanager.cpp
index 5a9f016..01edaf3 100644
--- a/kms++util/src/resourcemanager.cpp
+++ b/kms++util/src/resourcemanager.cpp
@@ -2,6 +2,8 @@
#include <algorithm>
#include <kms++util/strhelpers.h>
+#include <xf86drmMode.h>
+
using namespace kms;
using namespace std;
@@ -20,6 +22,9 @@ void ResourceManager::reset()
static Connector* find_connector(Card& card, const set<Connector*> reserved)
{
for (Connector* conn : card.get_connectors()) {
+ if (conn->connector_type() == DRM_MODE_CONNECTOR_WRITEBACK)
+ continue;
+
if (!conn->connected())
continue;