Mir

Merge lp://staging/~kdub/mir/gbm-ext-v2 into lp://staging/mir

Proposed by Kevin DuBois
Status: Merged
Approved by: Daniel van Vugt
Approved revision: no longer in the source branch.
Merged at revision: 4088
Proposed branch: lp://staging/~kdub/mir/gbm-ext-v2
Merge into: lp://staging/mir
Diff against target: 537 lines (+349/-15)
6 files modified
include/client/mir_toolkit/extensions/gbm_buffer.h (+90/-0)
src/platforms/mesa/client/client_buffer.cpp (+8/-4)
src/platforms/mesa/client/client_platform.cpp (+149/-5)
src/platforms/mesa/client/client_platform.h (+2/-1)
src/platforms/mesa/include/native_buffer.h (+3/-0)
tests/unit-tests/platforms/mesa/client/test_client_platform.cpp (+97/-5)
To merge this branch: bzr merge lp://staging/~kdub/mir/gbm-ext-v2
Reviewer Review Type Date Requested Status
Andreas Pokorny (community) Approve
Alan Griffiths Approve
Daniel van Vugt Needs Fixing
Mir CI Bot continuous-integration Approve
Chris Halse Rogers Approve
Cemil Azizoglu (community) Approve
Review via email: mp+317620@code.staging.launchpad.net

Commit message

add MirExtensionGbmBufferV2, which adds functions that help a GBM buffer import in the mesa driver. This prepares mir_buffer_get_buffer_packgae (and MirBufferPackage) for deprecation.

Integrated with the 'rs' platform (in the current naming) Mesa patch on the ML.

Description of the change

add MirExtensionGbmBufferV2, which adds functions that help a GBM buffer import in the mesa driver. This prepares mir_buffer_get_buffer_packgae (and MirBufferPackage) for deprecation.

Integrated with the 'rs' platform (in the current naming) Mesa patch on the ML.

Also, spent some time considering whether the extension should just return a gbm_bo*. This was a bit disadvantageous, because we'd have to link the mesa client plugin to gbm (which it currently doesn't need), and we would need a fair amount of plumbing work to get a gbm_device on the client side.

To post a comment you must log in.
Revision history for this message
Mir CI Bot (mir-ci-bot) wrote :

FAILED: Continuous integration, rev:4039
https://mir-jenkins.ubuntu.com/job/mir-ci/3013/
Executed test runs:
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-mir/4023/console
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-0-fetch/4110
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/4100
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial+overlay/4100
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=zesty/4100
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=zesty/4050
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=zesty/4050/artifact/output/*zip*/output.zip
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial+overlay/4050/console
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=zesty/4050
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=zesty/4050/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/4050
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/4050/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/4050
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/4050/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial+overlay/4050
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial+overlay/4050/artifact/output/*zip*/output.zip

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

review: Needs Fixing (continuous-integration)
Revision history for this message
Cemil Azizoglu (cemil-azizoglu) wrote :

Looks good. Some minor typos.

return comment is wrong.

41 +/** Access the import fd a MirBuffer
42 + * \pre The buffer is suitable for GBM_BO_IMPORT_FD
43 + * \warning The fd is owned by the buffer. Do not close() it.
44 + * \param [in] buffer The buffer
45 + * \return The stride of the buffer
46 + */
47 +typedef int (*MirBufferExtFd)(MirBuffer* buffer);
---------------------------------------------------------------
s/Check/Get

49 +/** Check the stride of a MirBuffer
50 + * \pre The buffer is suitable for GBM_BO_IMPORT_FD
51 + * \param [in] buffer The buffer
52 + * \return The stride of the buffer
53 + */
54 +typedef uint32_t (*MirBufferExtStride)(MirBuffer* buffer);

56 +/** Check the GBM_FORMAT of a MirBuffer
57 + * \pre The buffer is suitable for GBM_BO_IMPORT_FD
58 + * \param [in] buffer The buffer
59 + * \return The GBM_FORMAT of the buffer
60 + */
61 +typedef uint32_t (*MirBufferExtFormat)(MirBuffer* buffer);
-----------------------------------------------------------------------------
s/Check the gbm_bo_flags/Get buffer's age

70 +/** Check the gbm_bo_flags of a MirBuffer
71 + * \pre The buffer is suitable for GBM_BO_IMPORT_FD
72 + * \param [in] buffer The buffer
73 + * \return The age of the buffer
74 + */
75 +typedef uint64_t (*MirBufferExtAge)(MirBuffer* buffer);
76

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

PASSED: Continuous integration, rev:4041
https://mir-jenkins.ubuntu.com/job/mir-ci/3017/
Executed test runs:
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-mir/4029
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-0-fetch/4116
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/4106
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial+overlay/4106
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=zesty/4106
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=zesty/4056
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=zesty/4056/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial+overlay/4056
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial+overlay/4056/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=zesty/4056
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=zesty/4056/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/4056
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/4056/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/4056
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/4056/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial+overlay/4056
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial+overlay/4056/artifact/output/*zip*/output.zip

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

review: Approve (continuous-integration)
Revision history for this message
Cemil Azizoglu (cemil-azizoglu) wrote :

lgtm

review: Approve
Revision history for this message
Chris Halse Rogers (raof) wrote :

This:
- gbm_buffer{allocate_buffer_gbm},
+ gbm_buffer1{allocate_buffer_gbm},
+ gbm_buffer2{allocate_buffer_gbm, allocate_buffer_gbm_sync,
+ is_gbm_importable, import_fd, buffer_stride, buffer_format, buffer_flags, buffer_age},

is unnecessary; just change the type of gbm_buffer to MirExtensionGbmBufferV2.

Likewise,

     if (!strcmp(extension_name, "mir_extension_gbm_buffer") && (version == 1))
- return &gbm_buffer;
+ return &gbm_buffer1;
+ if (!strcmp(extension_name, "mir_extension_gbm_buffer") && (version == 2))
+ return &gbm_buffer2;

Is unnecessary; just check for version <= 2, and return gbm_buffer.

Otherwise looks good!

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

good point, changing code accordingly

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

FAILED: Continuous integration, rev:4043
https://mir-jenkins.ubuntu.com/job/mir-ci/3042/
Executed test runs:
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-mir/4066/console
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-0-fetch/4153
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/4143
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial+overlay/4143
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=zesty/4143
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=zesty/4093
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=zesty/4093/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial+overlay/4093
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial+overlay/4093/artifact/output/*zip*/output.zip
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=zesty/4093/console
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/4093
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/4093/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/4093
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/4093/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial+overlay/4093
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial+overlay/4093/artifact/output/*zip*/output.zip

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

review: Needs Fixing (continuous-integration)
Revision history for this message
Chris Halse Rogers (raof) wrote :

(Non-blocking)
+}
+catch (...)
+{
+ return INT64_MAX;
+}

Probably (slightly) safer to return 0 here - 0 means the contents are undefined, so the client will have to do more work but is guaranteed to render correctly.

Also, uint64_t? This is almost always going to have a range of 0-3, and cannot possibly go beyond the tens of thousands (buffers will be on the order of megabytes, we're definitely not going to give a client > 10GB of VRAM just for window buffers!)

Is there a reason you picked uint64_t rather than uint32_t?

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

I agree with the above nit. It's a count of frames so even to exceed uint32 on a 60Hz display will take 2.2 years. A client would have to remember what it rendered 2.2 years ago. So 32-bits is plenty and we also don't need an explicit bit size. Just make it "unsigned int".

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

PASSED: Continuous integration, rev:4045
https://mir-jenkins.ubuntu.com/job/mir-ci/3103/
Executed test runs:
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-mir/4161
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-0-fetch/4248
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/4238
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial+overlay/4238
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=zesty/4238
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=zesty/4188
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=zesty/4188/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial+overlay/4188
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial+overlay/4188/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=zesty/4188
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=zesty/4188/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/4188
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/4188/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/4188
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/4188/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial+overlay/4188
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial+overlay/4188/artifact/output/*zip*/output.zip

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

review: Approve (continuous-integration)
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Still seems like we're playing fast and loose with integer types:
  * age is uint32 but never needs to be anything larger than a uint.
  * width and height are 'int' but gbm.h uses uint32_t for them.

Please consider:
  (1) Removing the "32" from MirBufferExtAge unless the implementation is explicitly limited to 32-bits.
  (2) Converting width and height from int to uint32_t (since that's what gbm.h uses?).

We've all been guilty of choosing wrong integer types in the past, but if we're in the business of redesigning existing interfaces then at least the new design should be more correct.

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

(3) Shouldn't format and flags be uint32 too?

struct gbm_bo *
gbm_bo_create(struct gbm_device *gbm,
              uint32_t width, uint32_t height,
              uint32_t format, uint32_t flags);

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

(4) Does MirConnectionAllocateBufferGbmSync need to exist? Is that a better design than providing a function that can just import a struct gbm_bo? (using gbm_bo_get_fd to send it to the server?)

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

Oh you answered (4) in the description, sorry.

Just (1)-(3) then please.

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

PASSED: Continuous integration, rev:4047
https://mir-jenkins.ubuntu.com/job/mir-ci/3116/
Executed test runs:
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-mir/4180
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-0-fetch/4267
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/4257
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial+overlay/4257
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=zesty/4257
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=zesty/4207
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=zesty/4207/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial+overlay/4207
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial+overlay/4207/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=zesty/4207
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=zesty/4207/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/4207
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/4207/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/4207
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/4207/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial+overlay/4207
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial+overlay/4207/artifact/output/*zip*/output.zip

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

review: Approve (continuous-integration)
Revision history for this message
Kevin DuBois (kdub) wrote :

sure, fixed. In fixing the signature of the async buffer allocation function, had to go back to having 2 structs as extensions here.

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

(5) A bunch of these functions take MirBuffer as an 'in' parameter only so should take const pointers, no?
   typedef uint32_t (*MirBufferExtFormat)(MirBuffer* buffer);

(6) Given the header is GBM-specific, is it a good idea to define callback types that are not GBM-specific in name inside it?

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

5) ideally, but not done in other similar situations so I'd rather just leave as-is.
6) sure, (guessing you mean MirBufferExtFd should be MirBufferGbmFd, functions aren't callbacks)

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

PASSED: Continuous integration, rev:4049
https://mir-jenkins.ubuntu.com/job/mir-ci/3129/
Executed test runs:
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-mir/4201
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-0-fetch/4288
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/4278
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial+overlay/4278
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=zesty/4278
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=zesty/4228
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=zesty/4228/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial+overlay/4228
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial+overlay/4228/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=zesty/4228
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=zesty/4228/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/4228
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/4228/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/4228
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/4228/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial+overlay/4228
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial+overlay/4228/artifact/output/*zip*/output.zip

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

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

PASSED: Continuous integration, rev:4050
https://mir-jenkins.ubuntu.com/job/mir-ci/3131/
Executed test runs:
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-mir/4203
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-0-fetch/4290
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/4280
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial+overlay/4280
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=zesty/4280
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=zesty/4230
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=zesty/4230/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial+overlay/4230
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial+overlay/4230/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=zesty/4230
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=zesty/4230/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/4230
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/4230/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/4230
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/4230/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial+overlay/4230
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial+overlay/4230/artifact/output/*zip*/output.zip

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

review: Approve (continuous-integration)
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

(5) I would ignore other extensions as prior art. Those haven't been around as long as the rest of the project where we do use "const" more correctly, so should use const correctly (at least on parameters).

(6) The new naming convention sounds confusing and looks weakly typed:
   typedef uint32_t (*MirBufferGbmStride)(MirBuffer* buffer);
What if 'buffer' is not a GBM buffer?

I'm starting to think that the client producing its own gbm_bo might be the right answer. We would have fewer functions, less confusion and stronger typing. Admittedly with some additional linkage and the client would need to specify a gbm_device. But maybe that's a good thing in a multi-GPU world. I also wonder how this plays with RAOF's multi-GPU work in progress...

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

(7) I should have picked a different function in (6) because I have another question...
  typedef uint32_t (*MirBufferGbmStride)(MirBuffer* buffer);
Why isn't there a generic mir_buffer_get_stride() function already?

(8) Does it make sense for a buffer's age to be queried without any context?;
  typedef unsigned int (*MirBufferGbmAge)(MirBuffer* buffer)
You may be using a buffer in two or more different rendering contexts so it can have a different age for each. I don't think MirBufferGbmAge() makes sense.

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

(8) I forgot 'age' is relative to the producer (singular) and not its consumers, so it makes a little bit of sense. Although I'm not 100% convinced that age should ever be an attribute 'of' or internal to a MirBuffer. It's really an external attribute that emerges from the swapping logic, and is only associated with a buffer in the local producer context.

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

5) If we add const to this extension, we have some MirBuffer-related functions that have const and others that don't. This seems worse (in terms of update cost or mismatched signatures) than leaving as-is.
6) It is a precondition that the MirBuffer is a a GBM buffer. Stronger typing would get us in trouble with how the buffers get submitted.
7) Stride for buffer was rejected. https://code.launchpad.net/~kdub/mir/mir-buffer-get-stride/+merge/303135
8) Sounds like its alright as it is then? The mesa driver makes use of it now, if the mesa driver implements that logic, it can go away.

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

I'm not convinced (5) and (8) are adequately resolved.

(5) If we make a plan to fix lack of const in 'MirBuffer *' everywhere soon, then OK. If you can change it to "const" in the below diff right now without breaking existing code then please do it before this lands.

(8) Similarly if we can cull that function and existing code still works, please do so. I'm not convinced we have the right design for handling 'age'. It's also not an important feature -- both uses of buffer age in toolkits I've ever seen were buggy and had to avoid it in the end.

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

(6) is also unconvincing. We shouldn't be designing new APIs that accept MirBuffer* yet implicitly only work on GBM buffers. This would be resolved by forcing the client side to provide gbm_bo. If the extension is for "GBM" then it's perfectly reasonable that users of it will link to GBM and be using gbm.h. If however you can get away with abstracting out gbm.h entirely as you have, then in theory we can get away from calling anything in it "GBM". It should therefore either be a more abstract interface (not mention "GBM" at all) or less abstract interface and use gbm_bo directly.

I feel this GBM v2 extension will soon need to be deprecated and replaced by a v3. However I also don't have sufficient interest in this area of code to stand in the way. Rapid deprecation and redesigns might be the fastest way forward. If any reviewer disagrees with my comments then go ahead and land it...

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

5) We agree that const* would have been better, but I don't intend to fix it in this MP, as it needs updating elsewhere. I can follow up with an MP that updates everything. (I don't think adding const to the parameter breaks abi or api).
6) Linking to gbm is prohibitive in terms of the existing code. We would not only have to link to the gbm library, but plumb through fds to get the gbm device initialized. Also, the gbm initialization is currently in the mir/rs egl driver, and its not the intention of this MP to change that. The intention is to deprecate MirBufferPackage.
8) It is used to get the egl driver working, so it cannot be culled at this time, unless logic is moved (much the same story as linking to gbm).

I don't mind if we follow up with a v3, and we will have to anyways in the mid-near future when we add gbm buffer import (https://trello.com/c/Me7H4Evr).

The goal here is to get rid of MirBufferPackage before the next upload to our mesa driver.

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

OK

review: Approve
Revision history for this message
Andreas Pokorny (andreas-pokorny) wrote :

ok

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