Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mesa-kms fails to initialise on Cosmic #435

Closed
RAOF opened this issue Jun 28, 2018 · 2 comments
Closed

mesa-kms fails to initialise on Cosmic #435

RAOF opened this issue Jun 28, 2018 · 2 comments
Assignees

Comments

@RAOF
Copy link
Contributor

RAOF commented Jun 28, 2018

The mesa-kms platform fails to initialise on 18.10 for me. The relevant error is:

ERROR: /build/mir-Bn3LCJ/mir-0.32.0~rc10-g29f51c4b18/src/platforms/mesa/server/kms/egl_helper.cpp(115): Throw in function void mir::graphics::mesa::helpers::EGLHelper::setup(const mir::graphics::mesa::helpers::GBMHelper&, gbm_surface*, EGLContext)
Dynamic exception type:  boost::exception_detail::clone_impl<boost::exception_detail::error_info_injector<std::system_error> >
std::exception::what: Failed to create EGL window surface: EGL_BAD_MATCH (0x3009)
@RAOF RAOF mentioned this issue Jun 28, 2018
@RAOF RAOF self-assigned this Jun 28, 2018
@RAOF
Copy link
Contributor Author

RAOF commented Jun 28, 2018

Oh, ho! It seems the problem is that Mesa now supports XRGB2101010 as a render target, and as eglChooseConfig selects the largest colour buffer size greater than or equal to what you request, we're now getting it. This then fails to match with the XRGB8888 gbm_surface we're trying to render to…

@RAOF
Copy link
Contributor Author

RAOF commented Jun 28, 2018

So what we probably should do here is what Weston does - rather than ask for a EGLConfig with some bits set and hope that it'll match our GBM format, do a more thorough config selection and explicitly match the GBM format with the visual_id, guaranteeing we get either no matching config or a config that actually matches the GBM format we're using…

RAOF added a commit that referenced this issue Jun 29, 2018
…format.

eglChooseConfig() will select the EGLConfig with *greatest* EGL_{RED,GREEN,BLUE}_SIZE
greater than or equal to the size we request. Since Mesa now supports rendering to
XRGB2101010, this will now pick a 10-bit format - obviously incompatible with the
XRGB8888 gbm_bo we've allocated, resulting in a EGL_BAD_MATCH error.

Instead, iterate over *all* configs which match our requirements and then choose
the first one which has a GBM_FORMAT_XRGB8888 pixel format - this information is
available from the EGL_NATIVE_VISUAL_ID field.

Fixes #435.
bors bot added a commit that referenced this issue Jul 2, 2018
440: mesa-kms: Select EGLConfig matching our GBM format. r=AlanGriffiths a=RAOF

Fixes #435 

Co-authored-by: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com>
@bors bors bot closed this as completed in #440 Jul 2, 2018
bors bot added a commit that referenced this issue Jul 13, 2018
462: Mir release 0.32.1 r=AlanGriffiths a=Saviq

### Enhancements:
- [libmiral] Launcher for internal Wayland clients. (#410)
- [miral-shell] Reinstate the "spinner" when starting miral-shell
  (re-implementing it in Wayland)
### Bugs fixed:
- [mesa-kms] Select EGLConfig matching our GBM format. (#435)
- [Wayland] Don't send output events that are not supported in the agreed
  protocol version. (#389)
- [Wayland] Ensure resize configuration events are not superseded. (#449)

Co-authored-by: Alan Griffiths <alan@octopull.co.uk>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant