From 74d60e252839a03a2f179d82126d1e0db1b4184e Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Mon, 17 Jun 2019 02:31:28 +0300 Subject: 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 --- utils/kmsblank.cpp | 5 +++++ utils/kmstest.cpp | 4 ++++ utils/meson.build | 2 +- 3 files changed, 10 insertions(+), 1 deletion(-) (limited to 'utils') diff --git a/utils/kmsblank.cpp b/utils/kmsblank.cpp index d9a3460..207d807 100644 --- a/utils/kmsblank.cpp +++ b/utils/kmsblank.cpp @@ -5,6 +5,8 @@ #include #include +#include + using namespace std; using namespace kms; @@ -74,6 +76,9 @@ int main(int argc, char** argv) while (true) { for (Connector* conn : conns) { + if (conn->connector_type() == DRM_MODE_CONNECTOR_WRITEBACK) + continue; + if (!conn->connected()) { printf("Connector %u not connected\n", conn->idx()); continue; diff --git a/utils/kmstest.cpp b/utils/kmstest.cpp index 3f1716f..15db072 100644 --- a/utils/kmstest.cpp +++ b/utils/kmstest.cpp @@ -17,6 +17,8 @@ #include +#include + using namespace std; using namespace kms; @@ -618,6 +620,8 @@ static vector setups_to_outputs(Card& card, ResourceManager& resman, if (outputs.empty()) { // no outputs defined, show a pattern on all connected screens for (Connector* conn : card.get_connectors()) { + if (conn->connector_type() == DRM_MODE_CONNECTOR_WRITEBACK) + continue; if (!conn->connected()) continue; diff --git a/utils/meson.build b/utils/meson.build index ac73b5b..39ee7db 100644 --- a/utils/meson.build +++ b/utils/meson.build @@ -1,4 +1,4 @@ -common_deps = [ libkmsxx_dep, libkmsxxutil_dep, libfmt_dep ] +common_deps = [ libkmsxx_dep, libkmsxxutil_dep, libdrm_dep, libfmt_dep ] libevdev_dep = dependency('libevdev', required : false) -- cgit v1.2.3