Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a "--display-config static=<filename>" option #551

Merged
merged 34 commits into from Aug 24, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
f7c02b7
Introduce StaticDisplayConfigurationPolicy
AlanGriffiths Aug 16, 2018
c26c954
Add parsing (pass one)
AlanGriffiths Aug 16, 2018
9b300d8
More robust parsing and rudimentary error reporting
AlanGriffiths Aug 17, 2018
22098ae
Make things a bit more readable
AlanGriffiths Aug 17, 2018
d0d4dad
Fix FTBFS on Ubuntu 16.04
AlanGriffiths Aug 17, 2018
57b71ef
Rename "size" to "mode"
AlanGriffiths Aug 17, 2018
7b11c41
Add optional refresh rate to mode
AlanGriffiths Aug 17, 2018
7bf8562
Add optional "scale" property
AlanGriffiths Aug 17, 2018
3d9791e
Remove support for "scale" (as it doesn't work)
AlanGriffiths Aug 20, 2018
bffc762
Add "orientation" property
AlanGriffiths Aug 20, 2018
fa7eb54
Fix FTBFS with clang
AlanGriffiths Aug 20, 2018
48875d5
Split StaticDisplayConfig into its own files
AlanGriffiths Aug 21, 2018
59a7de9
Move implementation out of header
AlanGriffiths Aug 21, 2018
077d61e
First cut at parsing YAML
AlanGriffiths Aug 21, 2018
7fd0329
Fixup
AlanGriffiths Aug 22, 2018
3f38bb4
Dump layout as yaml
AlanGriffiths Aug 22, 2018
b550205
Dump layout as yaml
AlanGriffiths Aug 22, 2018
9837cdb
Rudimentary error handling
AlanGriffiths Aug 22, 2018
6e82253
Number ports within output type
AlanGriffiths Aug 22, 2018
1491daa
Eliminate port index within card
AlanGriffiths Aug 22, 2018
817d31c
Change "displays" tag to more intuitive "cards"
AlanGriffiths Aug 22, 2018
aed3c7d
Fix Fedora dependencies
AlanGriffiths Aug 22, 2018
1a1e8c2
Fix clang FTBFS
AlanGriffiths Aug 22, 2018
dac7b34
Review comments
AlanGriffiths Aug 22, 2018
b70fcad
Add facility to disable outputs
AlanGriffiths Aug 23, 2018
884874f
Add a constructor that can be used to supply test input.
AlanGriffiths Aug 23, 2018
bded7b0
DRY
AlanGriffiths Aug 23, 2018
a20397b
Use the 'default' layout
AlanGriffiths Aug 23, 2018
f7e169f
Local functions should be in anon namespace
AlanGriffiths Aug 23, 2018
e9d4c50
Tidy code
AlanGriffiths Aug 23, 2018
f25c5b9
StaticDisplayConfig test fixture. (And fix some linker options.)
AlanGriffiths Aug 24, 2018
8627b49
Reasonable set of tests
AlanGriffiths Aug 24, 2018
b50bdfe
Drop the logic for using layout not called "default"
AlanGriffiths Aug 24, 2018
8f0e7e5
Test demonstrating using an alias
AlanGriffiths Aug 24, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion debian/control
Expand Up @@ -54,7 +54,8 @@ Build-Depends: cmake,
libxcb-xfixes0-dev,
libxcb-render0-dev,
libxcb-composite0-dev,
libxcursor-dev
libxcursor-dev,
libyaml-cpp-dev
Standards-Version: 3.9.4
Homepage: https://launchpad.net/mir
# If you aren't a member of ~mir-team but need to upload packaging changes,
Expand Down
2 changes: 2 additions & 0 deletions include/test/mir/test/doubles/mock_display_configuration.h
Expand Up @@ -21,6 +21,8 @@

#include "mir/graphics/display_configuration.h"

#include <gmock/gmock.h>

namespace mir
{
namespace test
Expand Down
3 changes: 2 additions & 1 deletion spread/build/fedora/task.yaml
Expand Up @@ -50,7 +50,8 @@ execute: |
python3-gobject-base \
python3-dbus \
mesa-libwayland-egl-devel\
libXcursor-devel
libXcursor-devel \
yaml-cpp-devel

BUILD_DIR=$(mktemp --directory)
cmake -H$SPREAD_PATH -B$BUILD_DIR -DCMAKE_BUILD_TYPE=Debug -DMIR_USE_LD_GOLD=ON
Expand Down
13 changes: 12 additions & 1 deletion src/miral/CMakeLists.txt
Expand Up @@ -9,15 +9,20 @@ set(MIRAL_ABI 3)
set(symbol_map ${CMAKE_CURRENT_SOURCE_DIR}/symbols.map)
set(miral_include ${PROJECT_SOURCE_DIR}/include/miral)

pkg_check_modules(YAML REQUIRED yaml-cpp)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any way to make this optional?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why?


add_library(mirclientcpp INTERFACE)

add_definitions(-DMIR_LOG_COMPONENT_FALLBACK="miral")

add_library(miral-internal STATIC
active_outputs.cpp active_outputs.h
basic_window_manager.cpp basic_window_manager.h window_manager_tools_implementation.h
coordinate_translator.cpp coordinate_translator.h
display_configuration_listeners.cpp display_configuration_listeners.h
launch_app.cpp launch_app.h
mru_window_list.cpp mru_window_list.h
static_display_config.cpp static_display_config.h
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indentation nitpick

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What are you seeing that I don't?

window_management_trace.cpp window_management_trace.h
xcursor_loader.cpp xcursor_loader.h
xcursor.c xcursor.h
Expand Down Expand Up @@ -82,6 +87,13 @@ target_include_directories(miral-internal
PRIVATE ${MIRSERVER_INCLUDE_DIRS}
)

target_link_libraries(miral-internal
PRIVATE
mirserver
${WAYLAND_CLIENT_LDFLAGS} ${WAYLAND_CLIENT_LIBRARIES}
${YAML_LIBRARIES}
)

target_include_directories(miral
PUBLIC "${miral_include}" ${MIRCLIENT_INCLUDE_DIRS}
PRIVATE ${MIRSERVER_INCLUDE_DIRS}
Expand All @@ -94,7 +106,6 @@ target_link_libraries(miral
PRIVATE
miral-internal
mirserver
${WAYLAND_CLIENT_LDFLAGS} ${WAYLAND_CLIENT_LIBRARIES}
)

set_target_properties(miral
Expand Down
8 changes: 6 additions & 2 deletions src/miral/display_configuration_option.cpp
@@ -1,5 +1,5 @@
/*
* Copyright © 2014, 2016 Canonical Ltd.
* Copyright © 2014-2018 Canonical Ltd.
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 or 3 as
Expand All @@ -17,6 +17,7 @@
*/

#include "miral/display_configuration_option.h"
#include "static_display_config.h"

#include <mir/graphics/default_display_configuration_policy.h>
#include <mir/graphics/display_configuration.h>
Expand All @@ -28,11 +29,12 @@ namespace mg = mir::graphics;
namespace
{
char const* const display_config_opt = "display-config";
char const* const display_config_descr = "Display configuration [{clone,sidebyside,single}]";
char const* const display_config_descr = "Display configuration [{clone,sidebyside,single,static=<filename>}]";

//char const* const clone_opt_val = "clone";
char const* const sidebyside_opt_val = "sidebyside";
char const* const single_opt_val = "single";
char const* const static_opt_val = "static=";

char const* const display_alpha_opt = "translucent";
char const* const display_alpha_descr = "Select a display mode with alpha[{on,off}]";
Expand Down Expand Up @@ -108,6 +110,8 @@ void miral::display_configuration_options(mir::Server& server)
layout_selector = std::make_shared<mg::SideBySideDisplayConfigurationPolicy>();
else if (display_layout == single_opt_val)
layout_selector = std::make_shared<mg::SingleDisplayConfigurationPolicy>();
else if (display_layout.compare(0, strlen(static_opt_val), static_opt_val) == 0)
layout_selector = std::make_shared<StaticDisplayConfig>(display_layout.substr(strlen(static_opt_val)));

// Whatever the layout select a pixel format with requested alpha
return std::make_shared<PixelFormatSelector>(layout_selector, with_alpha);
Expand Down