1
0
Fork 0
Commit graph

94 commits

Author SHA1 Message Date
Jonas Ådahl
8163ca6821 Add support for scaled logical monitor framebuffers
This commit adds support for rendering onto enlarged per logical
monitor framebuffers, using the scaled clutter stage views, for HiDPI
enabled logical monitors.

This works by scaling the mode of the monitors in a logical monitors by
the scale, no longer relying on scaling the window actors and window
geometry for making windows have the correct size on HiDPI monitors.

It is disabled by default, as in automatically created configurations
will still use the old mode. This is partly because Xwayland clients
will not yet work good enough to make it feasible.

To enable, add the 'scale-monitor-framebuffer' keyword to the
org.gnome.mutter.experimental-features gsettings array.

It is still possible to specify the mode via the new D-Bus API, which
has been adapted.

The adaptations to the D-Bus API means the caller need to be aware of
how to position logical monitors on the stage grid. This depends on the
'layout-mode' property that is used (see the DisplayConfig D-Bus
documentation).

https://bugzilla.gnome.org/show_bug.cgi?id=777732
2017-04-07 22:30:48 +08:00
Jonas Ådahl
fcc0288f0c monitor-manager: Let the backends handle no configuration
Let the backends decide whether to just rebuild a derived state, or use
the NULL config to rebuild an empty logical state.

This also changes the expected screen size values of the no-outputs
test; as this case is actually handled now.

https://bugzilla.gnome.org/show_bug.cgi?id=777732
2017-04-07 22:30:47 +08:00
Jonas Ådahl
4e03e89869 tests: Check that mirroring is configured properly
This test checks that mirroring works when using separate CRTCs. It
does not check cloning.

https://bugzilla.gnome.org/show_bug.cgi?id=777732
2017-04-07 22:30:47 +08:00
Jonas Ådahl
4e17017501 monitor-unit-tests: Check custom tiled monitor config
https://bugzilla.gnome.org/show_bug.cgi?id=777732
2017-04-07 22:30:47 +08:00
Jonas Ådahl
63bc86cd43 tests: Test configured custom logical monitor scale
Check that a configured logical monitor scale overrides any calculated
one.

https://bugzilla.gnome.org/show_bug.cgi?id=777732
2017-04-07 22:30:47 +08:00
Jonas Ådahl
a393a614a1 monitor-manager: Remove 'scale' from MetaOutput
Replace the 'scale' of an output with a vfunc on the MetaMonitorManager
class that takes a monitor and a monitor mode which calculates the
scale. On X11 this always returns 1, on KMS, the old formula is used.
On the dummy and test backends, the already configured values are
returned.

https://bugzilla.gnome.org/show_bug.cgi?id=777732
2017-04-07 22:30:46 +08:00
Jonas Ådahl
6fa8238ebf monitor-unit-tests: Check monitor <-> logical monitor relationships
Make sure that each logical monitor owns the expected actual monitors.
This currently needs special care when dealing with laptop lid the
configuration, as the MetaMonitorConfigManager path still deosn't
handle restoring the previous configuration, meaning the logical
monitor with the external monitor will continue being primary.

https://bugzilla.gnome.org/show_bug.cgi?id=777732
2017-01-25 16:28:57 +08:00
Jonas Ådahl
1c6eef48f1 monitor-unit-tests: Move logical monitor checking into separate function
Split the big check function, makes things easier to read.

https://bugzilla.gnome.org/show_bug.cgi?id=777732
2017-01-25 16:28:57 +08:00
Jonas Ådahl
1fdf2ac746 monitor-unit-tests: Check that each CRTC mode is correct
This is partly redundant given that the current monitor mode is checked
against the CRTC mode, but this also checks the disabled CRTCs. Later
the configured mode position and transform will be checked.

https://bugzilla.gnome.org/show_bug.cgi?id=777732
2017-01-25 16:28:56 +08:00
Jonas Ådahl
3ae9feef0c monitor-unit-tests: Check monitor mode CRTC mode positions
Check that the crtc mode has the correct intra-monitor position. In
effect, this tests that the CRTCs in a tiled monitor are configured with
the correct mode on the correct position.

https://bugzilla.gnome.org/show_bug.cgi?id=777732
2017-01-25 16:28:56 +08:00
Jonas Ådahl
e9a8208607 tests: Add monitor store and config test for output underscanning
https://bugzilla.gnome.org/show_bug.cgi?id=777732
2017-01-25 16:28:56 +08:00
Jonas Ådahl
0fd9c00580 tests: Add monitor and monitor store test for custom primary
Test that having a custom primary logical monitor is configured as
expected.

https://bugzilla.gnome.org/show_bug.cgi?id=777732
2017-01-25 16:28:56 +08:00
Jonas Ådahl
4a51a1dfe5 monitor-unit-tests: Check handling of the primary presentation flags
The main output of the main (first) monitor of a primary logical
monitor should have the MetaOutput::is_primary field set; all other
outputs should have it not set.

All outputs associated with a logical monitor with presentation set
should have MetaOutput::is_presentation set. No other outputs should
have it set.

https://bugzilla.gnome.org/show_bug.cgi?id=777732
2017-01-25 16:28:56 +08:00
Jonas Ådahl
449320cd23 monitor-unit-tests: Check that a stored config is preferred
Check that the stored config (where the logical monitors are placed
vertically) is preferred to the otherwise generated linear config.

https://bugzilla.gnome.org/show_bug.cgi?id=777732
2017-01-25 16:28:56 +08:00
Jonas Ådahl
12b69dbabb monitor-unit-tests: Make hotplug_mode_update optional
Add a flag to the test setup creation function enabling the caller to
specify whether a stored config should be used. This is done by
changing the value of the hotplug_mode_update MetaOutput field,
normally used by VMs to do the same.

https://bugzilla.gnome.org/show_bug.cgi?id=777732
2017-01-25 16:28:56 +08:00
Jonas Ådahl
4652bde3d7 tests: Move monitor test helpers to a helper file
Both the monitor unit tests and monitor store unit tests will want to
check whether the config manager is used and set custom configuration
files.

https://bugzilla.gnome.org/show_bug.cgi?id=777732
2017-01-25 16:28:56 +08:00
Jonas Ådahl
339340df34 tests: Add MetaMonitorConfigStore tests
Add tests that check that a XML configuration file results in correct
MetaMonitorsConfig objects.

https://bugzilla.gnome.org/show_bug.cgi?id=777732
2017-01-25 16:28:56 +08:00
Jonas Ådahl
c9f18bfef3 monitor-unit-tests: Test headless mode
This tests only the monitor configuration and basic functionality. It
does not test anything related to window management and Wayland client
interaction.

https://bugzilla.gnome.org/show_bug.cgi?id=777732
2017-01-25 16:28:56 +08:00
Jonas Ådahl
f45e7703ba monitor-unit-tests: Add lid-closed with no external monitor test case
Test that when the laptop lid is closed, but no external monitors are
connected, that we still have a mode set on the laptop panel.

https://bugzilla.gnome.org/show_bug.cgi?id=777732
2017-01-25 16:28:56 +08:00
Jonas Ådahl
1ee0412177 monitor-unit-tests: Use g_assert_cmp* macros when suitable
Use the g_assert_cmp(int|uint|...) macros when comparing integers and
unsigned integers. This means that the mismatched numbers are printed
in the test report.

https://bugzilla.gnome.org/show_bug.cgi?id=777732
2017-01-25 16:28:56 +08:00
Jonas Ådahl
81923410f6 monitor-unit-tests: Test starting with lid closed
Add a test case that checks that configuration works when the lid is
initialy closed then later opened. This test case is disabled when the
legacy configuration is used as it does not handle that situation.

https://bugzilla.gnome.org/show_bug.cgi?id=777732
2017-01-25 16:28:55 +08:00
Jonas Ådahl
cde1a730e8 monitor-unit-tests: Add laptop lid switch test case
Test that the laptop panel is disabled if the lid is closed.

https://bugzilla.gnome.org/show_bug.cgi?id=777732
2017-01-25 16:28:55 +08:00
Jonas Ådahl
8d1be7ffc0 monitor-unit-tests: Add test for handling too few CRTCs
Check that configuration when there are more outputs than CRTCs does
something sane.

https://bugzilla.gnome.org/show_bug.cgi?id=777732
2017-01-25 16:28:55 +08:00
Jonas Ådahl
1a2b493d17 tests/monitor-unit-tests: Check current monitor mode
Check both that current mode is up to date, and that deriving it again
won't change it.

https://bugzilla.gnome.org/show_bug.cgi?id=777732
2017-01-25 16:28:55 +08:00
Jonas Ådahl
be13d0f8ee monitor: Allow monitor mode foreach crtc iterator failable
Allow the function used to iterate over the CRTC modes of a monitor
mode to fail, causing the iteration to fail as well.

https://bugzilla.gnome.org/show_bug.cgi?id=777732
2017-01-25 16:28:54 +08:00
Jonas Ådahl
81438eebef monitor-unit-tests: Test suggested-x/y configuration
Test the suggested-x/y output state often set by virtual machines.

https://bugzilla.gnome.org/show_bug.cgi?id=777732
2017-01-25 16:28:54 +08:00
Jonas Ådahl
63ed134165 monitor-unit-tests: Check monitor modes
https://bugzilla.gnome.org/show_bug.cgi?id=777732
2017-01-25 16:28:54 +08:00
Jonas Ådahl
ff633f295e logical-monitor: Don't duplicate output list
Just use the monitor list and the output lists of each monitor.

https://bugzilla.gnome.org/show_bug.cgi?id=777732
2017-01-25 16:28:54 +08:00
Jonas Ådahl
310064601c monitor-unit-tests: Check tiled monitor adding/removing notification
Check that the moniter manager backends get the tiled monitor
added/removed notification.

https://bugzilla.gnome.org/show_bug.cgi?id=777732
2017-01-25 16:28:54 +08:00
Jonas Ådahl
4fa8b74dc7 monitor-unit-tests: Add musing about test declarations
https://bugzilla.gnome.org/show_bug.cgi?id=777732
2017-01-25 16:28:54 +08:00
Jonas Ådahl
f48acd8448 tests: Check that the crtc gets a logical monitor set
https://bugzilla.gnome.org/show_bug.cgi?id=777732
2017-01-25 16:28:54 +08:00
Jonas Ådahl
d0c9d2dc7b tests: Check that the monitors are properly generated
https://bugzilla.gnome.org/show_bug.cgi?id=777732
2017-01-25 16:28:53 +08:00
Jonas Ådahl
4e812410cc monitor-manager: Move logical monitor into its own file
https://bugzilla.gnome.org/show_bug.cgi?id=777732
2017-01-25 16:28:53 +08:00
Jonas Ådahl
0873e3812b backends: Rename MetaMonitorMode to MetaCrtcMode
The MetaMonitorMode referred to the mode of a CRTC, and with the future
introduction of a MetaMonitor, theh old name would be confusing.
Instead call it what it is.

https://bugzilla.gnome.org/show_bug.cgi?id=777732
2017-01-25 16:28:53 +08:00
Jonas Ådahl
1650c35e38 monitor-manager: Rename MetaCRTC(Info) to MetaCrtc(Info)
Change to follow the naming convention used everywhere else. This means
changing CRTC to Crtc even though it is an abbreviation.

https://bugzilla.gnome.org/show_bug.cgi?id=777732
2017-01-25 16:28:53 +08:00
Jonas Ådahl
156c478ccb tests/monitor: Add HiDPI test
This doesn't test the actual calculation, since that is done in the
backend, it only tests the configuration.

https://bugzilla.gnome.org/show_bug.cgi?id=777732
2017-01-25 16:28:53 +08:00
Jonas Ådahl
10e6eae0dd tests/monitor: Add tiled monitor test
https://bugzilla.gnome.org/show_bug.cgi?id=777732
2017-01-25 16:28:53 +08:00
Jonas Ådahl
8a8ab6c673 tests/monitor: Test preferred mode
https://bugzilla.gnome.org/show_bug.cgi?id=777732
2017-01-25 16:28:53 +08:00
Jonas Ådahl
9e28303588 tests/monitor: Test one out of two outputs being off
https://bugzilla.gnome.org/show_bug.cgi?id=777732
2017-01-25 16:28:53 +08:00
Jonas Ådahl
6776329cf5 tests/monitor: Test two crtcs, one output
https://bugzilla.gnome.org/show_bug.cgi?id=777732
2017-01-25 16:28:53 +08:00
Jonas Ådahl
d920eaba4a tests: Also make test case verification declarative
Set up the expected result in a declarative way in the same place as
the test case setup is declared. This way we have a completely
declarative way to create test cases.

https://bugzilla.gnome.org/show_bug.cgi?id=777732
2017-01-25 16:28:53 +08:00
Jonas Ådahl
376a76a082 tests: Make monitor test case setup more declarative
In order to more easily create more test cases, make the test case
setup more declarative.

https://bugzilla.gnome.org/show_bug.cgi?id=777732
2017-01-25 16:28:53 +08:00
Jonas Ådahl
c6d940d3b2 tests: Make monitor unit tests create initial config
This way we have both the test setup and testing in the same file.

https://bugzilla.gnome.org/show_bug.cgi?id=777732
2017-01-25 16:28:53 +08:00
Jonas Ådahl
12150c1ca7 tests: Add basic monitor configuration tests
The added test checks that two monitors are lied out on a row next to
each other.

https://bugzilla.gnome.org/show_bug.cgi?id=777732
2017-01-25 16:28:53 +08:00