Mir

Merge lp:~vanvugt/mir/fix-1480755 into lp:mir

Proposed by Daniel van Vugt
Status: Merged
Approved by: Daniel van Vugt
Approved revision: no longer in the source branch.
Merged at revision: 2813
Proposed branch: lp:~vanvugt/mir/fix-1480755
Merge into: lp:mir
Diff against target: 44 lines (+18/-2)
1 file modified
examples/eglapp.c (+18/-2)
To merge this branch: bzr merge lp:~vanvugt/mir/fix-1480755
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve
Alan Griffiths Approve
Chris Halse Rogers Approve
Kevin DuBois (community) Approve
Review via email: mp+266838@code.launchpad.net

Commit message

Just fix the EGL demos to get back support for bypass/overlays.
(LP: #1480755)

Description of the change

We're getting sub-optimal pixel formats from the new function designed to choose the right one for you. Unfortunately that's not the root of the problem. The root of the problem is Mesa failing to return all the visuals it is capable of. RAOF says he thinks it's feasible to fix Mesa, and that sounds like the right fix to aim for, eventually.

In the mean time a simple workaround for Mir's demo clients achieves the same thing.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Kevin DuBois (kdub) wrote :

lgtm for a workaround until the mesa fix is in

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

Sure

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

(CI failure should be fixed on trunk, so TAing)

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

Fetched 10.9 MB in 21s (514 kB/s)
E: Failed to fetch http://ports.ubuntu.com/ubuntu-ports/pool/universe/g/gcc-4.8/gcc-4.8-base_4.8.4-3ubuntu1_armhf.deb Temporary failure resolving 'ports.ubuntu.com'

review: Approve
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
1=== modified file 'examples/eglapp.c'
2--- examples/eglapp.c 2015-07-16 08:13:28 +0000
3+++ examples/eglapp.c 2015-08-04 07:36:50 +0000
4@@ -346,6 +346,7 @@
5 ok = eglInitialize(egldisplay, NULL, NULL);
6 CHECK(ok, "Can't eglInitialize");
7
8+ EGLint alpha_bits = mir_eglapp_background_opacity == 1.0f ? 0 : rgb_bits;
9 const EGLint attribs[] =
10 {
11 EGL_SURFACE_TYPE, EGL_WINDOW_BIT,
12@@ -354,7 +355,7 @@
13 EGL_RED_SIZE, rgb_bits,
14 EGL_GREEN_SIZE, rgb_bits,
15 EGL_BLUE_SIZE, rgb_bits,
16- EGL_ALPHA_SIZE, mir_eglapp_background_opacity == 1.0f ? 0 : rgb_bits,
17+ EGL_ALPHA_SIZE, alpha_bits,
18 EGL_NONE
19 };
20
21@@ -365,7 +366,22 @@
22 MirPixelFormat pixel_format =
23 mir_connection_get_egl_pixel_format(connection, egldisplay, eglconfig);
24
25- printf("Using Mir pixel format %d.\n", pixel_format);
26+ printf("Mir chose pixel format %d.\n", pixel_format);
27+ if (alpha_bits == 0)
28+ {
29+ /*
30+ * If we are opaque then it's OK to switch pixel format slightly,
31+ * to enable bypass/overlays to work. Otherwise the presence of an
32+ * alpha channel would prevent them from being used.
33+ * It would be really nice if Mesa just gave us the right answer in
34+ * the first place though. (LP: #1480755)
35+ */
36+ if (pixel_format == mir_pixel_format_abgr_8888)
37+ pixel_format = mir_pixel_format_xbgr_8888;
38+ else if (pixel_format == mir_pixel_format_argb_8888)
39+ pixel_format = mir_pixel_format_xrgb_8888;
40+ }
41+ printf("Using pixel format %d.\n", pixel_format);
42
43 /* eglapps are interested in the screen size, so
44 use mir_connection_create_display_config */

Subscribers

People subscribed via source and target branches