mirror of
https://github.com/brl/mutter.git
synced 2024-11-10 07:56:14 -05:00
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:
parent
7d822459de
commit
6c0440697d
@ -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 */
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user