Mir

Merge lp:~kdub/mir/privatize-get-buffer-package into lp:~mir-team/mir/publish-new-apis

Proposed by Kevin DuBois
Status: Rejected
Rejected by: Kevin DuBois
Proposed branch: lp:~kdub/mir/privatize-get-buffer-package
Merge into: lp:~mir-team/mir/publish-new-apis
Diff against target: 161 lines (+57/-31)
6 files modified
include/client/mir_toolkit/mir_buffer.h (+0/-8)
src/client/symbols.map (+1/-1)
src/include/client/mir_toolkit/mir_buffer_private.h (+8/-0)
tests/acceptance-tests/CMakeLists.txt (+5/-0)
tests/acceptance-tests/test_mir_buffer.cpp (+43/-0)
tests/acceptance-tests/test_presentation_chain.cpp (+0/-22)
To merge this branch: bzr merge lp:~kdub/mir/privatize-get-buffer-package
Reviewer Review Type Date Requested Status
Mir development team Pending
Review via email: mp+316231@code.launchpad.net

Commit message

privatize mir_buffer_get_buffer_package. This is only really useful to the nested server, and can be moved to an extension for nested servers later.

Description of the change

privatize mir_buffer_get_buffer_package. This is only really useful to the nested server, and can be moved to an extension for nested servers later.

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

rejected in discussion, this function is useful to nested and the drivers.

Unmerged revisions

3957. By Kevin DuBois

missing file

3956. By Kevin DuBois

privatize mir_buffer_get_buffer_package

3955. By Cemil Azizoglu

Fix clang build.

3954. By Cemil Azizoglu

Merge lp:mir... no conflicts!?

3953. By Cemil Azizoglu

Deprecate types too.

3952. By Cemil Azizoglu

Merge lp:mir, fix conflict again.

3951. By Cemil Azizoglu

merge lp:mir, fix conflict

3950. By Cemil Azizoglu

More cleanups

3949. By Cemil Azizoglu

"Staging" can now use the published headers

3948. By Cemil Azizoglu

Unversion and ignore version.h

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'include/client/mir_toolkit/mir_buffer.h'
2--- include/client/mir_toolkit/mir_buffer.h 2017-02-01 17:11:12 +0000
3+++ include/client/mir_toolkit/mir_buffer.h 2017-02-02 14:17:12 +0000
4@@ -80,14 +80,6 @@
5 **/
6 char const *mir_buffer_get_error_message(MirBuffer* buffer);
7
8-/**
9- * Access the MirBufferPackage
10- *
11- * \param [in] buffer The buffer
12- * \return The MirBufferPackage representing buffer
13- */
14-MirBufferPackage* mir_buffer_get_buffer_package(MirBuffer* buffer);
15-
16 /** Access a CPU-mapped region associated with a given buffer.
17 *
18 * \param [in] buffer The buffer
19
20=== modified file 'src/client/symbols.map'
21--- src/client/symbols.map 2017-02-01 22:28:16 +0000
22+++ src/client/symbols.map 2017-02-02 14:17:12 +0000
23@@ -379,6 +379,7 @@
24
25 #private functions needed temporarily by nested passthrough
26 #should not be published along with the rest of the NBS symbols
27+ mir_buffer_get_buffer_package;
28 mir_buffer_get_egl_image_parameters;
29 mir_presentation_chain_set_queueing_mode;
30 mir_presentation_chain_set_dropping_mode;
31@@ -588,7 +589,6 @@
32 mir_buffer_get_buffer_usage;
33 mir_buffer_is_valid;
34 mir_buffer_get_error_message;
35- mir_buffer_get_buffer_package;
36 } MIR_CLIENT_0.26;
37
38 MIR_CLIENT_0.27 { # New functions in Mir 0.27 or 1.0
39
40=== modified file 'src/include/client/mir_toolkit/mir_buffer_private.h'
41--- src/include/client/mir_toolkit/mir_buffer_private.h 2017-02-01 17:11:12 +0000
42+++ src/include/client/mir_toolkit/mir_buffer_private.h 2017-02-02 14:17:12 +0000
43@@ -66,6 +66,14 @@
44 EGLClientBuffer* client_buffer,
45 EGLint** attrs);
46
47+/**
48+ * Access the MirBufferPackage
49+ *
50+ * \param [in] buffer The buffer
51+ * \return The MirBufferPackage representing buffer
52+ */
53+MirBufferPackage* mir_buffer_get_buffer_package(MirBuffer* buffer);
54+
55 #ifdef __cplusplus
56 }
57 /**@}*/
58
59=== modified file 'tests/acceptance-tests/CMakeLists.txt'
60--- tests/acceptance-tests/CMakeLists.txt 2017-02-01 17:43:59 +0000
61+++ tests/acceptance-tests/CMakeLists.txt 2017-02-02 14:17:12 +0000
62@@ -64,6 +64,7 @@
63 test_presentation_chain.cpp
64 test_render_surface.cpp
65 test_buffer_stream_arrangement1.cpp
66+ test_mir_buffer.cpp
67 )
68
69 if (MIR_TEST_PLATFORM STREQUAL "mesa-kms" OR MIR_TEST_PLATFORM STREQUAL "mesa-x11")
70@@ -89,6 +90,10 @@
71 # uses src/include/common/mir/protobuf/protocol_version.h
72 set_source_files_properties(test_client_library.cpp PROPERTIES COMPILE_FLAGS
73 "${CMAKE_CXXFLAGS} -I ${CMAKE_SOURCE_DIR}")
74+
75+ # uses src/include/client/mir_toolkit/mir_buffer_private.h
76+ set_source_files_properties(test_mir_buffer.cpp PROPERTIES COMPILE_FLAGS
77+ "${CMAKE_CXXFLAGS} -I ${PROJECT_SOURCE_DIR}/src/include/client")
78 # END "throwbacks"
79
80 mir_add_wrapped_executable(
81
82=== added file 'tests/acceptance-tests/test_mir_buffer.cpp'
83--- tests/acceptance-tests/test_mir_buffer.cpp 1970-01-01 00:00:00 +0000
84+++ tests/acceptance-tests/test_mir_buffer.cpp 2017-02-02 14:17:12 +0000
85@@ -0,0 +1,43 @@
86+/*
87+ * Copyright © 2017 Canonical Ltd.
88+ *
89+ * This program is free software: you can redistribute it and/or modify it
90+ * under the terms of the GNU General Public License version 3,
91+ * as published by the Free Software Foundation.
92+ *
93+ * This program is distributed in the hope that it will be useful,
94+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
95+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
96+ * GNU General Public License for more details.
97+ *
98+ * You should have received a copy of the GNU General Public License
99+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
100+ *
101+ * Authored by: Kevin DuBois <kevin.dubois@canonical.com>
102+ */
103+
104+#include "mir/geometry/size.h"
105+#include "mir_toolkit/mir_native_buffer.h"
106+#include "mir_toolkit/mir_presentation_chain.h"
107+#include "mir_toolkit/mir_buffer_private.h"
108+#include "mir_test_framework/connected_client_headless_server.h"
109+
110+namespace mtf = mir_test_framework;
111+using namespace testing;
112+
113+struct MirBuffer : mtf::ConnectedClientHeadlessServer
114+{
115+};
116+
117+TEST_F(MirBuffer, can_access_platform_message_representing_buffer)
118+{
119+ mir::geometry::Size size { 100, 120 };
120+ auto buffer = mir_connection_allocate_buffer_sync(
121+ connection, size.width.as_int(), size.height.as_int(), mir_pixel_format_abgr_8888);
122+ auto message = mir_buffer_get_buffer_package(buffer);
123+ ASSERT_THAT(message, Ne(nullptr));
124+ EXPECT_THAT(message->data_items, Ge(1));
125+ EXPECT_THAT(message->fd_items, Ge(1));
126+ EXPECT_THAT(message->width, Eq(size.width.as_int()));
127+ EXPECT_THAT(message->height, Eq(size.height.as_int()));
128+}
129
130=== modified file 'tests/acceptance-tests/test_presentation_chain.cpp'
131--- tests/acceptance-tests/test_presentation_chain.cpp 2017-02-01 22:28:16 +0000
132+++ tests/acceptance-tests/test_presentation_chain.cpp 2017-02-02 14:17:12 +0000
133@@ -235,28 +235,6 @@
134 EXPECT_THAT(context.buffer(), Ne(nullptr));
135 }
136
137-TEST_F(PresentationChain, can_access_platform_message_representing_buffer)
138-{
139- SurfaceWithChainFromStart window(connection, size, pf);
140-
141- MirBufferSync context;
142- mir_connection_allocate_buffer(
143- connection,
144- size.width.as_int(), size.height.as_int(), pf,
145- buffer_callback, &context);
146-
147- EXPECT_TRUE(context.wait_for_buffer(10s));
148- auto buffer = context.buffer();
149- EXPECT_THAT(context.buffer(), Ne(nullptr));
150-
151- auto message = mir_buffer_get_buffer_package(buffer);
152- ASSERT_THAT(message, Ne(nullptr));
153- EXPECT_THAT(message->data_items, Ge(1));
154- EXPECT_THAT(message->fd_items, Ge(1));
155- EXPECT_THAT(message->width, Eq(size.width.as_int()));
156- EXPECT_THAT(message->height, Eq(size.height.as_int()));
157-}
158-
159 TEST_F(PresentationChain, has_native_fence)
160 {
161 SurfaceWithChainFromStart window(connection, size, pf);

Subscribers

People subscribed via source and target branches