Re: Mesa 17 Wayland EGL changes
Pekka Paalanen <[email protected]>
| Newsgroups | gmane.comp.video.mesa3d.user |
|---|---|
| Message-ID | <20170213164034.05578342@eldfell> |
On Mon, 13 Feb 2017 13:47:05 +0100 Cédric Legrand <[email protected]> wrote: > 2017-02-13 13:13 GMT+01:00 Pekka Paalanen <[email protected]>: > > > On Mon, 13 Feb 2017 12:49:59 +0100 > > Cédric Legrand <[email protected]> wrote: > > > > > 2017-02-13 12:23 GMT+01:00 Pekka Paalanen <[email protected]>: > > > > > > > On Mon, 13 Feb 2017 11:59:01 +0100 > > > > Cédric Legrand <[email protected]> wrote: > > > > > > > > > Hello, > > > > > > > > > > I'm working on a Wayland compositor and the latest Mesa update broke > > my > > > > > work. After investigating, I found that I need to use the > > > > > EGL_WL_wayland_bind_display extension, otherwise my compositor > > crashes > > > > with > > > > > wl_shm reporting an invalid format. I'm not an OpenGL expert, but I > > spent > > > > > the last few days reading documentation, inspecting weston's source > > code > > > > > and googling with no luck. > > > > > > > > > > Question 1: Is it necessary to have the extension? Why don't Mesa > > support > > > > > plain old wl_shm anymore? Unless I missed something, this means we > > can't > > > > > use OpenGL anymore for software rendering in Wayland, am I right? > > > > > > > > Hi, > > > > > > > > that sounds like a new bug in Mesa, but what is this "invalid format" > > > > error you mention? > > > > > > > > > Sorry, I was a little vague on this one. The error is the wl_shm protocol > > > error: > > > -> [email protected](wl_shm_pool@14, 0, "invalid format 0x34325258") > > > > > > I inspected Mesa code and it seems that it is asking for a > > WL_DRM_FORMAT_* > > > buffer, independently from the availability of the wl_drm interface. > > There > > > is no instance of WL_SHM_FORMAT_* in its source code. Of course, without > > > the interface, the server wl_shm knows nothing about these formats and > > > throws the error. > > > > The WL_SHM and WL_DRM formats are identical, except for two very > > unfortunate differences: argb8888 and xrgb8888 - the two formats that > > are required to be supported by the compositor and are most used. > > > > Hence most DRM formats are valid and correct also as wl_shm formats (by > > design), except the ones that are most popular (by historical accident). > > > > My system is using ARGB8888. If I got everything correctly, this means that > Mesa should fallback to WL_SHM_FORMAT_ARGB8888 when wl_drm is not > available, right? Or should the compositor have to support > WL_DRM_FORMAT_[XA]RGB8888 (even if this is implementation specific)? That is a very good question. I am looking at some 12.0 branch of Mesa, and it clearly has: src/egl/drivers/dri2/platform_wayland.c=1245=dri2_wl_swrast_get_stride_for_format(int format, int w) src/egl/drivers/dri2/platform_wayland.c:1247: if (format == WL_SHM_FORMAT_RGB565) src/egl/drivers/dri2/platform_wayland.c=1667=dri2_wl_swrast_create_window_surface(_EGLDriver *drv, _EGLDisplay *disp, src/egl/drivers/dri2/platform_wayland.c:1689: dri2_surf->format = WL_SHM_FORMAT_RGB565; src/egl/drivers/dri2/platform_wayland.c:1691: dri2_surf->format = WL_SHM_FORMAT_XRGB8888; src/egl/drivers/dri2/platform_wayland.c:1693: dri2_surf->format = WL_SHM_FORMAT_ARGB8888; src/egl/drivers/dri2/platform_wayland.c=1735=shm_handle_format(void *data, struct wl_shm *shm, uint32_t format) src/egl/drivers/dri2/platform_wayland.c:1740: case WL_SHM_FORMAT_ARGB8888: src/egl/drivers/dri2/platform_wayland.c:1743: case WL_SHM_FORMAT_XRGB8888: src/egl/drivers/dri2/platform_wayland.c:1746: case WL_SHM_FORMAT_RGB565: OTOH I could not find any code in Weston to handle wl_shm formats 'XR24' (xrgb8888) or 'AR24' (argb8888), so I do not think compositors are expected to handle them without advertising. Commit cb5e799448c959fa9f0d7ea76999ac6f8c0ad88e in Mesa seems to have dropped the format special-casing. I'll put this info also in the bug https://bugs.freedesktop.org/show_bug.cgi?id=99791 you opened. Thanks, pq _______________________________________________ mesa-users mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/mesa-users
signature.asc
(application/pgp-signature, 801 B)
-----BEGIN PGP SIGNATURE----- iQIcBAEBCAAGBQJYocViAAoJECNf5bQRqqqneuQP/2/keKS7GHAglbGxjgZTHaVs FWE3J4EcYyWVekwu3v/ISLA+OE0b3ssZqLGAMKIkyOwCplFPVWOHWfvcr243HiOW Ckw0EoPRGS2ozv7ZBgUtN8gI6tvKvwSw5g079lrbJSH3iVUSua5nheXhaQuSR4Pn BObC/DJdcQqm90S80Dy6ftLJRKmwbDSUOj7XUE6tpAmoNo61gN3yrW4nQOhiE9tG LdA6BhvQ11QJybaVZqwczN7fRdtyVRbSay+RXU2WrvVu0iq8vbeoW2yCuUB+RIfi Bw+ENAryXw0fq/tsiMxiosi1pXblS/W6ITkWw7gUFTSse28/9A69kzJ+Lb2ojqTe IkIsdkbRtba1y1oGF4f6TLIwo0gBZxRZUwFreZW1Get6GTo9RpOAEhUD/7aB0CbH b/48ieXgTTYRJu/8Qn/iQCBZQH4sbipaYMUhyhVVWyGMQ4s7ZQ5pf+TOSDLsnqKW dl4UaWEmVuSny7EA6MlDpHBO5i5ZiCIa6buvKO8vA4qQemqrFhgTidCRfkby7I0U c/wsB1VYBEOtKPGrW5ma/SMswQBnEQ38+8cCFjm6wrKYhT5HvACYA+1V452r0ayO 27PcGh+Ut3mVXaZxnov0NNqM3oOr1w8yxZntJ4uaZoTMsbWQfPco+OCiMs9Oa/uC vtQG4UZ84kRCZ6InhugG =B9Yc -----END PGP SIGNATURE-----