diff --git a/src/backends/native/meta-gpu-kms.c b/src/backends/native/meta-gpu-kms.c index 97b47f9f9..84ea6baa2 100644 --- a/src/backends/native/meta-gpu-kms.c +++ b/src/backends/native/meta-gpu-kms.c @@ -134,15 +134,6 @@ meta_gpu_kms_is_platform_device (MetaGpuKms *gpu_kms) return !!(flags & META_KMS_DEVICE_FLAG_PLATFORM_DEVICE); } -gboolean -meta_gpu_kms_disable_modifiers (MetaGpuKms *gpu_kms) -{ - MetaKmsDeviceFlag flags; - - flags = meta_kms_device_get_flags (gpu_kms->kms_device); - return !!(flags & META_KMS_DEVICE_FLAG_DISABLE_MODIFIERS); -} - static int compare_outputs (gconstpointer one, gconstpointer two) diff --git a/src/backends/native/meta-gpu-kms.h b/src/backends/native/meta-gpu-kms.h index e6f8b3e87..7a890c845 100644 --- a/src/backends/native/meta-gpu-kms.h +++ b/src/backends/native/meta-gpu-kms.h @@ -47,7 +47,6 @@ 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_platform_device (MetaGpuKms *gpu_kms); -gboolean meta_gpu_kms_disable_modifiers (MetaGpuKms *gpu_kms); MetaKmsDevice * meta_gpu_kms_get_kms_device (MetaGpuKms *gpu_kms); diff --git a/src/backends/native/meta-kms-device.c b/src/backends/native/meta-kms-device.c index afc264dfe..15ae92a26 100644 --- a/src/backends/native/meta-kms-device.c +++ b/src/backends/native/meta-kms-device.c @@ -550,8 +550,8 @@ meta_kms_device_new (MetaKms *kms, free (device->path); device->path = data.out_path; - if (!device->caps.addfb2_modifiers) - device->flags |= META_KMS_DEVICE_FLAG_DISABLE_MODIFIERS; + if (device->caps.addfb2_modifiers) + device->flags |= META_KMS_DEVICE_FLAG_HAS_ADDFB2; return device; } diff --git a/src/backends/native/meta-kms-types.h b/src/backends/native/meta-kms-types.h index 37595c612..a2e2f8ded 100644 --- a/src/backends/native/meta-kms-types.h +++ b/src/backends/native/meta-kms-types.h @@ -62,6 +62,7 @@ typedef enum _MetaKmsDeviceFlag META_KMS_DEVICE_FLAG_DISABLE_MODIFIERS = 1 << 2, META_KMS_DEVICE_FLAG_PREFERRED_PRIMARY = 1 << 3, META_KMS_DEVICE_FLAG_NO_MODE_SETTING = 1 << 4, + META_KMS_DEVICE_FLAG_HAS_ADDFB2 = 1 << 5, } MetaKmsDeviceFlag; typedef enum _MetaKmsResourceChanges diff --git a/src/backends/native/meta-renderer-native.c b/src/backends/native/meta-renderer-native.c index f5f22c7b1..76169d510 100644 --- a/src/backends/native/meta-renderer-native.c +++ b/src/backends/native/meta-renderer-native.c @@ -2125,8 +2125,14 @@ meta_renderer_native_initable_init (GInitable *initable, } else { + MetaKmsDevice *kms_device = + meta_gpu_kms_get_kms_device (renderer_native->primary_gpu_kms); + MetaKmsDeviceFlag flags; + + flags = meta_kms_device_get_flags (kms_device); renderer_native->use_modifiers = - !meta_gpu_kms_disable_modifiers (renderer_native->primary_gpu_kms); + !(flags & META_KMS_DEVICE_FLAG_DISABLE_MODIFIERS) && + flags & META_KMS_DEVICE_FLAG_HAS_ADDFB2; } meta_topic (META_DEBUG_KMS, "Usage of KMS modifiers is %s",