Mir

Merge lp:~afrantzis/mir/fix-1486535-emulator-failures into lp:mir

Proposed by Alexandros Frantzis
Status: Merged
Approved by: Kevin DuBois
Approved revision: no longer in the source branch.
Merged at revision: 2858
Proposed branch: lp:~afrantzis/mir/fix-1486535-emulator-failures
Merge into: lp:mir
Diff against target: 80 lines (+34/-6)
3 files modified
examples/eglapp.c (+0/-1)
src/platforms/android/server/fb_device.cpp (+7/-5)
tests/unit-tests/graphics/android/test_fb_device.cpp (+27/-0)
To merge this branch: bzr merge lp:~afrantzis/mir/fix-1486535-emulator-failures
Reviewer Review Type Date Requested Status
Daniel van Vugt Needs Information
PS Jenkins bot (community) continuous-integration Approve
Cemil Azizoglu (community) Approve
Kevin DuBois (community) Approve
Review via email: mp+268521@code.launchpad.net

Commit message

Fix Mir failures on the ubuntu-touch emulator
(LP: #1486535)

Description of the change

Fix Mir failures on the ubuntu-touch emulator

This MP consists of the parts/commits.

The main fix:

"android: Report the display configuration correctly on HWC 1.0 systems"

and a workaround for what seems to be a bug in the emulator EGL implementation:

"examples: Don't specify EGL_COLOR_BUFFER_TYPE EGL attribute

Specifying EGL_COLOR_BUFFER_TYPE seems to confuse the ubuntu-touch
emulator EGL implementation, causing it to not find any matching
EGLConfigs. This seems like a bug in the EGL implementation.

In any case, setting this attribute to EGL_RGB_BUFFER is not actually
needed since that's the default value."

This is a candidate for backporting to 0.14.x (to be used in OTA6).

To post a comment you must log in.
Revision history for this message
Kevin DuBois (kdub) wrote :

lgtm

review: Approve
Revision history for this message
Cemil Azizoglu (cemil-azizoglu) wrote :

good

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

The EGL bit looks wrong. That's been there forever so it seems like the actual bug is a regression in the emulator. We should be fixing the emulator instead.

review: Needs Information

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'examples/eglapp.c'
2--- examples/eglapp.c 2015-08-06 03:17:35 +0000
3+++ examples/eglapp.c 2015-08-19 17:16:28 +0000
4@@ -351,7 +351,6 @@
5 {
6 EGL_SURFACE_TYPE, EGL_WINDOW_BIT,
7 EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT,
8- EGL_COLOR_BUFFER_TYPE, EGL_RGB_BUFFER,
9 EGL_RED_SIZE, rgb_bits,
10 EGL_GREEN_SIZE, rgb_bits,
11 EGL_BLUE_SIZE, rgb_bits,
12
13=== modified file 'src/platforms/android/server/fb_device.cpp'
14--- src/platforms/android/server/fb_device.cpp 2015-07-21 04:30:03 +0000
15+++ src/platforms/android/server/fb_device.cpp 2015-08-19 17:16:28 +0000
16@@ -53,10 +53,12 @@
17 fb_device->enableScreen(fb_device.get(), enable);
18 }
19
20-mg::DisplayConfigurationOutput mga::FbControl::active_config_for(DisplayName)
21+mg::DisplayConfigurationOutput mga::FbControl::active_config_for(DisplayName display_name)
22 {
23+ auto const connected = (display_name == DisplayName::primary);
24+
25 return {
26- mg::DisplayConfigurationOutputId{0},
27+ static_cast<mg::DisplayConfigurationOutputId>(display_name),
28 mg::DisplayConfigurationCardId{0},
29 mg::DisplayConfigurationOutputType::lvds,
30 std::vector<MirPixelFormat>{mga::to_mir_format(fb_device->format)},
31@@ -65,11 +67,11 @@
32 },
33 0,
34 {0,0},
35- true,
36- false,
37+ connected,
38+ connected,
39 {0,0},
40 0,
41- mir_pixel_format_abgr_8888,
42+ mga::to_mir_format(fb_device->format),
43 mir_power_mode_on,
44 mir_orientation_normal
45 };
46
47=== modified file 'tests/unit-tests/graphics/android/test_fb_device.cpp'
48--- tests/unit-tests/graphics/android/test_fb_device.cpp 2015-06-26 09:52:00 +0000
49+++ tests/unit-tests/graphics/android/test_fb_device.cpp 2015-08-19 17:16:28 +0000
50@@ -146,3 +146,30 @@
51 EXPECT_EQ(display_size, attribs.modes[attribs.current_mode_index].size);
52 EXPECT_EQ(mir_pixel_format_abgr_8888, attribs.current_format);
53 }
54+
55+TEST_F(FBDevice, supports_primary_display)
56+{
57+ mga::FbControl fb_control(fb_hal_mock);
58+ auto const primary = fb_control.active_config_for(mga::DisplayName::primary);
59+
60+ EXPECT_TRUE(primary.connected);
61+ EXPECT_TRUE(primary.used);
62+}
63+
64+TEST_F(FBDevice, does_not_support_external_display)
65+{
66+ mga::FbControl fb_control(fb_hal_mock);
67+ auto const external = fb_control.active_config_for(mga::DisplayName::external);
68+
69+ EXPECT_FALSE(external.connected);
70+ EXPECT_FALSE(external.used);
71+}
72+
73+TEST_F(FBDevice, assigns_different_output_ids_to_displays)
74+{
75+ mga::FbControl fb_control(fb_hal_mock);
76+ auto const primary = fb_control.active_config_for(mga::DisplayName::primary);
77+ auto const external = fb_control.active_config_for(mga::DisplayName::external);
78+
79+ EXPECT_NE(primary.id, external.id);
80+}

Subscribers

People subscribed via source and target branches