Mir

Merge lp://qastaging/~vanvugt/mir/resize-protocol into lp://qastaging/mir

Proposed by Daniel van Vugt
Status: Merged
Approved by: Daniel van Vugt
Approved revision: no longer in the source branch.
Merged at revision: 1219
Proposed branch: lp://qastaging/~vanvugt/mir/resize-protocol
Merge into: lp://qastaging/mir
Diff against target: 371 lines (+132/-10)
15 files modified
include/platform/mir/graphics/buffer_ipc_packer.h (+2/-0)
include/shared/mir_toolkit/mir_native_buffer.h (+6/-2)
include/test/mir_test_doubles/mock_buffer_packer.h (+1/-0)
src/client/mir_surface.cpp (+2/-0)
src/server/frontend/protobuf_buffer_packer.cpp (+6/-0)
src/server/frontend/protobuf_buffer_packer.h (+1/-0)
src/server/graphics/android/android_platform.cpp (+1/-0)
src/server/graphics/gbm/gbm_buffer.cpp (+4/-0)
src/server/graphics/gbm/gbm_platform.cpp (+1/-0)
src/shared/protobuf/mir_protobuf.proto (+2/-0)
tests/acceptance-tests/test_client_library.cpp (+75/-0)
tests/mir_test_framework/testing_server_options.cpp (+14/-8)
tests/unit-tests/frontend/test_protobuf_buffer_packer.cpp (+3/-0)
tests/unit-tests/graphics/android/test_android_platform.cpp (+10/-0)
tests/unit-tests/graphics/gbm/test_gbm_platform.cpp (+4/-0)
To merge this branch: bzr merge lp://qastaging/~vanvugt/mir/resize-protocol
Reviewer Review Type Date Requested Status
Alexandros Frantzis (community) Approve
Kevin DuBois (community) Abstain
Alan Griffiths Approve
PS Jenkins bot (community) continuous-integration Approve
Review via email: mp+194301@code.qastaging.launchpad.net

Commit message

Add width and height to the protocol Buffer messages, in preparation for
resizable surfaces.

Description of the change

Does anyone know how to avoid the "#ifndef ANDROID"? Looks like some bits are missing for Android driver/test code.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Alan Griffiths (alan-griffiths) wrote :

160 +#ifdef ANDROID
161 +#include <system/window.h> // for ANativeWindowBuffer AKA MirNativeBuffer
162 +#endif
163 +

Not needed? (And as Daniel implies, conditional compilation in code that shouldn't depend on the platform suggests issues needing to be resolved.)

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

171 +#ifndef ANDROID
172 +// FIXME: It would be nice to run this on all platforms, but our Android test
173 +// infrastructure isn't ready yet. And I don't know how to fix it.
174 +
175 +TEST_F(DefaultDisplayServerTestFixture, client_gets_buffer_dimensions)
...
236 +#endif

I'd prefer to compile (and disable) tests if they are currently expected to fail on android. Vis:

+#ifndef ANDROID
+// FIXME: It would be nice to run this on all platforms, but our Android test
+// infrastructure isn't ready yet. And I don't know how to fix it.
+
+TEST_F(DefaultDisplayServerTestFixture, client_gets_buffer_dimensions)
+#else
+TEST_F(DefaultDisplayServerTestFixture, DISABLED_client_gets_buffer_dimensions)
+#endif

review: Needs Fixing
Revision history for this message
Kevin DuBois (kdub) wrote :

the test itself seems pretty platform specific, we're testing that the native type for the buffer is updated correctly. I'd be happy just having this in a directory that is gbm-only.

although its not necessary, is it slightly safer to bump libmirprotobuf after every change?
would uint32 be better for the width/height?

looks okay otherwise

review: Needs Fixing
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Alan:
Fixed. The disabled tests are now compiled on Android. This also means <system/window.h> is actually used.

Kevin:
I'm undecided about libmirprotobuf bumps. We have a choice of detecting optional fields at runtime (and then throwing exceptions if they're not present), or simply bumping the libmirprotobuf ABI. We've so far failed to do either, so I'm open.

As for int width, height; yes that's intentional. In graphics dimensional values are always intermingled with positional values, like:
    int left = x - width;
    int bottom = y + height;
where at least two of the operands need to be signed. So using a signed width/height clarifies that they're all compatible and the reader doesn't have to worry about the (complicated) implicit conversion rules. The other reason for using signed width/height is that in many cases you will want to specify an unknown/special width/height, so negative values are very useful there.

That all said, C will happily convert between signed/unsigned ints as required. So either will work. It only becomes a real pain if you impose your own strong typing rules which lack implicit conversions (like our geometry classes).

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Alan Griffiths (alan-griffiths) wrote :

I'm concerned that "Mir's Android test infrastructure isn't quite ready for this yet.". But OK for now

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

Why can't the test run on android? Is it only because of:
233 + bool use_real_graphics(mir::options::Option const&) override
234 + {
235 + return true;
236 + }

I think the solution is then to appropriately stub the graphics platform for this test.

Revision history for this message
Kevin DuBois (kdub) wrote :

> I'm concerned that "Mir's Android test infrastructure isn't quite ready for
> this yet.". But OK for now

I don't see how it is not ready, which is why I'd rather have the test in question in a directory that is only compiled into the gbm tests until the test can be made to work. Overall though, okay, so i'll unblock

review: Abstain
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Kevin,

If you think the test should work on Android, please try enabling it and look at the failure. Maybe it's a simple problem, but I still get lost in our test infrastructure...

Revision history for this message
Alexandros Frantzis (afrantzis) wrote :

28 -enum { mir_buffer_package_max = 31 };
29 +enum { mir_buffer_package_max = 30 };

Note that this is technically an ABI break too. For example:

memset(pkg.data, 0, mir_buffer_package_max * sizeof(int))

would overwrite 'width' if compiled with the current trunk version, but run with the proposed one.

Although I don't think it affects us in practice, I propose we play it safe and bump the ABIs anyway.

Other than that, looks good.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches