Description of problem: Running Wayland with nvidia binary drivers and maximizing X client window, e.g. Firefox window, results in gnome-shell crash. Wayland clients are fine and it's probably related to EGLStreams. We don't see such a problem with other drivers. Version-Release number of selected component (if applicable): mutter-3.28.3-5.el8 kernel-4.18.0-48.el8 nvidia drivers 410.78 How reproducible: 100% Steps to Reproduce: 1. Disable the gdm udev rule for nvidia 2. enable nvidia modeset 3. Login to session 4. Open Firefox or other X client 5. Maximize the window Actual results: Crash Expected results: No crash Additional info:
Created attachment 1512195 [details] session log Cogl:ERROR:driver/gl/gl/cogl-driver-gl.c:284:_cogl_driver_pixel_format_to_gl_with_target: code should not be reached
Seems to be a problem with reading pixels from the EGLStream texture. Adding diff --git a/cogl/cogl/driver/gl/cogl-texture-2d-gl.c b/cogl/cogl/driver/gl/cogl-texture-2d-gl.c index d1eff4507..53be13216 100644 --- a/cogl/cogl/driver/gl/cogl-texture-2d-gl.c +++ b/cogl/cogl/driver/gl/cogl-texture-2d-gl.c @@ -470,7 +470,12 @@ allocate_custom_egl_image_external (CoglTexture2D *tex_2d, { CoglTexture *tex = COGL_TEXTURE (tex_2d); CoglContext *ctx = tex->context; - CoglPixelFormat internal_format = loader->src.egl_image_external.format; + CoglPixelFormat external_format; + CoglPixelFormat internal_format; + + external_format = loader->src.egl_image_external.format; + internal_format = _cogl_texture_determine_internal_format (tex, + external_format); _cogl_gl_util_clear_gl_errors (ctx); avoids the crash, but the path that is fixed (meta_shaped_texture_get_image()) which provides the pixels used for e.g. maximize animation now results in garbage.
Created attachment 1515580 [details] shaped-texture-get-image-via-offscreen.patch Attaching patch that should fix the issue.
Created attachment 1515623 [details] shaped-texture-get-image-via-offscreen.patch (v2) Attached new version of the patch, as the old one had an issue with subtextures.
Scratch-build repo available here: http://brew-task-repos.usersys.redhat.com/repos/scratch/jadahl/mutter/3.28.3/6.el8/
Created attachment 1515943 [details] shaped-texture-get-image-via-offscreen.patch (v3) After feedback from testers upstream a couple of issues were discovered. Those should be addressed by the latest revision of the patch.
Created attachment 1518939 [details] shaped-texture-get-image-via-offscreen.patch (v4) Updated patch to handle the texture tower failing better.
Created attachment 1520048 [details] shaped-texture-get-image-via-offscreen.patch (v5) Updated patch. The old one was missing a ` = NULL;` in one place.
Verified in mutter-3.28.3-17.el8 kernel-4.18.0-67.el8 NVidia 410.93