Mir

Merge lp:~vanvugt/mir/android-prefer-truecolor into lp:mir

Proposed by Daniel van Vugt
Status: Work in progress
Proposed branch: lp:~vanvugt/mir/android-prefer-truecolor
Merge into: lp:mir
Diff against target: 26 lines (+6/-0)
2 files modified
src/platforms/android/server/gl_context.cpp (+3/-0)
src/platforms/android/server/hwc_blanking_control.cpp (+3/-0)
To merge this branch: bzr merge lp:~vanvugt/mir/android-prefer-truecolor
Reviewer Review Type Date Requested Status
Daniel van Vugt Abstain
Mir CI Bot continuous-integration Needs Fixing
Review via email: mp+296172@code.launchpad.net

Commit message

Android: Prefer the highest colour depth (>= 15 bit) available instead
of defaulting the lowest depth.

If the Android driver follows the EGL spec it will now choose the highest
colour depth. Previously we defaulted to zeros which meant we were asking
for the lowest colour depth. It was only by chance that we supported
devices with buggy EGL implementations before now that didn't follow the
spec and they gave us true colour erroneously.

https://www.khronos.org/registry/egl/sdk/docs/man/html/eglChooseConfig.xhtml
https://en.wikipedia.org/wiki/Color_depth

Description of the change

UNTESTED proof of concept for morphis. Theoretically this can't make the problem any worse at least.

I know it's counter-intuitive but asking for 5 bits is the best way to get 8 bits. Because EGL says that any value greater than zero will give you the maximum colour depth available. And asking for 5 means your code will still work if only high colour is available.

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

FAILED: Continuous integration, rev:3526
https://mir-jenkins.ubuntu.com/job/mir-ci/1062/
Executed test runs:
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-mir/1171/console
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-0-fetch/1219
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/1210
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial/1210
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=vivid+overlay/1181
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=vivid+overlay/1181/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial/1181
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial/1181/artifact/output/*zip*/output.zip
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/1181/console
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/1181/artifact/output/*zip*/output.zip
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/1181/console
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial/1181
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial/1181/artifact/output/*zip*/output.zip

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

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

This is just to demonstrate the idea. Making the tests pass isn't as important as finding out if it solves morphis' problem.

review: Disapprove
Revision history for this message
Daniel van Vugt (vanvugt) :
review: Abstain
Revision history for this message
Simon Fels (morphis) wrote :

I've tested this on Mir 0.22 now but it doesn't solve the problem. Needs more investigation.

Unmerged revisions

3526. By Daniel van Vugt

Proof of concept

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/platforms/android/server/gl_context.cpp'
2--- src/platforms/android/server/gl_context.cpp 2016-03-29 07:30:50 +0000
3+++ src/platforms/android/server/gl_context.cpp 2016-06-01 08:21:11 +0000
4@@ -76,6 +76,9 @@
5 EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT,
6 EGL_DEPTH_SIZE, gl_config.depth_buffer_bits(),
7 EGL_STENCIL_SIZE, gl_config.stencil_buffer_bits(),
8+ EGL_RED_SIZE, 5,
9+ EGL_GREEN_SIZE, 5,
10+ EGL_BLUE_SIZE, 5,
11 EGL_NONE
12 };
13
14
15=== modified file 'src/platforms/android/server/hwc_blanking_control.cpp'
16--- src/platforms/android/server/hwc_blanking_control.cpp 2016-01-29 08:18:22 +0000
17+++ src/platforms/android/server/hwc_blanking_control.cpp 2016-06-01 08:21:11 +0000
18@@ -41,6 +41,9 @@
19 EGL_SURFACE_TYPE, EGL_WINDOW_BIT,
20 EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT,
21 EGL_FRAMEBUFFER_TARGET_ANDROID, EGL_TRUE,
22+ EGL_RED_SIZE, 5,
23+ EGL_GREEN_SIZE, 5,
24+ EGL_BLUE_SIZE, 5,
25 EGL_NONE
26 };
27

Subscribers

People subscribed via source and target branches