screen-cast: Enable DMA buffers only for i915

Seems DMA buffer based interprocess buffer sharing is more broken than
not, so for now only enable it when using the i915 driver.

For example vmwgfx, qxl and radeon, it results in mmap() failing to mmap the
memory region. Other drivers, e.g. amdgpu will function, but may hit
very slow memory download paths, resulting in worse performance.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1442
This commit is contained in:
Jonas Ådahl 2020-09-14 11:36:25 +02:00 committed by Georges Basile Stavracas Neto
parent 7d822459de
commit 6c0440697d

View File

@ -349,12 +349,12 @@ maybe_disable_screen_cast_dma_bufs (MetaBackendNative *native)
MetaBackend *backend = META_BACKEND (native);
MetaRenderer *renderer = meta_backend_get_renderer (backend);
MetaRendererNative *renderer_native = META_RENDERER_NATIVE (renderer);
MetaScreenCast *screen_cast = meta_backend_get_screen_cast (backend);
MetaGpuKms *primary_gpu;
MetaKmsDevice *kms_device;
const char *driver_name;
static const char *disable_dma_buf_drivers[] = {
"qxl",
"vmwgfx",
static const char *enable_dma_buf_drivers[] = {
"i915",
NULL,
};
@ -362,16 +362,13 @@ maybe_disable_screen_cast_dma_bufs (MetaBackendNative *native)
kms_device = meta_gpu_kms_get_kms_device (primary_gpu);
driver_name = meta_kms_device_get_driver_name (kms_device);
if (g_strv_contains (disable_dma_buf_drivers, driver_name))
{
MetaScreenCast *screen_cast = meta_backend_get_screen_cast (backend);
if (g_strv_contains (enable_dma_buf_drivers, driver_name))
return;
g_message ("The '%s' driver doesn't support DMA buffer screen sharing, disabling.",
driver_name);
g_message ("Disabling DMA buffer screen sharing for driver '%s'.",
driver_name);
meta_screen_cast_disable_dma_bufs (screen_cast);
return;
}
meta_screen_cast_disable_dma_bufs (screen_cast);
}
#endif /* HAVE_REMOTE_DESKTOP */