output: Add max_bpc support

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2412>
This commit is contained in:
Daniel van Vugt 2022-06-09 18:44:46 +08:00 committed by Marge Bot
parent e0e10c29d9
commit 6ff0d600c3
2 changed files with 26 additions and 0 deletions

View File

@ -55,6 +55,9 @@ typedef struct _MetaOutputPrivate
gboolean is_underscanning;
gboolean has_max_bpc;
unsigned int max_bpc;
int backlight;
} MetaOutputPrivate;
@ -177,6 +180,18 @@ meta_output_is_underscanning (MetaOutput *output)
return priv->is_underscanning;
}
gboolean
meta_output_get_max_bpc (MetaOutput *output,
unsigned int *max_bpc)
{
MetaOutputPrivate *priv = meta_output_get_instance_private (output);
if (priv->has_max_bpc && max_bpc)
*max_bpc = priv->max_bpc;
return priv->has_max_bpc;
}
void
meta_output_set_backlight (MetaOutput *output,
int backlight)
@ -235,6 +250,10 @@ meta_output_assign_crtc (MetaOutput *output,
priv->is_primary = output_assignment->is_primary;
priv->is_presentation = output_assignment->is_presentation;
priv->is_underscanning = output_assignment->is_underscanning;
priv->has_max_bpc = output_assignment->has_max_bpc;
if (priv->has_max_bpc)
priv->max_bpc = output_assignment->max_bpc;
}
void

View File

@ -107,6 +107,9 @@ typedef struct _MetaOutputInfo
gboolean supports_underscanning;
gboolean supports_color_transform;
unsigned int max_bpc_min;
unsigned int max_bpc_max;
/*
* Get a new preferred mode on hotplug events, to handle dynamic guest
* resizing.
@ -182,6 +185,10 @@ gboolean meta_output_is_presentation (MetaOutput *output);
META_EXPORT_TEST
gboolean meta_output_is_underscanning (MetaOutput *output);
META_EXPORT_TEST
gboolean meta_output_get_max_bpc (MetaOutput *output,
unsigned int *max_bpc);
void meta_output_set_backlight (MetaOutput *output,
int backlight);