summaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@ti.com>2017-02-07 13:39:15 +0200
committerTomi Valkeinen <tomi.valkeinen@ti.com>2017-02-10 07:04:02 +0200
commit05009c91478ca2a8790a758ed0bd218e5f4dffb8 (patch)
treedc7813a92e7cf3adaf90b2c3c02a95c496e87acf /utils
parent05bc0a0c4fe88031e72f17b342476d5f7d6775d0 (diff)
use reserve_connector from ResourceManager
Diffstat (limited to 'utils')
-rw-r--r--utils/kmsblank.cpp3
-rw-r--r--utils/kmstest.cpp21
2 files changed, 14 insertions, 10 deletions
diff --git a/utils/kmsblank.cpp b/utils/kmsblank.cpp
index 4909826..0b51810 100644
--- a/utils/kmsblank.cpp
+++ b/utils/kmsblank.cpp
@@ -60,12 +60,13 @@ int main(int argc, char **argv)
}
Card card(dev_path);
+ ResourceManager resman(card);
vector<Connector*> conns;
if (conn_strs.size() > 0) {
for (string s : conn_strs) {
- auto c = resolve_connector(card, s);
+ auto c = resman.reserve_connector(s);
if (!c)
EXIT("Failed to resolve connector '%s'", s.c_str());
conns.push_back(c);
diff --git a/utils/kmstest.cpp b/utils/kmstest.cpp
index 733523e..3fb4b28 100644
--- a/utils/kmstest.cpp
+++ b/utils/kmstest.cpp
@@ -73,9 +73,9 @@ static void get_default_connector(Card& card, OutputInfo& output)
output.mode = output.connector->get_default_mode();
}
-static void parse_connector(Card& card, const string& str, OutputInfo& output)
+static void parse_connector(Card& card, ResourceManager& resman, const string& str, OutputInfo& output)
{
- Connector* conn = resolve_connector(card, str);
+ Connector* conn = resman.reserve_connector(str);
if (!conn)
EXIT("No connector '%s'", str.c_str());
@@ -488,16 +488,19 @@ static vector<Arg> parse_cmdline(int argc, char **argv)
return args;
}
-static vector<OutputInfo> setups_to_outputs(Card& card, const vector<Arg>& output_args)
+static vector<OutputInfo> setups_to_outputs(Card& card, ResourceManager& resman, const vector<Arg>& output_args)
{
vector<OutputInfo> outputs;
if (output_args.size() == 0) {
// no output args, show a pattern on all screens
- for (auto& pipe : card.get_connected_pipelines()) {
+ for (Connector* conn : card.get_connectors()) {
+ if (!conn->connected())
+ continue;
+
OutputInfo output = { };
- output.connector = pipe.connector;
- output.crtc = pipe.crtc;
+ output.connector = resman.reserve_connector(conn);
+ output.crtc = resman.reserve_crtc(conn);
output.mode = output.connector->get_default_mode();
output.fbs = get_default_fb(card, output.mode.hdisplay, output.mode.vdisplay);
@@ -518,7 +521,7 @@ static vector<OutputInfo> setups_to_outputs(Card& card, const vector<Arg>& outpu
outputs.push_back(OutputInfo { });
current_output = &outputs.back();
- parse_connector(card, arg.arg, *current_output);
+ parse_connector(card, resman, arg.arg, *current_output);
current_plane = 0;
break;
@@ -1019,10 +1022,10 @@ int main(int argc, char **argv)
if (!card.has_atomic() && s_flip_sync)
EXIT("Synchronized flipping requires atomic modesetting");
- vector<OutputInfo> outputs = setups_to_outputs(card, output_args);
-
ResourceManager resman(card);
+ vector<OutputInfo> outputs = setups_to_outputs(card, resman, output_args);
+
if (card.has_atomic()) {
for (OutputInfo& o : outputs) {
if (o.fbs.empty())