Mir

Merge lp:~afrantzis/mir/platform-operation-client-api-remove-opcode into lp:mir

Proposed by Alexandros Frantzis
Status: Merged
Approved by: Alan Griffiths
Approved revision: no longer in the source branch.
Merged at revision: 2288
Proposed branch: lp:~afrantzis/mir/platform-operation-client-api-remove-opcode
Merge into: lp:mir
Prerequisite: lp:~afrantzis/mir/platform-operation-set-gbm-device
Diff against target: 163 lines (+10/-19)
8 files modified
client-ABI-sha1sums (+1/-1)
include/client/mir_toolkit/mir_connection.h (+1/-2)
src/client/mir_connection.cpp (+1/-2)
src/client/mir_connection.h (+0/-5)
src/client/mir_connection_api.cpp (+2/-4)
src/server/graphics/nested/mir_client_host_connection.cpp (+1/-1)
tests/acceptance-tests/test_client_platform_operation.cpp (+2/-2)
tests/unit-tests/client/test_mir_connection.cpp (+2/-2)
To merge this branch: bzr merge lp:~afrantzis/mir/platform-operation-client-api-remove-opcode
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve
Robert Carr (community) Approve
Alan Griffiths Approve
Kevin DuBois Pending
Chris Halse Rogers Pending
Daniel van Vugt Pending
Review via email: mp+248338@code.launchpad.net

This proposal supersedes a proposal from 2015-02-02.

Commit message

client: Remove redundant opcode parameter from platform operation API

Description of the change

client: Remove redundant opcode parameter from platform operation API

During development/refactorings of the client platform operation API the redundancy of the opcode parameter (which is a mandatory parameter of a MirPlatformMessage) went unnoticed.

This is a client API/ABI break, but since the platform operation API is not currently used by external code (and could not have been used because we didn't expose any operations), we can get away with it.

To post a comment you must log in.
Revision history for this message
Robert Carr (robertcarr) wrote : Posted in a previous version of this proposal

LGTM

review: Approve
Revision history for this message
Daniel van Vugt (vanvugt) wrote : Posted in a previous version of this proposal

I approve but we need more eyes on this given we're knowingly breaking part of the client API that's been around a long time.

review: Needs Information
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal
review: Approve (continuous-integration)
Revision history for this message
Kevin DuBois (kdub) wrote : Posted in a previous version of this proposal

lgtm

review: Approve
Revision history for this message
Chris Halse Rogers (raof) wrote : Posted in a previous version of this proposal

LGTM

review: Approve
Revision history for this message
Daniel van Vugt (vanvugt) wrote : Posted in a previous version of this proposal

Targeting the wrong branch now. Somehow!?

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

LGTM

review: Approve
Revision history for this message
Robert Carr (robertcarr) :
review: Approve
Revision history for this message
Robert Carr (robertcarr) wrote :

TAing due to previous approvals before resubmit.

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) :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'client-ABI-sha1sums'
--- client-ABI-sha1sums 2015-01-29 04:34:12 +0000
+++ client-ABI-sha1sums 2015-02-03 09:35:55 +0000
@@ -1,7 +1,7 @@
1afd66e984f4f8c0303fd25fb6fea32fa47bbd37f include/client/mir_toolkit/debug/surface.h1afd66e984f4f8c0303fd25fb6fea32fa47bbd37f include/client/mir_toolkit/debug/surface.h
2b53736bcb22ddc09aab8275cfdd05c109fdd0f12 include/client/mir_toolkit/mir_client_library_drm.h2b53736bcb22ddc09aab8275cfdd05c109fdd0f12 include/client/mir_toolkit/mir_client_library_drm.h
3532af89e0f48d8d2a7cf01621db25d3338ae3abf include/client/mir_toolkit/mir_client_library.h3532af89e0f48d8d2a7cf01621db25d3338ae3abf include/client/mir_toolkit/mir_client_library.h
4750aa35e6a5173bcba47cb524c508d05a4df746c include/client/mir_toolkit/mir_connection.h4615df675ffba805fb0594e19fb006f514f2100a7 include/client/mir_toolkit/mir_connection.h
51ef8f51a3e3f8d1559266c5af58fbfde7cfabf0a include/client/mir_toolkit/mir_cursor_configuration.h51ef8f51a3e3f8d1559266c5af58fbfde7cfabf0a include/client/mir_toolkit/mir_cursor_configuration.h
6d739af6e64db6b314a727b5fb00be662b98ccd57 include/client/mir_toolkit/mir_platform_message.h6d739af6e64db6b314a727b5fb00be662b98ccd57 include/client/mir_toolkit/mir_platform_message.h
79d50df5a141ca03ee8a79f7e844ed4b8b3b7d5d3 include/client/mir_toolkit/mir_prompt_session.h79d50df5a141ca03ee8a79f7e844ed4b8b3b7d5d3 include/client/mir_toolkit/mir_prompt_session.h
88
=== modified file 'include/client/mir_toolkit/mir_connection.h'
--- include/client/mir_toolkit/mir_connection.h 2015-01-14 06:39:13 +0000
+++ include/client/mir_toolkit/mir_connection.h 2015-02-03 09:35:55 +0000
@@ -178,14 +178,13 @@
178 * until this operation finishes.178 * until this operation finishes.
179 *179 *
180 * \param [in] connection The connection180 * \param [in] connection The connection
181 * \param [in] opcode The opcode of the operation to perform
182 * \param [in] request The message used for this operation181 * \param [in] request The message used for this operation
183 * \param [in] callback The callback to call when the operation finishes182 * \param [in] callback The callback to call when the operation finishes
184 * \param [in,out] context User data passed to the callback function183 * \param [in,out] context User data passed to the callback function
185 * \return A handle that can be passed to mir_wait_for184 * \return A handle that can be passed to mir_wait_for
186 */185 */
187MirWaitHandle* mir_connection_platform_operation(186MirWaitHandle* mir_connection_platform_operation(
188 MirConnection* connection, unsigned int opcode,187 MirConnection* connection,
189 MirPlatformMessage const* request,188 MirPlatformMessage const* request,
190 mir_platform_operation_callback callback, void* context);189 mir_platform_operation_callback callback, void* context);
191190
192191
=== modified file 'src/client/mir_connection.cpp'
--- src/client/mir_connection.cpp 2015-02-03 09:35:55 +0000
+++ src/client/mir_connection.cpp 2015-02-03 09:35:55 +0000
@@ -357,7 +357,6 @@
357}357}
358358
359MirWaitHandle* MirConnection::platform_operation(359MirWaitHandle* MirConnection::platform_operation(
360 unsigned int opcode,
361 MirPlatformMessage const* request,360 MirPlatformMessage const* request,
362 mir_platform_operation_callback callback, void* context)361 mir_platform_operation_callback callback, void* context)
363{362{
@@ -371,7 +370,7 @@
371370
372 mir::protobuf::PlatformOperationMessage protobuf_request;371 mir::protobuf::PlatformOperationMessage protobuf_request;
373372
374 protobuf_request.set_opcode(opcode);373 protobuf_request.set_opcode(mir_platform_message_get_opcode(request));
375 auto const request_data = mir_platform_message_get_data(request);374 auto const request_data = mir_platform_message_get_data(request);
376 auto const request_fds = mir_platform_message_get_fds(request);375 auto const request_fds = mir_platform_message_get_fds(request);
377376
378377
=== modified file 'src/client/mir_connection.h'
--- src/client/mir_connection.h 2015-02-03 09:35:55 +0000
+++ src/client/mir_connection.h 2015-02-03 09:35:55 +0000
@@ -107,12 +107,7 @@
107107
108 MirWaitHandle* disconnect();108 MirWaitHandle* disconnect();
109109
110 MirWaitHandle* drm_auth_magic(unsigned int magic,
111 mir_drm_auth_magic_callback callback,
112 void* context);
113
114 MirWaitHandle* platform_operation(110 MirWaitHandle* platform_operation(
115 unsigned int opcode,
116 MirPlatformMessage const* request,111 MirPlatformMessage const* request,
117 mir_platform_operation_callback callback, void* context);112 mir_platform_operation_callback callback, void* context);
118113
119114
=== modified file 'src/client/mir_connection_api.cpp'
--- src/client/mir_connection_api.cpp 2015-02-03 09:35:55 +0000
+++ src/client/mir_connection_api.cpp 2015-02-03 09:35:55 +0000
@@ -306,13 +306,13 @@
306}306}
307307
308MirWaitHandle* mir_connection_platform_operation(308MirWaitHandle* mir_connection_platform_operation(
309 MirConnection* connection, unsigned int opcode,309 MirConnection* connection,
310 MirPlatformMessage const* request,310 MirPlatformMessage const* request,
311 mir_platform_operation_callback callback, void* context)311 mir_platform_operation_callback callback, void* context)
312{312{
313 try313 try
314 {314 {
315 return connection->platform_operation(opcode, request, callback, context);315 return connection->platform_operation(request, callback, context);
316 }316 }
317 catch (std::exception const& ex)317 catch (std::exception const& ex)
318 {318 {
@@ -387,7 +387,6 @@
387387
388 return mir_connection_platform_operation(388 return mir_connection_platform_operation(
389 connection,389 connection,
390 MirMesaPlatformOperation::auth_magic,
391 msg.get(),390 msg.get(),
392 platform_operation_to_auth_magic_callback,391 platform_operation_to_auth_magic_callback,
393 auth_magic_op_context);392 auth_magic_op_context);
@@ -409,7 +408,6 @@
409408
410 auto wh = mir_connection_platform_operation(409 auto wh = mir_connection_platform_operation(
411 connection,410 connection,
412 MirMesaPlatformOperation::set_gbm_device,
413 msg.get(),411 msg.get(),
414 assign_set_gbm_device_status,412 assign_set_gbm_device_status,
415 &status);413 &status);
416414
=== modified file 'src/server/graphics/nested/mir_client_host_connection.cpp'
--- src/server/graphics/nested/mir_client_host_connection.cpp 2015-01-26 15:53:18 +0000
+++ src/server/graphics/nested/mir_client_host_connection.cpp 2015-02-03 09:35:55 +0000
@@ -185,7 +185,7 @@
185 MirPlatformMessage* raw_reply{nullptr};185 MirPlatformMessage* raw_reply{nullptr};
186186
187 auto const wh = mir_connection_platform_operation(187 auto const wh = mir_connection_platform_operation(
188 mir_connection, op, msg.get(), platform_operation_callback, &raw_reply);188 mir_connection, msg.get(), platform_operation_callback, &raw_reply);
189 mir_wait_for(wh);189 mir_wait_for(wh);
190190
191 auto const reply = mir::raii::deleter_for(191 auto const reply = mir::raii::deleter_for(
192192
=== modified file 'tests/acceptance-tests/test_client_platform_operation.cpp'
--- tests/acceptance-tests/test_client_platform_operation.cpp 2014-12-11 08:54:04 +0000
+++ tests/acceptance-tests/test_client_platform_operation.cpp 2015-02-03 09:35:55 +0000
@@ -39,7 +39,7 @@
39 MirPlatformMessage* reply;39 MirPlatformMessage* reply;
4040
41 auto const platform_op_done = mir_connection_platform_operation(41 auto const platform_op_done = mir_connection_platform_operation(
42 connection, add_opcode, request, assign_reply, &reply);42 connection, request, assign_reply, &reply);
43 mir_wait_for(platform_op_done);43 mir_wait_for(platform_op_done);
4444
45 mir_platform_message_release(request);45 mir_platform_message_release(request);
@@ -57,7 +57,7 @@
57 MirPlatformMessage* reply;57 MirPlatformMessage* reply;
5858
59 auto const platform_op_done = mir_connection_platform_operation(59 auto const platform_op_done = mir_connection_platform_operation(
60 connection, echo_fd_opcode, request, assign_reply, &reply);60 connection, request, assign_reply, &reply);
61 mir_wait_for(platform_op_done);61 mir_wait_for(platform_op_done);
6262
63 mir_platform_message_release(request);63 mir_platform_message_release(request);
6464
=== modified file 'tests/unit-tests/client/test_mir_connection.cpp'
--- tests/unit-tests/client/test_mir_connection.cpp 2015-02-03 09:35:55 +0000
+++ tests/unit-tests/client/test_mir_connection.cpp 2015-02-03 09:35:55 +0000
@@ -615,7 +615,7 @@
615 MirPlatformMessage* returned_response{nullptr};615 MirPlatformMessage* returned_response{nullptr};
616616
617 auto op_wh = connection->platform_operation(617 auto op_wh = connection->platform_operation(
618 opcode, request.get(), assign_response, &returned_response);618 request.get(), assign_response, &returned_response);
619 mir_wait_for(op_wh);619 mir_wait_for(op_wh);
620620
621 EXPECT_THAT(returned_response, Eq(response.get()));621 EXPECT_THAT(returned_response, Eq(response.get()));
@@ -642,7 +642,7 @@
642 MirPlatformMessage* returned_response{nullptr};642 MirPlatformMessage* returned_response{nullptr};
643643
644 auto op_wh = connection->platform_operation(644 auto op_wh = connection->platform_operation(
645 opcode, request.get(), assign_response, &returned_response);645 request.get(), assign_response, &returned_response);
646 mir_wait_for(op_wh);646 mir_wait_for(op_wh);
647647
648 EXPECT_THAT(mir_platform_message_get_opcode(returned_response), Eq(opcode));648 EXPECT_THAT(mir_platform_message_get_opcode(returned_response), Eq(opcode));

Subscribers

People subscribed via source and target branches