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
=== modified file 'examples/eglapp.c'
--- examples/eglapp.c 2015-07-16 08:13:28 +0000
+++ examples/eglapp.c 2015-08-04 07:36:50 +0000
@@ -346,6 +346,7 @@
346 ok = eglInitialize(egldisplay, NULL, NULL);346 ok = eglInitialize(egldisplay, NULL, NULL);
347 CHECK(ok, "Can't eglInitialize");347 CHECK(ok, "Can't eglInitialize");
348348
349 EGLint alpha_bits = mir_eglapp_background_opacity == 1.0f ? 0 : rgb_bits;
349 const EGLint attribs[] =350 const EGLint attribs[] =
350 {351 {
351 EGL_SURFACE_TYPE, EGL_WINDOW_BIT,352 EGL_SURFACE_TYPE, EGL_WINDOW_BIT,
@@ -354,7 +355,7 @@
354 EGL_RED_SIZE, rgb_bits,355 EGL_RED_SIZE, rgb_bits,
355 EGL_GREEN_SIZE, rgb_bits,356 EGL_GREEN_SIZE, rgb_bits,
356 EGL_BLUE_SIZE, rgb_bits,357 EGL_BLUE_SIZE, rgb_bits,
357 EGL_ALPHA_SIZE, mir_eglapp_background_opacity == 1.0f ? 0 : rgb_bits,358 EGL_ALPHA_SIZE, alpha_bits,
358 EGL_NONE359 EGL_NONE
359 };360 };
360361
@@ -365,7 +366,22 @@
365 MirPixelFormat pixel_format =366 MirPixelFormat pixel_format =
366 mir_connection_get_egl_pixel_format(connection, egldisplay, eglconfig);367 mir_connection_get_egl_pixel_format(connection, egldisplay, eglconfig);
367368
368 printf("Using Mir pixel format %d.\n", pixel_format);369 printf("Mir chose pixel format %d.\n", pixel_format);
370 if (alpha_bits == 0)
371 {
372 /*
373 * If we are opaque then it's OK to switch pixel format slightly,
374 * to enable bypass/overlays to work. Otherwise the presence of an
375 * alpha channel would prevent them from being used.
376 * It would be really nice if Mesa just gave us the right answer in
377 * the first place though. (LP: #1480755)
378 */
379 if (pixel_format == mir_pixel_format_abgr_8888)
380 pixel_format = mir_pixel_format_xbgr_8888;
381 else if (pixel_format == mir_pixel_format_argb_8888)
382 pixel_format = mir_pixel_format_xrgb_8888;
383 }
384 printf("Using pixel format %d.\n", pixel_format);
369385
370 /* eglapps are interested in the screen size, so386 /* eglapps are interested in the screen size, so
371 use mir_connection_create_display_config */387 use mir_connection_create_display_config */

Subscribers

People subscribed via source and target branches