mirror of
https://github.com/brl/mutter.git
synced 2024-11-21 23:50:41 -05:00
backends: force enable modifiers on tagged devices
Some devices can't scanout to linear buffers directly as the hw is not capable of eg rendering into a linear depth buffer. Add code to force kms-modifiers on udev taged devices. Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/1408 https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1443
This commit is contained in:
parent
82fffacbae
commit
9b9b912765
1
data/61-mutter.rules
Normal file
1
data/61-mutter.rules
Normal file
@ -0,0 +1 @@
|
|||||||
|
DRIVER=="tegra-host1x", SUBSYSTEM=="platform", TAG+="mutter-device-requires-kms-modifiers"
|
@ -58,3 +58,9 @@ configure_file(
|
|||||||
install_data(['mutter-schemas.convert'],
|
install_data(['mutter-schemas.convert'],
|
||||||
install_dir: join_paths(datadir, 'GConf/gsettings'),
|
install_dir: join_paths(datadir, 'GConf/gsettings'),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if have_libgudev
|
||||||
|
install_data(['61-mutter.rules'],
|
||||||
|
install_dir: join_paths(udevdir, 'rules.d'),
|
||||||
|
)
|
||||||
|
endif
|
||||||
|
@ -182,6 +182,8 @@ have_libgudev = get_option('udev')
|
|||||||
if have_libgudev
|
if have_libgudev
|
||||||
libudev_dep = dependency('libudev', version: udev_req)
|
libudev_dep = dependency('libudev', version: udev_req)
|
||||||
gudev_dep = dependency('gudev-1.0', version: gudev_req)
|
gudev_dep = dependency('gudev-1.0', version: gudev_req)
|
||||||
|
udev_dep = dependency('udev')
|
||||||
|
udevdir = udev_dep.get_pkgconfig_variable('udevdir')
|
||||||
endif
|
endif
|
||||||
|
|
||||||
have_native_backend = get_option('native_backend')
|
have_native_backend = get_option('native_backend')
|
||||||
|
@ -571,6 +571,9 @@ 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))
|
||||||
|
flags |= META_KMS_DEVICE_FLAG_REQUIRES_MODIFIERS;
|
||||||
|
|
||||||
device_path = g_udev_device_get_device_file (device);
|
device_path = g_udev_device_get_device_file (device);
|
||||||
|
|
||||||
kms_device = meta_kms_create_device (native->kms, device_path, flags,
|
kms_device = meta_kms_create_device (native->kms, device_path, flags,
|
||||||
|
@ -266,6 +266,15 @@ meta_gpu_kms_is_platform_device (MetaGpuKms *gpu_kms)
|
|||||||
return !!(flags & META_KMS_DEVICE_FLAG_PLATFORM_DEVICE);
|
return !!(flags & META_KMS_DEVICE_FLAG_PLATFORM_DEVICE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
gboolean
|
||||||
|
meta_gpu_kms_requires_modifiers (MetaGpuKms *gpu_kms)
|
||||||
|
{
|
||||||
|
MetaKmsDeviceFlag flags;
|
||||||
|
|
||||||
|
flags = meta_kms_device_get_flags (gpu_kms->kms_device);
|
||||||
|
return !!(flags & META_KMS_DEVICE_FLAG_REQUIRES_MODIFIERS);
|
||||||
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
compare_outputs (gconstpointer one,
|
compare_outputs (gconstpointer one,
|
||||||
gconstpointer two)
|
gconstpointer two)
|
||||||
|
@ -47,6 +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);
|
||||||
|
|
||||||
MetaKmsDevice * meta_gpu_kms_get_kms_device (MetaGpuKms *gpu_kms);
|
MetaKmsDevice * meta_gpu_kms_get_kms_device (MetaGpuKms *gpu_kms);
|
||||||
|
|
||||||
|
@ -56,6 +56,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,
|
||||||
} MetaKmsDeviceFlag;
|
} MetaKmsDeviceFlag;
|
||||||
|
|
||||||
typedef enum _MetaKmsPlaneType MetaKmsPlaneType;
|
typedef enum _MetaKmsPlaneType MetaKmsPlaneType;
|
||||||
|
@ -320,6 +320,12 @@ meta_renderer_native_get_egl (MetaRendererNative *renderer_native)
|
|||||||
return meta_backend_get_egl (meta_renderer_get_backend (renderer));
|
return meta_backend_get_egl (meta_renderer_get_backend (renderer));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
gboolean
|
||||||
|
meta_renderer_native_use_modifiers (MetaRendererNative *renderer_native)
|
||||||
|
{
|
||||||
|
return renderer_native->use_modifiers;
|
||||||
|
}
|
||||||
|
|
||||||
static MetaEgl *
|
static MetaEgl *
|
||||||
meta_onscreen_native_get_egl (MetaOnscreenNative *onscreen_native)
|
meta_onscreen_native_get_egl (MetaOnscreenNative *onscreen_native)
|
||||||
{
|
{
|
||||||
@ -3804,6 +3810,9 @@ 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))
|
||||||
|
renderer_native->use_modifiers = TRUE;
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -55,6 +55,8 @@ MetaGpuKms * meta_renderer_native_get_primary_gpu (MetaRendererNative *renderer_
|
|||||||
|
|
||||||
void meta_renderer_native_finish_frame (MetaRendererNative *renderer_native);
|
void meta_renderer_native_finish_frame (MetaRendererNative *renderer_native);
|
||||||
|
|
||||||
|
gboolean meta_renderer_native_use_modifiers (MetaRendererNative *renderer_native);
|
||||||
|
|
||||||
gboolean meta_onscreen_native_is_buffer_scanout_compatible (CoglOnscreen *onscreen,
|
gboolean meta_onscreen_native_is_buffer_scanout_compatible (CoglOnscreen *onscreen,
|
||||||
uint32_t drm_format,
|
uint32_t drm_format,
|
||||||
uint64_t drm_modifier,
|
uint64_t drm_modifier,
|
||||||
|
@ -74,6 +74,27 @@ meta_is_udev_device_boot_vga (GUdevDevice *device)
|
|||||||
return g_udev_device_get_sysfs_attr_as_int (pci_device, "boot_vga") == 1;
|
return g_udev_device_get_sysfs_attr_as_int (pci_device, "boot_vga") == 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
gboolean
|
||||||
|
meta_is_udev_device_requires_modifiers (GUdevDevice *device)
|
||||||
|
{
|
||||||
|
g_autoptr (GUdevDevice) platform_device = NULL;
|
||||||
|
const char * const * tags;
|
||||||
|
|
||||||
|
platform_device = g_udev_device_get_parent_with_subsystem (device,
|
||||||
|
"platform",
|
||||||
|
NULL);
|
||||||
|
|
||||||
|
if (!platform_device)
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
tags = g_udev_device_get_tags (platform_device);
|
||||||
|
|
||||||
|
if (!tags)
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
return g_strv_contains (tags, "mutter-device-requires-kms-modifiers");
|
||||||
|
}
|
||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
meta_udev_is_drm_device (MetaUdev *udev,
|
meta_udev_is_drm_device (MetaUdev *udev,
|
||||||
GUdevDevice *device)
|
GUdevDevice *device)
|
||||||
|
@ -32,6 +32,8 @@ 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_udev_is_drm_device (MetaUdev *udev,
|
gboolean meta_udev_is_drm_device (MetaUdev *udev,
|
||||||
GUdevDevice *device);
|
GUdevDevice *device);
|
||||||
|
|
||||||
|
@ -594,6 +594,15 @@ should_send_modifiers (MetaBackend *backend)
|
|||||||
{
|
{
|
||||||
MetaSettings *settings = meta_backend_get_settings (backend);
|
MetaSettings *settings = meta_backend_get_settings (backend);
|
||||||
|
|
||||||
|
#ifdef HAVE_NATIVE_BACKEND
|
||||||
|
if (META_IS_BACKEND_NATIVE (backend))
|
||||||
|
{
|
||||||
|
MetaRenderer *renderer = meta_backend_get_renderer (backend);
|
||||||
|
MetaRendererNative *renderer_native = META_RENDERER_NATIVE (renderer);
|
||||||
|
return meta_renderer_native_use_modifiers (renderer_native);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
return meta_settings_is_experimental_feature_enabled (
|
return meta_settings_is_experimental_feature_enabled (
|
||||||
settings, META_EXPERIMENTAL_FEATURE_KMS_MODIFIERS);
|
settings, META_EXPERIMENTAL_FEATURE_KMS_MODIFIERS);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user