output: Add meta_output_info_get_min_refresh_rate()

This function gets the minimum refresh rate of an output if it was
found in EDID.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3576>
This commit is contained in:
Dor Askayo 2024-02-11 02:17:46 +02:00 committed by Marge Bot
parent a96d524503
commit cb40a1c510
2 changed files with 22 additions and 0 deletions

View File

@ -509,6 +509,25 @@ meta_output_set_privacy_screen_enabled (MetaOutput *output,
return TRUE;
}
gboolean
meta_output_info_get_min_refresh_rate (const MetaOutputInfo *output_info,
int *min_refresh_rate)
{
int min_vert_rate_hz;
if (!output_info->edid_info)
return FALSE;
min_vert_rate_hz = output_info->edid_info->min_vert_rate_hz;
if (min_vert_rate_hz <= 0)
return FALSE;
*min_refresh_rate = min_vert_rate_hz;
return TRUE;
}
void
meta_output_set_color_space (MetaOutput *output,
MetaOutputColorspace color_space)

View File

@ -195,6 +195,9 @@ META_EXPORT_TEST
void meta_output_info_parse_edid (MetaOutputInfo *output_info,
GBytes *edid);
gboolean meta_output_info_get_min_refresh_rate (const MetaOutputInfo *output_info,
int *min_refresh_rate);
G_DEFINE_AUTOPTR_CLEANUP_FUNC (MetaOutputInfo, meta_output_info_unref)
#define META_TYPE_OUTPUT (meta_output_get_type ())