mirror of
https://github.com/brl/mutter.git
synced 2024-11-21 23:50:41 -05:00
backend/native: Only disable KMS modifiers for i915
The intel DRM driver is known for not being able to handle multi head setups when KMS modifiers are enabled, due to the implicitly selected modifiers, while being more suitable for single head setups, cause bandwidth issues when a certain number of monitor times resolution and refresh rate is configured. We don't yet support automatically finding a combination of modifiers that work, and have because of this disabled KMS modifiers unless the driver actually needs it. Lets flip this configuration the other way around, changing the current udev rule to decide wen to *disable* KMS modifier support, as it so that only the Intel driver has this problem, while on the other hand, there several drivers that requires modifiers to function at all. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1792>
This commit is contained in:
parent
90e3d9782d
commit
da3baba980
@ -1 +1 @@
|
|||||||
DRIVER=="tegra-host1x", SUBSYSTEM=="platform", TAG+="mutter-device-requires-kms-modifiers"
|
DRIVERS=="i915", SUBSYSTEM=="drm", TAG+="mutter-device-disable-kms-modifiers"
|
||||||
|
@ -423,8 +423,8 @@ create_gpu_from_udev_device (MetaBackendNative *native,
|
|||||||
if (meta_is_udev_device_boot_vga (device))
|
if (meta_is_udev_device_boot_vga (device))
|
||||||
flags |= META_KMS_DEVICE_FLAG_BOOT_VGA;
|
flags |= META_KMS_DEVICE_FLAG_BOOT_VGA;
|
||||||
|
|
||||||
if (meta_is_udev_device_requires_modifiers (device))
|
if (meta_is_udev_device_disable_modifiers (device))
|
||||||
flags |= META_KMS_DEVICE_FLAG_REQUIRES_MODIFIERS;
|
flags |= META_KMS_DEVICE_FLAG_DISABLE_MODIFIERS;
|
||||||
|
|
||||||
if (meta_is_udev_device_preferred_primary (device))
|
if (meta_is_udev_device_preferred_primary (device))
|
||||||
flags |= META_KMS_DEVICE_FLAG_PREFERRED_PRIMARY;
|
flags |= META_KMS_DEVICE_FLAG_PREFERRED_PRIMARY;
|
||||||
|
@ -149,12 +149,12 @@ meta_gpu_kms_is_platform_device (MetaGpuKms *gpu_kms)
|
|||||||
}
|
}
|
||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
meta_gpu_kms_requires_modifiers (MetaGpuKms *gpu_kms)
|
meta_gpu_kms_disable_modifiers (MetaGpuKms *gpu_kms)
|
||||||
{
|
{
|
||||||
MetaKmsDeviceFlag flags;
|
MetaKmsDeviceFlag flags;
|
||||||
|
|
||||||
flags = meta_kms_device_get_flags (gpu_kms->kms_device);
|
flags = meta_kms_device_get_flags (gpu_kms->kms_device);
|
||||||
return !!(flags & META_KMS_DEVICE_FLAG_REQUIRES_MODIFIERS);
|
return !!(flags & META_KMS_DEVICE_FLAG_DISABLE_MODIFIERS);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
|
@ -47,7 +47,7 @@ gboolean meta_gpu_kms_is_crtc_active (MetaGpuKms *gpu_kms,
|
|||||||
|
|
||||||
gboolean meta_gpu_kms_is_boot_vga (MetaGpuKms *gpu_kms);
|
gboolean meta_gpu_kms_is_boot_vga (MetaGpuKms *gpu_kms);
|
||||||
gboolean meta_gpu_kms_is_platform_device (MetaGpuKms *gpu_kms);
|
gboolean meta_gpu_kms_is_platform_device (MetaGpuKms *gpu_kms);
|
||||||
gboolean meta_gpu_kms_requires_modifiers (MetaGpuKms *gpu_kms);
|
gboolean meta_gpu_kms_disable_modifiers (MetaGpuKms *gpu_kms);
|
||||||
|
|
||||||
MetaKmsDevice * meta_gpu_kms_get_kms_device (MetaGpuKms *gpu_kms);
|
MetaKmsDevice * meta_gpu_kms_get_kms_device (MetaGpuKms *gpu_kms);
|
||||||
|
|
||||||
|
@ -59,7 +59,7 @@ typedef enum _MetaKmsDeviceFlag
|
|||||||
META_KMS_DEVICE_FLAG_NONE = 0,
|
META_KMS_DEVICE_FLAG_NONE = 0,
|
||||||
META_KMS_DEVICE_FLAG_BOOT_VGA = 1 << 0,
|
META_KMS_DEVICE_FLAG_BOOT_VGA = 1 << 0,
|
||||||
META_KMS_DEVICE_FLAG_PLATFORM_DEVICE = 1 << 1,
|
META_KMS_DEVICE_FLAG_PLATFORM_DEVICE = 1 << 1,
|
||||||
META_KMS_DEVICE_FLAG_REQUIRES_MODIFIERS = 1 << 2,
|
META_KMS_DEVICE_FLAG_DISABLE_MODIFIERS = 1 << 2,
|
||||||
META_KMS_DEVICE_FLAG_PREFERRED_PRIMARY = 1 << 3,
|
META_KMS_DEVICE_FLAG_PREFERRED_PRIMARY = 1 << 3,
|
||||||
META_KMS_DEVICE_FLAG_NO_MODE_SETTING = 1 << 4,
|
META_KMS_DEVICE_FLAG_NO_MODE_SETTING = 1 << 4,
|
||||||
} MetaKmsDeviceFlag;
|
} MetaKmsDeviceFlag;
|
||||||
|
@ -1984,6 +1984,8 @@ meta_renderer_native_initable_init (GInitable *initable,
|
|||||||
gpus = meta_backend_get_gpus (backend);
|
gpus = meta_backend_get_gpus (backend);
|
||||||
if (gpus)
|
if (gpus)
|
||||||
{
|
{
|
||||||
|
const char *use_kms_modifiers_debug_env;
|
||||||
|
|
||||||
for (l = gpus; l; l = l->next)
|
for (l = gpus; l; l = l->next)
|
||||||
{
|
{
|
||||||
MetaGpuKms *gpu_kms = META_GPU_KMS (l->data);
|
MetaGpuKms *gpu_kms = META_GPU_KMS (l->data);
|
||||||
@ -1998,8 +2000,20 @@ meta_renderer_native_initable_init (GInitable *initable,
|
|||||||
if (!renderer_native->primary_gpu_kms)
|
if (!renderer_native->primary_gpu_kms)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
if (meta_gpu_kms_requires_modifiers (renderer_native->primary_gpu_kms))
|
use_kms_modifiers_debug_env = g_getenv ("MUTTER_DEBUG_USE_KMS_MODIFIERS");
|
||||||
renderer_native->use_modifiers = TRUE;
|
if (use_kms_modifiers_debug_env)
|
||||||
|
{
|
||||||
|
renderer_native->use_modifiers =
|
||||||
|
g_strcmp0 (use_kms_modifiers_debug_env, "1") == 0;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
renderer_native->use_modifiers =
|
||||||
|
!meta_gpu_kms_disable_modifiers (renderer_native->primary_gpu_kms);
|
||||||
|
}
|
||||||
|
|
||||||
|
meta_topic (META_DEBUG_KMS, "Usage of KMS modifiers is %s",
|
||||||
|
renderer_native->use_modifiers ? "enabled" : "disabled");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -75,7 +75,7 @@ meta_is_udev_device_boot_vga (GUdevDevice *device)
|
|||||||
}
|
}
|
||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
meta_is_udev_device_requires_modifiers (GUdevDevice *device)
|
meta_is_udev_device_disable_modifiers (GUdevDevice *device)
|
||||||
{
|
{
|
||||||
g_autoptr (GUdevDevice) platform_device = NULL;
|
g_autoptr (GUdevDevice) platform_device = NULL;
|
||||||
const char * const * tags;
|
const char * const * tags;
|
||||||
@ -92,7 +92,7 @@ meta_is_udev_device_requires_modifiers (GUdevDevice *device)
|
|||||||
if (!tags)
|
if (!tags)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
return g_strv_contains (tags, "mutter-device-requires-kms-modifiers");
|
return g_strv_contains (tags, "mutter-device-disable-kms-modifiers");
|
||||||
}
|
}
|
||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
|
@ -32,7 +32,7 @@ gboolean meta_is_udev_device_platform_device (GUdevDevice *device);
|
|||||||
|
|
||||||
gboolean meta_is_udev_device_boot_vga (GUdevDevice *device);
|
gboolean meta_is_udev_device_boot_vga (GUdevDevice *device);
|
||||||
|
|
||||||
gboolean meta_is_udev_device_requires_modifiers (GUdevDevice *device);
|
gboolean meta_is_udev_device_disable_modifiers (GUdevDevice *device);
|
||||||
|
|
||||||
gboolean meta_is_udev_device_preferred_primary (GUdevDevice *device);
|
gboolean meta_is_udev_device_preferred_primary (GUdevDevice *device);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user