output: Move privacy screen support to OutputInfo

Same as previous commit for privacy screen support.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3552>
This commit is contained in:
Sebastian Wick 2024-01-23 20:38:37 +01:00 committed by Marge Bot
parent a3a4de6c6b
commit 8acf250583
4 changed files with 6 additions and 11 deletions

View File

@ -467,13 +467,6 @@ meta_output_get_privacy_screen_state (MetaOutput *output)
return output_class->get_privacy_screen_state (output);
}
gboolean
meta_output_is_privacy_screen_supported (MetaOutput *output)
{
return !(meta_output_get_privacy_screen_state (output) ==
META_PRIVACY_SCREEN_UNAVAILABLE);
}
gboolean
meta_output_is_privacy_screen_enabled (MetaOutput *output)
{

View File

@ -151,6 +151,7 @@ typedef struct _MetaOutputInfo
gboolean supports_underscanning;
gboolean supports_color_transform;
gboolean supports_privacy_screen;
unsigned int max_bpc_min;
unsigned int max_bpc_max;
@ -246,8 +247,6 @@ int meta_output_get_backlight (MetaOutput *output);
MetaPrivacyScreenState meta_output_get_privacy_screen_state (MetaOutput *output);
gboolean meta_output_is_privacy_screen_supported (MetaOutput *output);
gboolean meta_output_is_privacy_screen_enabled (MetaOutput *output);
gboolean meta_output_set_privacy_screen_enabled (MetaOutput *output,

View File

@ -2584,7 +2584,7 @@ meta_onscreen_native_invalidate (MetaOnscreenNative *onscreen_native)
if (meta_crtc_get_gamma_lut_size (onscreen_native->crtc) > 0)
onscreen_native->is_gamma_lut_invalid = TRUE;
if (meta_output_is_privacy_screen_supported (onscreen_native->output))
if (output_info->supports_privacy_screen)
onscreen_native->is_privacy_screen_invalid = TRUE;
if (output_info->supported_color_spaces &
(1 << META_OUTPUT_COLORSPACE_DEFAULT))
@ -2673,7 +2673,7 @@ meta_onscreen_native_new (MetaRendererNative *renderer_native,
onscreen_native);
}
if (meta_output_is_privacy_screen_supported (output))
if (output_info->supports_privacy_screen)
{
onscreen_native->is_privacy_screen_invalid = TRUE;
onscreen_native->privacy_screen_changed_handler_id =

View File

@ -424,6 +424,9 @@ meta_output_kms_new (MetaGpuKms *gpu_kms,
}
}
output_info->supports_privacy_screen =
(connector_state->privacy_screen_state != META_PRIVACY_SCREEN_UNAVAILABLE);
output = g_object_new (META_TYPE_OUTPUT_KMS,
"id", ((uint64_t) gpu_id << 32) | connector_id,
"gpu", gpu,