Mir

Merge lp:~morphis/mir/force-pixel-format into lp:mir/ubuntu

Proposed by Simon Fels
Status: Work in progress
Proposed branch: lp:~morphis/mir/force-pixel-format
Merge into: lp:mir/ubuntu
Diff against target: 29 lines (+7/-1)
2 files modified
src/platforms/android/server/hwc_blanking_control.cpp (+6/-0)
tests/unit-tests/graphics/android/test_hwc_configuration.cpp (+1/-1)
To merge this branch: bzr merge lp:~morphis/mir/force-pixel-format
Reviewer Review Type Date Requested Status
Daniel van Vugt Needs Fixing
PS Jenkins bot continuous-integration Pending
Review via email: mp+295427@code.launchpad.net

Commit message

Force pixel format to ABGR 8888

We force the pixel format here as detection above goes wrong. Needs propery solution on platforms where EGL_FRAMEBUFFER_TARGET_ANDROID gives us an incorrect pixel format. In this case we got mir_pixel_format_rgb_565 as result where the platform really wants mir_pixel_format_abgr_8888.

Description of the change

NOTE: This is meant to be a temporary ugly ugly hack to get a build with this in a silo. Ignore it completely. We will work with the Mir team on a proper fix for this.

To post a comment you must log in.
Revision history for this message
Rex Tsai (chihchun) wrote :

+1, filed a bug to track the workaround and proper fix.
https://bugs.launchpad.net/tangxi-midori/+bug/1584657

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

Need a proper fix for upstream.

Do not land, obviously.

review: Disapprove
lp:~morphis/mir/force-pixel-format updated
1278. By Simon Fels

Disable failing unit tests (caused by our hack)

Revision history for this message
kevin gunn (kgunn72) wrote :

is it not possible to make this a quirk for tangxi platform specifics - flag/trigger off either gpu or product name

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

This branch probably doesn't resemble the final fix in any way.

The final fix is probably more to do with passing EGL_RED_SIZE/BLUE_SIZE/GREEN_SIZE to eglChooseConfig in:
  src/platforms/android/server/gl_context.cpp
Any value greater than zero should fix it.

Once we do that it's no longer device-specific. Seems to just be a bug in our Android driver that's been there forever, and we got away with because our previous devices' EGL implementations were buggy in similar ways.

It's worth noting that the offending device appears to be the only device that actually follows the EGL spec correctly and defaults to the lower colour depth when those EGL_ values are omitted...
  https://www.khronos.org/registry/egl/sdk/docs/man/html/eglChooseConfig.xhtml

"EGL_RED_SIZE
Must be followed by a nonnegative integer that indicates the desired size of the red component of the color buffer, in bits. If this value is zero, color buffers with the smallest red component size are preferred. Otherwise, color buffers with the largest red component of at least the specified size are preferred. The default value is zero."

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

Tested Daniels fix but doesn't solve the problem.

Revision history for this message
Cemil Azizoglu (cemil-azizoglu) wrote :
Revision history for this message
Kevin DuBois (kdub) wrote :

seems branch is superseded.

Unmerged revisions

1278. By Simon Fels

Disable failing unit tests (caused by our hack)

1277. By Simon Fels

Force correct pixel format until we can properly detect it

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/platforms/android/server/hwc_blanking_control.cpp'
2--- src/platforms/android/server/hwc_blanking_control.cpp 2016-01-29 08:18:22 +0000
3+++ src/platforms/android/server/hwc_blanking_control.cpp 2016-05-23 10:59:25 +0000
4@@ -65,6 +65,12 @@
5 fb_format = mir_pixel_format_abgr_8888;
6 }
7
8+ // HACK: We force the pixel format here as detection above goes wrong. Needs
9+ // propery solution on platforms where EGL_FRAMEBUFFER_TARGET_ANDROID gives
10+ // us an incorrect pixel format. In this case we got mir_pixel_format_rgb_565
11+ // as result where the platform really wants mir_pixel_format_abgr_8888.
12+ fb_format = mir_pixel_format_abgr_8888;
13+
14 eglTerminate(egl_display);
15 return fb_format;
16 }
17
18=== modified file 'tests/unit-tests/graphics/android/test_hwc_configuration.cpp'
19--- tests/unit-tests/graphics/android/test_hwc_configuration.cpp 2015-06-25 03:00:08 +0000
20+++ tests/unit-tests/graphics/android/test_hwc_configuration.cpp 2016-05-23 10:59:25 +0000
21@@ -37,7 +37,7 @@
22 mga::HwcPowerModeControl power_mode_config{mock_hwc_wrapper};
23 };
24
25-TEST_F(HwcConfiguration, fb_format_selection)
26+TEST_F(HwcConfiguration, DISABLED_fb_format_selection)
27 {
28 using namespace testing;
29 Mock::VerifyAndClearExpectations(&mock_egl);

Subscribers

People subscribed via source and target branches