onscreen/native: Don't try rendering on a secondary GPU without EGL

We rather confusingly still call a secondary display card that is
GPU-less (DisplayLink or other basic KMS device) a "secondary GPU",
so just because secondary_gpu_state is non-NULL doesn't mean we
can use it for rendering. The clearest indication of this is when
there is no EGL surface.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2341>
This commit is contained in:
Daniel van Vugt 2022-03-18 18:23:29 +08:00 committed by Marge Bot
parent 861c4b8535
commit 41bfabad96

View File

@ -757,6 +757,10 @@ copy_shared_framebuffer_primary_gpu (CoglOnscreen *onscre
COGL_TRACE_BEGIN_SCOPED (CopySharedFramebufferPrimaryGpu,
"FB Copy (primary GPU)");
if (!secondary_gpu_state ||
secondary_gpu_state->egl_surface == EGL_NO_SURFACE)
return FALSE;
primary_gpu = meta_renderer_native_get_primary_gpu (renderer_native);
primary_gpu_data =
meta_renderer_native_get_gpu_data (renderer_native, primary_gpu);