Mir

Merge lp:~vanvugt/mir/fix-1395405 into lp:mir

Proposed by Daniel van Vugt
Status: Merged
Approved by: Alan Griffiths
Approved revision: 2095
Merged at revision: 2095
Proposed branch: lp:~vanvugt/mir/fix-1395405
Merge into: lp:mir
Diff against target: 96 lines (+10/-9)
7 files modified
client-ABI-sha1sums (+1/-1)
common-ABI-sha1sums (+1/-1)
include/common/mir_toolkit/client_types.h (+2/-1)
platform-ABI-sha1sums (+1/-1)
server-ABI-sha1sums (+1/-1)
src/platform/graphics/display_configuration.cpp (+1/-1)
tests/unit-tests/graphics/test_display_configuration.cpp (+3/-3)
To merge this branch: bzr merge lp:~vanvugt/mir/fix-1395405
Reviewer Review Type Date Requested Status
Alan Griffiths Approve
Alexandros Frantzis (community) Approve
PS Jenkins bot (community) continuous-integration Approve
Review via email: mp+242583@code.launchpad.net

Commit message

Not knowing the preferred mode of an output is not a fatal error,
so don't treat it as such. (LP: #1395405)

DefaultDisplayConfigurationPolicy is already smart enough to fall back
to index 0 if the preferred_mode isn't valid.

Description of the change

It now works and TV output joy ensues...

# bin/mirout
Connected to server: <default>
Card 0: Max 2 simultaneous outputs
Output 14: Card 0, eDP, connected, 1366x768+0+0, used, on, 260mm x 140mm (11.6"), normal
    1366x768 60.0*+
Output 22: Card 0, HDMI-A, connected, 4096x2160+0+0, used, on, 1210mm x 680mm (54.6"), normal
    4096x2160 24.0* 24.0
    3840x2160 30.0 30.0 25.0 24.0 24.0
    1920x1080 60.0 59.9 30.0 30.0 50.0 25.0 30.0 30.0 25.0 24.0 24.0
    1680x1050 59.9
    1600x900 60.0
    1280x1024 75.0 60.0
    1440x900 59.9
    1366x768 59.8
    1280x800 59.9
    1152x864 75.0
    1280x720 60.0 60.0 59.9 50.0
    1440x576 25.0
    1024x768 75.1 70.1 60.0
    1440x480 30.0 30.0
     832x624 74.6
     800x600 75.0 72.2 60.3
     720x576 50.0
     720x480 60.0 59.9
     640x480 75.0 72.8 66.7 60.0 59.9
     720x400 70.1

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Alexandros Frantzis (afrantzis) wrote :

Looks good.

review: Approve
Revision history for this message
Alan Griffiths (alan-griffiths) wrote :

Makes sense "preferred" doesn't mean compulsory

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'client-ABI-sha1sums'
2--- client-ABI-sha1sums 2014-11-21 12:16:36 +0000
3+++ client-ABI-sha1sums 2014-11-23 04:28:11 +0000
4@@ -8,7 +8,7 @@
5 4f85e3d00314a7df869e56c3701a45310909fae2 include/client/mir_toolkit/mir_surface.h
6 b141c4d79802ad626d969249c0004744e5c2a525 include/client/mir_toolkit/mir_wait.h
7 c367f5c9285936820fbd50961827d6ce58fb7ff4 include/client/mir_toolkit/version.h
8-9907751d046e4aea81881cf19e5df52c7a6a813e include/common/mir_toolkit/client_types.h
9+ee337f546bca8f151e0f5adafb3ce91dabedebba include/common/mir_toolkit/client_types.h
10 2100c0674d9d882c1845550847357f6a5de5af66 include/common/mir_toolkit/common.h
11 fce4c1a9e0d037244f7e9e96ea2d8eaab4fc404c include/common/mir_toolkit/cursors.h
12 bdaceadd56e41d2cb708f7c4da97acf84dfc75b7 include/common/mir_toolkit/event.h
13
14=== modified file 'common-ABI-sha1sums'
15--- common-ABI-sha1sums 2014-11-22 11:19:02 +0000
16+++ common-ABI-sha1sums 2014-11-23 04:28:11 +0000
17@@ -14,7 +14,7 @@
18 be7d58c9fde2ce91cc66dd6144b76e08b536266b include/common/mir/int_wrapper.h
19 2fd7274766a92f22e8784cb64af91947ba03d0de include/common/mir/logging/logger.h
20 9ae8473df05dd9e048a73797f01a2f34f7447554 include/common/mir/time/types.h
21-9907751d046e4aea81881cf19e5df52c7a6a813e include/common/mir_toolkit/client_types.h
22+ee337f546bca8f151e0f5adafb3ce91dabedebba include/common/mir_toolkit/client_types.h
23 2100c0674d9d882c1845550847357f6a5de5af66 include/common/mir_toolkit/common.h
24 fce4c1a9e0d037244f7e9e96ea2d8eaab4fc404c include/common/mir_toolkit/cursors.h
25 bdaceadd56e41d2cb708f7c4da97acf84dfc75b7 include/common/mir_toolkit/event.h
26
27=== modified file 'include/common/mir_toolkit/client_types.h'
28--- include/common/mir_toolkit/client_types.h 2014-10-29 06:21:10 +0000
29+++ include/common/mir_toolkit/client_types.h 2014-11-23 04:28:11 +0000
30@@ -240,7 +240,8 @@
31 {
32 uint32_t num_modes;
33 MirDisplayMode* modes;
34- uint32_t preferred_mode;
35+ uint32_t preferred_mode; /**< There might be no preferred mode, which
36+ is indicated by a value >=num_modes. */
37 uint32_t current_mode;
38
39 uint32_t num_output_formats;
40
41=== modified file 'platform-ABI-sha1sums'
42--- platform-ABI-sha1sums 2014-11-22 11:19:02 +0000
43+++ platform-ABI-sha1sums 2014-11-23 04:28:11 +0000
44@@ -14,7 +14,7 @@
45 be7d58c9fde2ce91cc66dd6144b76e08b536266b include/common/mir/int_wrapper.h
46 2fd7274766a92f22e8784cb64af91947ba03d0de include/common/mir/logging/logger.h
47 9ae8473df05dd9e048a73797f01a2f34f7447554 include/common/mir/time/types.h
48-9907751d046e4aea81881cf19e5df52c7a6a813e include/common/mir_toolkit/client_types.h
49+ee337f546bca8f151e0f5adafb3ce91dabedebba include/common/mir_toolkit/client_types.h
50 2100c0674d9d882c1845550847357f6a5de5af66 include/common/mir_toolkit/common.h
51 fce4c1a9e0d037244f7e9e96ea2d8eaab4fc404c include/common/mir_toolkit/cursors.h
52 bdaceadd56e41d2cb708f7c4da97acf84dfc75b7 include/common/mir_toolkit/event.h
53
54=== modified file 'server-ABI-sha1sums'
55--- server-ABI-sha1sums 2014-11-22 11:19:02 +0000
56+++ server-ABI-sha1sums 2014-11-23 04:28:11 +0000
57@@ -14,7 +14,7 @@
58 be7d58c9fde2ce91cc66dd6144b76e08b536266b include/common/mir/int_wrapper.h
59 2fd7274766a92f22e8784cb64af91947ba03d0de include/common/mir/logging/logger.h
60 9ae8473df05dd9e048a73797f01a2f34f7447554 include/common/mir/time/types.h
61-9907751d046e4aea81881cf19e5df52c7a6a813e include/common/mir_toolkit/client_types.h
62+ee337f546bca8f151e0f5adafb3ce91dabedebba include/common/mir_toolkit/client_types.h
63 2100c0674d9d882c1845550847357f6a5de5af66 include/common/mir_toolkit/common.h
64 fce4c1a9e0d037244f7e9e96ea2d8eaab4fc404c include/common/mir_toolkit/cursors.h
65 bdaceadd56e41d2cb708f7c4da97acf84dfc75b7 include/common/mir_toolkit/event.h
66
67=== modified file 'src/platform/graphics/display_configuration.cpp'
68--- src/platform/graphics/display_configuration.cpp 2014-10-29 06:21:10 +0000
69+++ src/platform/graphics/display_configuration.cpp 2014-11-23 04:28:11 +0000
70@@ -225,7 +225,7 @@
71 return false;
72
73 auto nmodes = modes.size();
74- if (preferred_mode_index >= nmodes || current_mode_index >= nmodes)
75+ if (current_mode_index >= nmodes)
76 return false;
77
78 return true;
79
80=== modified file 'tests/unit-tests/graphics/test_display_configuration.cpp'
81--- tests/unit-tests/graphics/test_display_configuration.cpp 2014-03-27 06:27:59 +0000
82+++ tests/unit-tests/graphics/test_display_configuration.cpp 2014-11-23 04:28:11 +0000
83@@ -300,10 +300,10 @@
84 EXPECT_FALSE(out.valid());
85 }
86
87-TEST(DisplayConfiguration, unsupported_preferred_mode_invalid)
88-{
89+TEST(DisplayConfiguration, unsupported_preferred_mode_valid)
90+{ // Not having a preferred mode is allowed (LP: #1395405)
91 mg::DisplayConfigurationOutput out = tmpl_output;
92 out.preferred_mode_index = 456;
93
94- EXPECT_FALSE(out.valid());
95+ EXPECT_TRUE(out.valid());
96 }

Subscribers

People subscribed via source and target branches