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
=== modified file 'src/platform/graphics/android/hwc_layerlist.cpp'
--- src/platform/graphics/android/hwc_layerlist.cpp 2014-04-09 21:51:31 +0000
+++ src/platform/graphics/android/hwc_layerlist.cpp 2014-04-30 21:59:21 +0000
@@ -72,6 +72,7 @@
72 renderable->screen_position(), renderable->alpha_enabled());72 renderable->screen_position(), renderable->alpha_enabled());
73 layers_it->set_buffer(*renderable->buffer());73 layers_it->set_buffer(*renderable->buffer());
74 any_buffer_updated |= layers_it->needs_hwc_commit(); 74 any_buffer_updated |= layers_it->needs_hwc_commit();
75 layers_it->set_layer_type(mga::LayerType::gl_rendered);
75 layers_it++;76 layers_it++;
76 }77 }
77 }78 }
7879
=== modified file 'tests/unit-tests/graphics/android/test_hwc_device.cpp'
--- tests/unit-tests/graphics/android/test_hwc_device.cpp 2014-04-15 21:45:42 +0000
+++ tests/unit-tests/graphics/android/test_hwc_device.cpp 2014-04-30 21:59:21 +0000
@@ -603,3 +603,47 @@
603 device.render_gl_and_overlays(stub_context, updated_list, [](mg::Renderable const&){});603 device.render_gl_and_overlays(stub_context, updated_list, [](mg::Renderable const&){});
604 device.post(mock_buffer);604 device.post(mock_buffer);
605}605}
606
607TEST_F(HwcDevice, resets_composition_type_with_prepare) //lp:1314399
608{
609 using namespace testing;
610 auto native_handle_1 = std::make_shared<mtd::StubAndroidNativeBuffer>();
611 auto native_handle_2 = std::make_shared<mtd::StubAndroidNativeBuffer>();
612 auto native_handle_3 = std::make_shared<mtd::StubAndroidNativeBuffer>();
613 native_handle_1->anwb()->width = buffer_size.width.as_int();
614 native_handle_1->anwb()->height = buffer_size.height.as_int();
615 native_handle_2->anwb()->width = buffer_size.width.as_int();
616 native_handle_2->anwb()->height = buffer_size.height.as_int();
617 native_handle_3->anwb()->width = buffer_size.width.as_int();
618 native_handle_3->anwb()->height = buffer_size.height.as_int();
619
620 EXPECT_CALL(mock_buffer, native_buffer_handle())
621 .WillOnce(Return(native_handle_1))
622 .WillOnce(Return(native_handle_2))
623 .WillOnce(Return(native_handle_3));
624
625 std::list<std::shared_ptr<mg::Renderable>> updated_list({stub_renderable1});
626
627 mga::HwcDevice device(mock_device, mock_hwc_device_wrapper, mock_vsync, mock_file_ops);
628
629 Sequence seq;
630 EXPECT_CALL(*mock_hwc_device_wrapper, prepare(_))
631 .InSequence(seq)
632 .WillOnce(Invoke([&](hwc_display_contents_1_t& contents)
633 {
634 ASSERT_THAT(contents.numHwLayers, Ge(1));
635 contents.hwLayers[0].compositionType = HWC_OVERLAY;
636 contents.hwLayers[1].compositionType = HWC_FRAMEBUFFER_TARGET;
637 }));
638 EXPECT_CALL(*mock_hwc_device_wrapper, prepare(_))
639 .InSequence(seq)
640 .WillOnce(Invoke([&](hwc_display_contents_1_t& contents)
641 {
642 ASSERT_THAT(contents.numHwLayers, Ge(1));
643 EXPECT_EQ(HWC_FRAMEBUFFER, contents.hwLayers[0].compositionType);
644 }));
645
646 device.render_gl_and_overlays(stub_context, updated_list, [](mg::Renderable const&){});
647 device.render_gl_and_overlays(stub_context, updated_list, [](mg::Renderable const&){});
648 device.post(mock_buffer);
649}

Subscribers

People subscribed via source and target branches