Mir

Merge lp:~kdub/mir/fix-1314399 into lp:mir

Proposed by Kevin DuBois
Status: Merged
Approved by: Francis Ginther
Approved revision: no longer in the source branch.
Merged at revision: 1594
Proposed branch: lp:~kdub/mir/fix-1314399
Merge into: lp:mir
Diff against target: 63 lines (+45/-0)
2 files modified
src/platform/graphics/android/hwc_layerlist.cpp (+1/-0)
tests/unit-tests/graphics/android/test_hwc_device.cpp (+44/-0)
To merge this branch: bzr merge lp:~kdub/mir/fix-1314399
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve
Alberto Aguirre (community) Approve
Alan Griffiths Approve
Daniel van Vugt Approve
Review via email: mp+217834@code.launchpad.net

Commit message

android: correct problem where we weren't resetting the hwc layer's compositionType to HWC_FRAMEBUFFER every time, while we still had HWC_GEOMETRY_CHANGED set.

This was not a problem we were hitting yet, as we weren't toggling back and forth to overlay, but I noticed this needed correction when hooking up the overlay work to the rest of the system in a demo server.

LP: #1314399

Description of the change

android: correct problem where we weren't resetting the hwc layer's compositionType to HWC_FRAMEBUFFER every time, while we still had HWC_GEOMETRY_CHANGED set.

This was not a problem we were hitting yet, as we weren't toggling back and forth to overlay, but I noticed this needed correction when hooking up the overlay work to the rest of the system in a demo server.

LP: #1314399

note:
The specific requirement in the hwc header is detailed in the bug report.

testing:
display output on the nexus 7 and nexus 10.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Sure... when Jenkins is happy.

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

LGTM

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Alberto Aguirre (albaguirre) wrote :

LGTM

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Francis Ginther (fginther) wrote :

Re-approving. The autolanding job was aborted because of a known bug in the coverage reporting configuration. It should be fixed now and ok to rerun.

Revision history for this message
Francis Ginther (fginther) wrote :

Re-approving. The autolanding job was aborted because of a known bug in the coverage reporting configuration. It should be fixed now and ok to rerun.

Revision history for this message
PS Jenkins bot (ps-jenkins) :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/platform/graphics/android/hwc_layerlist.cpp'
2--- src/platform/graphics/android/hwc_layerlist.cpp 2014-04-09 21:51:31 +0000
3+++ src/platform/graphics/android/hwc_layerlist.cpp 2014-04-30 21:59:21 +0000
4@@ -72,6 +72,7 @@
5 renderable->screen_position(), renderable->alpha_enabled());
6 layers_it->set_buffer(*renderable->buffer());
7 any_buffer_updated |= layers_it->needs_hwc_commit();
8+ layers_it->set_layer_type(mga::LayerType::gl_rendered);
9 layers_it++;
10 }
11 }
12
13=== modified file 'tests/unit-tests/graphics/android/test_hwc_device.cpp'
14--- tests/unit-tests/graphics/android/test_hwc_device.cpp 2014-04-15 21:45:42 +0000
15+++ tests/unit-tests/graphics/android/test_hwc_device.cpp 2014-04-30 21:59:21 +0000
16@@ -603,3 +603,47 @@
17 device.render_gl_and_overlays(stub_context, updated_list, [](mg::Renderable const&){});
18 device.post(mock_buffer);
19 }
20+
21+TEST_F(HwcDevice, resets_composition_type_with_prepare) //lp:1314399
22+{
23+ using namespace testing;
24+ auto native_handle_1 = std::make_shared<mtd::StubAndroidNativeBuffer>();
25+ auto native_handle_2 = std::make_shared<mtd::StubAndroidNativeBuffer>();
26+ auto native_handle_3 = std::make_shared<mtd::StubAndroidNativeBuffer>();
27+ native_handle_1->anwb()->width = buffer_size.width.as_int();
28+ native_handle_1->anwb()->height = buffer_size.height.as_int();
29+ native_handle_2->anwb()->width = buffer_size.width.as_int();
30+ native_handle_2->anwb()->height = buffer_size.height.as_int();
31+ native_handle_3->anwb()->width = buffer_size.width.as_int();
32+ native_handle_3->anwb()->height = buffer_size.height.as_int();
33+
34+ EXPECT_CALL(mock_buffer, native_buffer_handle())
35+ .WillOnce(Return(native_handle_1))
36+ .WillOnce(Return(native_handle_2))
37+ .WillOnce(Return(native_handle_3));
38+
39+ std::list<std::shared_ptr<mg::Renderable>> updated_list({stub_renderable1});
40+
41+ mga::HwcDevice device(mock_device, mock_hwc_device_wrapper, mock_vsync, mock_file_ops);
42+
43+ Sequence seq;
44+ EXPECT_CALL(*mock_hwc_device_wrapper, prepare(_))
45+ .InSequence(seq)
46+ .WillOnce(Invoke([&](hwc_display_contents_1_t& contents)
47+ {
48+ ASSERT_THAT(contents.numHwLayers, Ge(1));
49+ contents.hwLayers[0].compositionType = HWC_OVERLAY;
50+ contents.hwLayers[1].compositionType = HWC_FRAMEBUFFER_TARGET;
51+ }));
52+ EXPECT_CALL(*mock_hwc_device_wrapper, prepare(_))
53+ .InSequence(seq)
54+ .WillOnce(Invoke([&](hwc_display_contents_1_t& contents)
55+ {
56+ ASSERT_THAT(contents.numHwLayers, Ge(1));
57+ EXPECT_EQ(HWC_FRAMEBUFFER, contents.hwLayers[0].compositionType);
58+ }));
59+
60+ device.render_gl_and_overlays(stub_context, updated_list, [](mg::Renderable const&){});
61+ device.render_gl_and_overlays(stub_context, updated_list, [](mg::Renderable const&){});
62+ device.post(mock_buffer);
63+}

Subscribers

People subscribed via source and target branches