Merge lp://staging/~nick-dedekind/qtmir/miral-DisplayConfigurationStorage into lp://staging/qtmir
- miral-DisplayConfigurationStorage
- Merge into trunk
Status: | Needs review |
---|---|
Proposed branch: | lp://staging/~nick-dedekind/qtmir/miral-DisplayConfigurationStorage |
Merge into: | lp://staging/qtmir |
Prerequisite: | lp://staging/~gerboland/qtmir/miral-1.3.1-compat |
Diff against target: |
377 lines (+182/-33) 6 files modified
src/platforms/mirserver/miral/CMakeLists.txt (+1/-0) src/platforms/mirserver/miral/display_configuration_storage.h (+59/-0) src/platforms/mirserver/miral/edid.cpp (+1/-1) src/platforms/mirserver/miral/persist_display_config.cpp (+101/-29) src/platforms/mirserver/miral/persist_display_config.h (+7/-2) src/platforms/mirserver/qmirserver_p.cpp (+13/-1) |
To merge this branch: | bzr merge lp://staging/~nick-dedekind/qtmir/miral-DisplayConfigurationStorage |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Unity8 CI Bot (community) | continuous-integration | Approve | |
Gerry Boland (community) | Needs Fixing | ||
Albert Astals Cid (community) | Abstain | ||
Alan Griffiths | Pending | ||
Review via email: mp+320368@code.staging.launchpad.net |
This proposal supersedes a proposal from 2017-01-25.
Commit message
Added interface for saving/loading display configuration output options.
Description of the change
Pass responsibility for display configuration storage to an overridable interface.
Alan Griffiths (alan-griffiths) wrote : Posted in a previous version of this proposal | # |
Alan Griffiths (alan-griffiths) wrote : Posted in a previous version of this proposal | # |
- miral::Application applicationFor(
+ ::miral:
This (and similar changes elsewhere) shouldn't be needed now.
Alan Griffiths (alan-griffiths) wrote : Posted in a previous version of this proposal | # |
The target branch has landed, the pre-requisite has been rebased.
Unity8 CI Bot (unity8-ci-bot) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:604
https:/
Executed test runs:
FAILURE: https:/
SUCCESS: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
Click here to trigger a rebuild:
https:/
Unity8 CI Bot (unity8-ci-bot) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:605
https:/
Executed test runs:
FAILURE: https:/
SUCCESS: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
Click here to trigger a rebuild:
https:/
Gerry Boland (gerboland) wrote : Posted in a previous version of this proposal | # |
+++ src/platforms/
Copyright 2017 now
+struct DisplayOutputOp
To be clear, this struct is filled in to save a subset of options for the display. So one could set the display to not be used, or used, or else leave unset to allow shell to decide?
+++ src/platforms/
+ for(auto iter = output.
+ if ((*iter).size == config.
+ mode_index = i;
break?
+ if (output_index == config.
+ output.top_left = find_output.
break again?
+ if (config.
+ if (config.
+ if (config.
+ if (config.
What if these values were set, and then we want to unset them? Does that make sense?
This is all wrapped in a giant try/catch block, why?
void PersistDisplayC
{
+ if (!storage) return;
better to throw really
Big try/catch block again? Why?
+ // FIXME - output.edid should be std::vector<
+ edid.parse_
IMO std::vector<uint8_t const> is more correct, why would we want the vector contents to be editable? miral::Edid should take the const one instead.
Another break makes sense when you find the clone output indev.
Nick Dedekind (nick-dedekind) wrote : Posted in a previous version of this proposal | # |
> +++ src/platforms/
> Copyright 2017 now
Done
>
> +struct DisplayOutputOp
> To be clear, this struct is filled in to save a subset of options for the
> display. So one could set the display to not be used, or used, or else leave
> unset to allow shell to decide?
>
> +++ src/platforms/
> + for(auto iter = output.
> i++) {
> + if ((*iter).size == config.
> + mode_index = i;
> break?
>
> + if (output_index == config.
> + output.top_left = find_output.
> break again?
>
> + if (config.
> config.
> + if (config.
> }
> + if (config.
> config.
> + if (config.
>
> What if these values were set, and then we want to unset them? Does that make
> sense?
>
> This is all wrapped in a giant try/catch block, why?
>
>
> void PersistDisplayC
> conf)
> {
> + if (!storage) return;
> better to throw really
>
> Big try/catch block again? Why?
>
> + // FIXME - output.edid should be std::vector<
> std::vector<uint8_t const>
> + edid.parse_
> IMO std::vector<uint8_t const> is more correct, why would we want the vector
> contents to be editable? miral::Edid should take the const one instead.
>
> Another break makes sense when you find the clone output indev.
Nick Dedekind (nick-dedekind) wrote : Posted in a previous version of this proposal | # |
> +++ src/platforms/
> Copyright 2017 now
Done
>
> +struct DisplayOutputOp
> To be clear, this struct is filled in to save a subset of options for the
> display. So one could set the display to not be used, or used, or else leave
> unset to allow shell to decide?
This is used for both saving & loading options which the shell will need.
For saving, all the options will be set by qtmir from the mir display config and passed to the shell. The shell can decide what it want's to save.
For loading, the shell loads and sets whatever value is found in the saved config (if any). Qtmir will apply everything that has been set to the mir display config.
>
> +++ src/platforms/
> + for(auto iter = output.
> i++) {
> + if ((*iter).size == config.
> + mode_index = i;
> break?
Done.
>
> + if (output_index == config.
> + output.top_left = find_output.
> break again?
Can't break out of a for_each_output callback
>
> + if (config.
> config.
> + if (config.
> }
> + if (config.
> config.
> + if (config.
>
> What if these values were set, and then we want to unset them? Does that make
> sense?
>
> This is all wrapped in a giant try/catch block, why?
edid.parse_data throws an exception if it encounters bad data.
Would log out something, but this is qtmir::miral so wasn't sure what we do.
>
>
> void PersistDisplayC
> conf)
> {
> + if (!storage) return;
> better to throw really
done.
>
> Big try/catch block again? Why?
Same again.
>
> + // FIXME - output.edid should be std::vector<
> std::vector<uint8_t const>
> + edid.parse_
> IMO std::vector<uint8_t const> is more correct, why would we want the vector
> contents to be editable? miral::Edid should take the const one instead.
Apparently vector elements can't be const :/ not sure why it's constructable, but it's not usable. Get a compiler error. something to do with the allocator.
>
> Another break makes sense when you find the clone output indev.
Can't break out of a for_each_output callback
Unity8 CI Bot (unity8-ci-bot) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:609
https:/
Executed test runs:
FAILURE: https:/
SUCCESS: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
Click here to trigger a rebuild:
https:/
Unity8 CI Bot (unity8-ci-bot) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:611
https:/
Executed test runs:
FAILURE: https:/
SUCCESS: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
Click here to trigger a rebuild:
https:/
Unity8 CI Bot (unity8-ci-bot) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:612
https:/
Executed test runs:
FAILURE: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
FAILURE: https:/
SUCCESS: https:/
deb: https:/
FAILURE: https:/
Click here to trigger a rebuild:
https:/
Gerry Boland (gerboland) wrote : Posted in a previous version of this proposal | # |
> > + if (output_index == config.
> > + output.top_left = find_output.
> > break again?
> Can't break out of a for_each_output callback
You're right, you're in a lambda. You could "return" instead, but that does look confusing in code. Best to leave it.
> > + if (config.
> > config.
> > + if (config.
> config.
> > }
> > + if (config.
> > config.
> > + if (config.
> >
> > What if these values were set, and then we want to unset them? Does that
> make
> > sense?
> >
> > This is all wrapped in a giant try/catch block, why?
>
> edid.parse_data throws an exception if it encounters bad data.
> Would log out something, but this is qtmir::miral so wasn't sure what we do.
Ok, my first instinct is to only to wrap parse_data call. But if the exception throws, then you naturally skip all the config saving bits, which is clean. So ok.
> > + // FIXME - output.edid should be std::vector<
> > std::vector<uint8_t const>
> > + edid.parse_
> const&>
> > IMO std::vector<uint8_t const> is more correct, why would we want the vector
> > contents to be editable? miral::Edid should take the const one instead.
>
> Apparently vector elements can't be const :/ not sure why it's constructable,
> but it's not usable. Get a compiler error. something to do with the allocator.
There is something fishy here. http://
Gerry Boland (gerboland) wrote : Posted in a previous version of this proposal | # |
I get this error when using Ninja, can you have a look:
FAILED: src/platforms/
/usr/lib/ccache/c++ -DQT_NO_DEBUG -DQT_NO_KEYWORDS -DQT_USE_
Assembler messages:
Fatal error: can't create src/platforms/
Gerry Boland (gerboland) wrote : Posted in a previous version of this proposal | # |
> I get this error when using Ninja, can you have a look:
>
> FAILED: src/platforms/
> /usr/lib/ccache/c++ -DQT_NO_DEBUG -DQT_NO_KEYWORDS -DQT_USE_
> -DQT_USING_GL -Isrc/platforms
> -I../src/
> gnu/qt5/QtCore -isystem /usr/include/
> /usr/include/
> /usr/include/
> /usr/include/
> /usr/include/
> -DNDEBUG -std=gnu++14 -MD -MT src/platforms/
> /miral-
> prototypes.dir/.d -o src/platforms/
> prototypes.dir -c /home/gerry/
> DisplayConfigur
> prototypes_
> Assembler messages:
> Fatal error: can't create src/platforms/
> prototypes.dir: Is a directory
Not your fault, comes from iteration-
Unity8 CI Bot (unity8-ci-bot) wrote : Posted in a previous version of this proposal | # |
PASSED: Continuous integration, rev:613
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
Albert Astals Cid (aacid) wrote : Posted in a previous version of this proposal | # |
Text conflict in src/platforms/
1 conflicts encountered.
Was already top approved.
Nick Dedekind (nick-dedekind) wrote : Posted in a previous version of this proposal | # |
> > > + if (output_index == config.
> > > + output.top_left = find_output.
> > > break again?
> > Can't break out of a for_each_output callback
>
> You're right, you're in a lambda. You could "return" instead, but that does
> look confusing in code. Best to leave it.
>
>
> > > + if (config.
> > > config.
> > > + if (config.
> > config.
> > > }
> > > + if (config.
> > > config.
> > > + if (config.
> > >
> > > What if these values were set, and then we want to unset them? Does that
> > make
> > > sense?
> > >
> > > This is all wrapped in a giant try/catch block, why?
> >
> > edid.parse_data throws an exception if it encounters bad data.
> > Would log out something, but this is qtmir::miral so wasn't sure what we do.
>
> Ok, my first instinct is to only to wrap parse_data call. But if the exception
> throws, then you naturally skip all the config saving bits, which is clean. So
> ok.
>
>
> > > + // FIXME - output.edid should be std::vector<
> > > std::vector<uint8_t const>
> > > + edid.parse_
> > const&>
> > > IMO std::vector<uint8_t const> is more correct, why would we want the
> vector
> > > contents to be editable? miral::Edid should take the const one instead.
> >
> > Apparently vector elements can't be const :/ not sure why it's
> constructable,
> > but it's not usable. Get a compiler error. something to do with the
> allocator.
>
> There is something fishy here.
> http://
> vector (for C++11 and greater) needs to just be Erasable, which const uint8_t
> should be. But yeah, compiler says no. Better leave as is.
"Erasable, but many member functions impose stricter requirements."
Perhaps this is why constructing one is fine in mir but actually using it in our case is where the "Compiler Says No"
Nick Dedekind (nick-dedekind) wrote : Posted in a previous version of this proposal | # |
> Text conflict in src/platforms/
> 1 conflicts encountered.
>
> Was already top approved.
Fixed.
Albert Astals Cid (aacid) : Posted in a previous version of this proposal | # |
Unity8 CI Bot (unity8-ci-bot) wrote : Posted in a previous version of this proposal | # |
PASSED: Continuous integration, rev:614
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
Nick Dedekind (nick-dedekind) wrote : | # |
Resubmit with lp:~gerboland/qtmir/miral-1.3.1-compat dep
Unity8 CI Bot (unity8-ci-bot) wrote : | # |
PASSED: Continuous integration, rev:615
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
Gerry Boland (gerboland) wrote : | # |
+++ src/platforms/
+ std::ostringstream stringStream;
+ stringStream << "Incorrect EDID structure size {" << data.size() << "}";
+ throw std::runtime_
This would do:
throw std::runtime_
++ src/platforms/
since you remove the #if MIR_SERVER_VERSION block, please merge the list of mir headers so it is neater.
+++ src/platforms/
Nitpick: space after the "for":
+ for(auto iter = output.
+++ src/platforms/
Nitpick: please add "// namespace" after the anonymous namespace closing brace
Rest looks good
Unity8 CI Bot (unity8-ci-bot) wrote : | # |
FAILED: Continuous integration, rev:615
https:/
Executed test runs:
FAILURE: https:/
FAILURE: https:/
Click here to trigger a rebuild:
https:/
- 616. By Nick Dedekind
-
merged trunk
Unity8 CI Bot (unity8-ci-bot) wrote : | # |
FAILED: Continuous integration, rev:616
https:/
Executed test runs:
FAILURE: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
FAILURE: https:/
Click here to trigger a rebuild:
https:/
- 617. By Nick Dedekind
-
merged trunk
- 618. By Nick Dedekind
-
merged with trunk
Nick Dedekind (nick-dedekind) wrote : | # |
> +++ src/platforms/
> + std::ostringstream stringStream;
> + stringStream << "Incorrect EDID structure size {" << data.size() <<
> "}";
> + throw std::runtime_
>
> This would do:
> throw std::runtime_
> std::to_
>
>
> ++ src/platforms/
> since you remove the #if MIR_SERVER_VERSION block, please merge the list of
> mir headers so it is neater.
>
> +++ src/platforms/
> Nitpick: space after the "for":
> + for(auto iter = output.
> i++) {
>
>
> +++ src/platforms/
> Nitpick: please add "// namespace" after the anonymous namespace closing brace
>
>
> Rest looks good
Fixed.
Unity8 CI Bot (unity8-ci-bot) wrote : | # |
PASSED: Continuous integration, rev:618
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
Unmerged revisions
- 618. By Nick Dedekind
-
merged with trunk
- 617. By Nick Dedekind
-
merged trunk
- 616. By Nick Dedekind
-
merged trunk
- 615. By Nick Dedekind
-
miral 1.3.1 compat
- 614. By Nick Dedekind
-
merged trunk
- 613. By Nick Dedekind
-
merged with trunk
- 612. By Nick Dedekind
-
more info for identifying a display
- 611. By Nick Dedekind
-
print error on failed EDID parse
- 610. By Nick Dedekind
-
added check for ouput.connected to load/save config
- 609. By Nick Dedekind
-
merged parent
+ conf.for_ each_output( [this, &conf]( mg::UserDisplay ConfigurationOu tput& output) { policy. apply_to( conf);
...
default_
First apply any saved configuration and then overwrite that with the default policy. Is this the right behaviour?