Mir

Merge lp:~mterry/mir/no-nested-display-config into lp:mir/0.1

Proposed by Michael Terry
Status: Work in progress
Proposed branch: lp:~mterry/mir/no-nested-display-config
Merge into: lp:mir/0.1
Diff against target: 58 lines (+14/-3)
2 files modified
src/server/graphics/nested/nested_display.cpp (+12/-3)
src/server/graphics/nested/nested_display.h (+2/-0)
To merge this branch: bzr merge lp:~mterry/mir/no-nested-display-config
Reviewer Review Type Date Requested Status
Mir development team Pending
Review via email: mp+214979@code.launchpad.net

Commit message

Bandaid for greeter turning screen on.

Description of the change

(This is just a port of https://code.launchpad.net/~andreas-pokorny/mir/no-initial-display-configuration-sent-to-hosting-server/+merge/213126 to lp:mir)

Workaround for Greeter turning the screen on.

This is just a workaround for the issue with the split greeter. While display is off another greeter is spawned to be shown as soon as display is turned on again. A greeter is a nested mir server. On initialization nested servers send the initial display configuration to the hosting server. Obviously that configuration contains power_mode == MirPowerMode::mir_power_mode_on.
u-s-c sets the focus onto the recently started greeter as soon as the session has a surface with buffers in. On that focus change the the stored display configuration (given they have one) is applied. Which turns the display on.

This change disables sending the first/initial nested display configuration.
We clearly need a better solution for that issue so we can remove that workaround as soon as we have one.

To post a comment you must log in.

Unmerged revisions

1183. By Michael Terry

Port Andreas Pokorny's patch from devel to trunk

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/server/graphics/nested/nested_display.cpp'
--- src/server/graphics/nested/nested_display.cpp 2014-03-17 07:35:22 +0000
+++ src/server/graphics/nested/nested_display.cpp 2014-04-09 15:36:26 +0000
@@ -137,10 +137,9 @@
137 egl_display{*connection},137 egl_display{*connection},
138 outputs{}138 outputs{}
139{139{
140
141 std::shared_ptr<DisplayConfiguration> conf(configuration());140 std::shared_ptr<DisplayConfiguration> conf(configuration());
142 initial_conf_policy->apply_to(*conf);141 initial_conf_policy->apply_to(*conf);
143 configure(*conf);142 create_surfaces(*conf);
144}143}
145144
146mgn::NestedDisplay::~NestedDisplay() noexcept145mgn::NestedDisplay::~NestedDisplay() noexcept
@@ -173,6 +172,12 @@
173172
174void mgn::NestedDisplay::configure(mg::DisplayConfiguration const& configuration)173void mgn::NestedDisplay::configure(mg::DisplayConfiguration const& configuration)
175{174{
175 create_surfaces(configuration);
176 apply_to_connection(configuration);
177}
178
179void mgn::NestedDisplay::create_surfaces(mg::DisplayConfiguration const& configuration)
180{
176 if (!configuration.valid())181 if (!configuration.valid())
177 {182 {
178 BOOST_THROW_EXCEPTION(std::logic_error("Invalid or inconsistent display configuration"));183 BOOST_THROW_EXCEPTION(std::logic_error("Invalid or inconsistent display configuration"));
@@ -224,12 +229,16 @@
224 if (result.empty())229 if (result.empty())
225 BOOST_THROW_EXCEPTION(std::runtime_error("Nested Mir needs at least one output for display"));230 BOOST_THROW_EXCEPTION(std::runtime_error("Nested Mir needs at least one output for display"));
226231
227 auto const& conf = dynamic_cast<NestedDisplayConfiguration const&>(configuration);
228232
229 {233 {
230 std::unique_lock<std::mutex> lock(outputs_mutex);234 std::unique_lock<std::mutex> lock(outputs_mutex);
231 outputs.swap(result);235 outputs.swap(result);
232 }236 }
237}
238
239void mgn::NestedDisplay::apply_to_connection(mg::DisplayConfiguration const& configuration)
240{
241 auto const& conf = dynamic_cast<NestedDisplayConfiguration const&>(configuration);
233242
234 mir_connection_apply_display_config(*connection, conf);243 mir_connection_apply_display_config(*connection, conf);
235}244}
236245
=== modified file 'src/server/graphics/nested/nested_display.h'
--- src/server/graphics/nested/nested_display.h 2014-03-06 06:05:17 +0000
+++ src/server/graphics/nested/nested_display.h 2014-04-09 15:36:26 +0000
@@ -129,6 +129,8 @@
129 std::mutex outputs_mutex;129 std::mutex outputs_mutex;
130 std::unordered_map<DisplayConfigurationOutputId, std::shared_ptr<detail::NestedOutput>> outputs;130 std::unordered_map<DisplayConfigurationOutputId, std::shared_ptr<detail::NestedOutput>> outputs;
131 DisplayConfigurationChangeHandler my_conf_change_handler;131 DisplayConfigurationChangeHandler my_conf_change_handler;
132 void create_surfaces(mir::graphics::DisplayConfiguration const& configuration);
133 void apply_to_connection(mir::graphics::DisplayConfiguration const& configuration);
132 void complete_display_initialization(MirPixelFormat format);134 void complete_display_initialization(MirPixelFormat format);
133};135};
134136

Subscribers

People subscribed via source and target branches