Mir

Merge lp:~raof/mir/cursor-suitability-is-per-buffer into lp:mir

Proposed by Chris Halse Rogers
Status: Merged
Approved by: Alan Griffiths
Approved revision: no longer in the source branch.
Merged at revision: 4212
Proposed branch: lp:~raof/mir/cursor-suitability-is-per-buffer
Merge into: lp:mir
Prerequisite: lp:~raof/mir/better-buffer-plumbing
Diff against target: 94 lines (+0/-18)
6 files modified
include/server/mir/frontend/buffer_stream.h (+0/-1)
src/server/compositor/stream.cpp (+0/-7)
src/server/compositor/stream.h (+0/-1)
src/server/frontend/session_mediator.cpp (+0/-5)
tests/include/mir/test/doubles/mock_buffer_stream.h (+0/-3)
tests/include/mir/test/doubles/stub_buffer_stream.h (+0/-1)
To merge this branch: bzr merge lp:~raof/mir/cursor-suitability-is-per-buffer
Reviewer Review Type Date Requested Status
Mir CI Bot continuous-integration Approve
Alan Griffiths Approve
Brandon Schaefer (community) Approve
Review via email: mp+327666@code.launchpad.net

Commit message

Drop BufferStream::suitable_for_cursor

This is a per-buffer, not per-bufferstream, property.

To post a comment you must log in.
Revision history for this message
Chris Halse Rogers (raof) wrote :

Note that we now don't throw any errors if someone tries to submit a non-argb-8888 buffer to a cursor stream.

That said, we didn't correctly enforce that before - someone setting up a presentation chain could happily submit non-argb buffers to it.

This is something that should be fixed, but it might want to be fixed by supporting non-argb8888 buffers for cursors.

Revision history for this message
Mir CI Bot (mir-ci-bot) wrote :

FAILED: Continuous integration, rev:4222
https://mir-jenkins.ubuntu.com/job/mir-ci/3492/
Executed test runs:
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-mir/4770/console
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-0-fetch/4942/console
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=artful/4931/console
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial/4931/console
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=zesty/4931/console
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=artful/4807/console
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=zesty/4807/console
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=artful/4807/console
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial/4807/console
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=zesty/4807/console
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=mesa,release=artful/4807/console
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=mesa,release=zesty/4807/console
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial/4807/console

Click here to trigger a rebuild:
https://mir-jenkins.ubuntu.com/job/mir-ci/3492/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Mir CI Bot (mir-ci-bot) wrote :

FAILED: Continuous integration, rev:4222
https://mir-jenkins.ubuntu.com/job/mir-ci/3494/
Executed test runs:
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-mir/4773/console
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-0-fetch/4945/console
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=artful/4934/console
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial/4934/console
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=zesty/4934/console
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=artful/4810/console
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=zesty/4810/console
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=artful/4810/console
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial/4810/console
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=zesty/4810/console
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=mesa,release=artful/4810/console
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=mesa,release=zesty/4810/console
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial/4810/console

Click here to trigger a rebuild:
https://mir-jenkins.ubuntu.com/job/mir-ci/3494/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Brandon Schaefer (brandontschaefer) wrote :

03:25:12 Contents conflict in examples/render_surfaces.cpp
03:25:12 1 conflicts encountered.

Otherwise LGTM

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

> 03:25:12 Contents conflict in examples/render_surfaces.cpp
> 03:25:12 1 conflicts encountered.
>
> Otherwise LGTM

+1

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

Oh, did I not actually push that?

Revision history for this message
Mir CI Bot (mir-ci-bot) wrote :

PASSED: Continuous integration, rev:4223
https://mir-jenkins.ubuntu.com/job/mir-ci/3501/
Executed test runs:
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-mir/4790
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-0-fetch/4965
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=artful/4954
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial/4954
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=zesty/4954
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=artful/4827
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=artful/4827/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=zesty/4827
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=zesty/4827/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=artful/4827
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=artful/4827/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial/4827
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial/4827/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=zesty/4827
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=zesty/4827/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=mesa,release=artful/4827
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=mesa,release=artful/4827/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=mesa,release=zesty/4827
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=mesa,release=zesty/4827/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial/4827
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial/4827/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://mir-jenkins.ubuntu.com/job/mir-ci/3501/rebuild

review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'include/server/mir/frontend/buffer_stream.h'
--- include/server/mir/frontend/buffer_stream.h 2017-05-08 03:04:26 +0000
+++ include/server/mir/frontend/buffer_stream.h 2017-07-21 05:28:32 +0000
@@ -63,7 +63,6 @@
63 // side once we only support the NBS system.63 // side once we only support the NBS system.
64 virtual void allow_framedropping(bool) = 0;64 virtual void allow_framedropping(bool) = 0;
65 virtual void set_scale(float scale) = 0;65 virtual void set_scale(float scale) = 0;
66 virtual bool suitable_for_cursor() const = 0;
67protected:66protected:
68 BufferStream() = default;67 BufferStream() = default;
69 BufferStream(BufferStream const&) = delete;68 BufferStream(BufferStream const&) = delete;
7069
=== modified file 'src/server/compositor/stream.cpp'
--- src/server/compositor/stream.cpp 2017-07-04 04:06:59 +0000
+++ src/server/compositor/stream.cpp 2017-07-21 05:28:32 +0000
@@ -201,10 +201,3 @@
201void mc::Stream::set_scale(float)201void mc::Stream::set_scale(float)
202{202{
203}203}
204
205bool mc::Stream::suitable_for_cursor() const
206{
207 // We can't reasonably answer this question -
208 // Suitability for cursor use is a per-buffer property, not a per-stream property.
209 return true;
210}
211204
=== modified file 'src/server/compositor/stream.h'
--- src/server/compositor/stream.h 2017-07-04 00:54:25 +0000
+++ src/server/compositor/stream.h 2017-07-21 05:28:32 +0000
@@ -59,7 +59,6 @@
59 void associate_buffer(graphics::BufferID) override;59 void associate_buffer(graphics::BufferID) override;
60 void disassociate_buffer(graphics::BufferID) override;60 void disassociate_buffer(graphics::BufferID) override;
61 void set_scale(float scale) override;61 void set_scale(float scale) override;
62 bool suitable_for_cursor() const override;
6362
64private:63private:
65 enum class ScheduleMode;64 enum class ScheduleMode;
6665
=== modified file 'src/server/frontend/session_mediator.cpp'
--- src/server/frontend/session_mediator.cpp 2017-07-18 01:32:08 +0000
+++ src/server/frontend/session_mediator.cpp 2017-07-21 05:28:32 +0000
@@ -757,8 +757,6 @@
757 {757 {
758 mf::BufferStreamId id{surface_specification.cursor_id().value()};758 mf::BufferStreamId id{surface_specification.cursor_id().value()};
759 auto stream = session->get_buffer_stream(id);759 auto stream = session->get_buffer_stream(id);
760 if (!stream->suitable_for_cursor())
761 BOOST_THROW_EXCEPTION(std::logic_error("Cursor buffer streams must have mir_pixel_format_argb_8888 format"));
762 mods.stream_cursor = msh::StreamCursor{760 mods.stream_cursor = msh::StreamCursor{
763 id, geom::Displacement{surface_specification.hotspot_x(), surface_specification.hotspot_y()} };761 id, geom::Displacement{surface_specification.hotspot_x(), surface_specification.hotspot_y()} };
764 }762 }
@@ -1059,9 +1057,6 @@
1059 auto hotspot = geom::Displacement{cursor_request->hotspot_x(), cursor_request->hotspot_y()};1057 auto hotspot = geom::Displacement{cursor_request->hotspot_x(), cursor_request->hotspot_y()};
1060 auto stream = session->get_buffer_stream(stream_id);1058 auto stream = session->get_buffer_stream(stream_id);
10611059
1062 if (!stream->suitable_for_cursor())
1063 BOOST_THROW_EXCEPTION(std::logic_error("Cursor buffer streams must have mir_pixel_format_argb_8888 format"));
1064
1065 surface->set_cursor_stream(stream, hotspot);1060 surface->set_cursor_stream(stream, hotspot);
1066 }1061 }
1067 else1062 else
10681063
=== modified file 'tests/include/mir/test/doubles/mock_buffer_stream.h'
--- tests/include/mir/test/doubles/mock_buffer_stream.h 2017-05-08 03:04:26 +0000
+++ tests/include/mir/test/doubles/mock_buffer_stream.h 2017-07-21 05:28:32 +0000
@@ -53,8 +53,6 @@
53 .WillByDefault(testing::Return(mir_pixel_format_abgr_8888));53 .WillByDefault(testing::Return(mir_pixel_format_abgr_8888));
54 ON_CALL(*this, stream_size())54 ON_CALL(*this, stream_size())
55 .WillByDefault(testing::Return(geometry::Size{0,0}));55 .WillByDefault(testing::Return(geometry::Size{0,0}));
56 ON_CALL(*this, suitable_for_cursor())
57 .WillByDefault(testing::Return(true));
58 }56 }
59 std::shared_ptr<StubBuffer> buffer { std::make_shared<StubBuffer>() };57 std::shared_ptr<StubBuffer> buffer { std::make_shared<StubBuffer>() };
60 MOCK_METHOD1(acquire_client_buffer, void(std::function<void(graphics::Buffer* buffer)>));58 MOCK_METHOD1(acquire_client_buffer, void(std::function<void(graphics::Buffer* buffer)>));
@@ -82,7 +80,6 @@
82 MOCK_METHOD1(disassociate_buffer, void(graphics::BufferID));80 MOCK_METHOD1(disassociate_buffer, void(graphics::BufferID));
83 MOCK_METHOD1(associate_buffer, void(graphics::BufferID));81 MOCK_METHOD1(associate_buffer, void(graphics::BufferID));
84 MOCK_METHOD1(set_scale, void(float));82 MOCK_METHOD1(set_scale, void(float));
85 MOCK_CONST_METHOD0(suitable_for_cursor, bool());
8683
87};84};
88}85}
8986
=== modified file 'tests/include/mir/test/doubles/stub_buffer_stream.h'
--- tests/include/mir/test/doubles/stub_buffer_stream.h 2017-05-08 03:04:26 +0000
+++ tests/include/mir/test/doubles/stub_buffer_stream.h 2017-07-21 05:28:32 +0000
@@ -82,7 +82,6 @@
82 void associate_buffer(graphics::BufferID) override {}82 void associate_buffer(graphics::BufferID) override {}
83 void disassociate_buffer(graphics::BufferID) override {}83 void disassociate_buffer(graphics::BufferID) override {}
84 void set_scale(float) override {}84 void set_scale(float) override {}
85 bool suitable_for_cursor() const override { return false; }
8685
87 std::shared_ptr<graphics::Buffer> stub_compositor_buffer;86 std::shared_ptr<graphics::Buffer> stub_compositor_buffer;
88 int nready = 0;87 int nready = 0;

Subscribers

People subscribed via source and target branches