gpu/kms: Allow checking if VRR should be disabled

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1154>
This commit is contained in:
Dor Askayo 2023-06-20 23:06:00 +03:00 committed by Marge Bot
parent b2ceb055d6
commit 9fcc938075
2 changed files with 18 additions and 0 deletions

View File

@ -132,6 +132,23 @@ 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_disable_vrr (MetaGpuKms *gpu_kms)
{
MetaGpu *gpu = META_GPU (gpu_kms);
MetaBackend *backend = meta_gpu_get_backend (gpu);
MetaSettings *settings = meta_backend_get_settings (backend);
MetaKmsDeviceFlag flags;
if (!meta_settings_is_experimental_feature_enabled (
settings,
META_EXPERIMENTAL_FEATURE_VARIABLE_REFRESH_RATE))
return TRUE;
flags = meta_kms_device_get_flags (gpu_kms->kms_device);
return !!(flags & META_KMS_DEVICE_FLAG_DISABLE_VRR);
}
static int static int
compare_outputs (gconstpointer one, compare_outputs (gconstpointer one,
gconstpointer two) gconstpointer two)

View File

@ -44,6 +44,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_disable_vrr (MetaGpuKms *gpu_kms);
MetaKmsDevice * meta_gpu_kms_get_kms_device (MetaGpuKms *gpu_kms); MetaKmsDevice * meta_gpu_kms_get_kms_device (MetaGpuKms *gpu_kms);