mirror of
https://github.com/brl/mutter.git
synced 2025-06-14 17:29:31 +00:00
monitor-manager: Rename *Info structs to *Assignment
MetaCrtcInfo and MetaOutputInfo did not represent information about MetaCrtc and MetaOutput, but the result of the monitor configuration assignment algorithm, thus rename it to MetaCrtcAssignment and MetaOutputAssignment. The purpose for this is to be able to introduce a struct that actually carries information about the CRTCs and outputs, as retrieved from the backend implementations. https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1287
This commit is contained in:

committed by
Georges Basile Stavracas Neto

parent
f71316c850
commit
b69111d8e6
@ -169,11 +169,11 @@ meta_monitor_manager_kms_ensure_initial_config (MetaMonitorManager *manager)
|
||||
}
|
||||
|
||||
static void
|
||||
apply_crtc_assignments (MetaMonitorManager *manager,
|
||||
MetaCrtcInfo **crtcs,
|
||||
unsigned int n_crtcs,
|
||||
MetaOutputInfo **outputs,
|
||||
unsigned int n_outputs)
|
||||
apply_crtc_assignments (MetaMonitorManager *manager,
|
||||
MetaCrtcAssignment **crtcs,
|
||||
unsigned int n_crtcs,
|
||||
MetaOutputAssignment **outputs,
|
||||
unsigned int n_outputs)
|
||||
{
|
||||
MetaBackend *backend = meta_monitor_manager_get_backend (manager);
|
||||
g_autoptr (GList) to_configure_outputs = NULL;
|
||||
@ -198,12 +198,12 @@ apply_crtc_assignments (MetaMonitorManager *manager,
|
||||
|
||||
for (i = 0; i < n_crtcs; i++)
|
||||
{
|
||||
MetaCrtcInfo *crtc_info = crtcs[i];
|
||||
MetaCrtc *crtc = crtc_info->crtc;
|
||||
MetaCrtcAssignment *crtc_assignment = crtcs[i];
|
||||
MetaCrtc *crtc = crtc_assignment->crtc;
|
||||
|
||||
to_configure_crtcs = g_list_remove (to_configure_crtcs, crtc);
|
||||
|
||||
if (crtc_info->mode == NULL)
|
||||
if (crtc_assignment->mode == NULL)
|
||||
{
|
||||
meta_crtc_unset_config (crtc);
|
||||
}
|
||||
@ -212,20 +212,23 @@ apply_crtc_assignments (MetaMonitorManager *manager,
|
||||
unsigned int j;
|
||||
|
||||
meta_crtc_set_config (crtc,
|
||||
&crtc_info->layout,
|
||||
crtc_info->mode,
|
||||
crtc_info->transform);
|
||||
&crtc_assignment->layout,
|
||||
crtc_assignment->mode,
|
||||
crtc_assignment->transform);
|
||||
|
||||
for (j = 0; j < crtc_info->outputs->len; j++)
|
||||
for (j = 0; j < crtc_assignment->outputs->len; j++)
|
||||
{
|
||||
MetaOutput *output = g_ptr_array_index (crtc_info->outputs, j);
|
||||
MetaOutputInfo *output_info;
|
||||
MetaOutput *output = g_ptr_array_index (crtc_assignment->outputs,
|
||||
j);
|
||||
MetaOutputAssignment *output_assignment;
|
||||
|
||||
to_configure_outputs = g_list_remove (to_configure_outputs,
|
||||
output);
|
||||
|
||||
output_info = meta_find_output_info (outputs, n_outputs, output);
|
||||
meta_output_assign_crtc (output, crtc, output_info);
|
||||
output_assignment = meta_find_output_assignment (outputs,
|
||||
n_outputs,
|
||||
output);
|
||||
meta_output_assign_crtc (output, crtc, output_assignment);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -273,8 +276,8 @@ meta_monitor_manager_kms_apply_monitors_config (MetaMonitorManager *manager
|
||||
MetaMonitorsConfigMethod method,
|
||||
GError **error)
|
||||
{
|
||||
GPtrArray *crtc_infos;
|
||||
GPtrArray *output_infos;
|
||||
GPtrArray *crtc_assignments;
|
||||
GPtrArray *output_assignments;
|
||||
|
||||
if (!config)
|
||||
{
|
||||
@ -285,25 +288,26 @@ meta_monitor_manager_kms_apply_monitors_config (MetaMonitorManager *manager
|
||||
}
|
||||
|
||||
if (!meta_monitor_config_manager_assign (manager, config,
|
||||
&crtc_infos, &output_infos,
|
||||
&crtc_assignments,
|
||||
&output_assignments,
|
||||
error))
|
||||
return FALSE;
|
||||
|
||||
if (method == META_MONITORS_CONFIG_METHOD_VERIFY)
|
||||
{
|
||||
g_ptr_array_free (crtc_infos, TRUE);
|
||||
g_ptr_array_free (output_infos, TRUE);
|
||||
g_ptr_array_free (crtc_assignments, TRUE);
|
||||
g_ptr_array_free (output_assignments, TRUE);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
apply_crtc_assignments (manager,
|
||||
(MetaCrtcInfo **) crtc_infos->pdata,
|
||||
crtc_infos->len,
|
||||
(MetaOutputInfo **) output_infos->pdata,
|
||||
output_infos->len);
|
||||
(MetaCrtcAssignment **) crtc_assignments->pdata,
|
||||
crtc_assignments->len,
|
||||
(MetaOutputAssignment **) output_assignments->pdata,
|
||||
output_assignments->len);
|
||||
|
||||
g_ptr_array_free (crtc_infos, TRUE);
|
||||
g_ptr_array_free (output_infos, TRUE);
|
||||
g_ptr_array_free (crtc_assignments, TRUE);
|
||||
g_ptr_array_free (output_assignments, TRUE);
|
||||
|
||||
update_screen_size (manager, config);
|
||||
meta_monitor_manager_rebuild (manager, config);
|
||||
|
@ -363,23 +363,23 @@ meta_create_kms_output (MetaGpuKms *gpu_kms,
|
||||
|
||||
if (meta_crtc_get_id (crtc) == connector_state->current_crtc_id)
|
||||
{
|
||||
MetaOutputInfo output_info;
|
||||
MetaOutputAssignment output_assignment;
|
||||
|
||||
if (old_output)
|
||||
{
|
||||
output_info = (MetaOutputInfo) {
|
||||
output_assignment = (MetaOutputAssignment) {
|
||||
.is_primary = meta_output_is_primary (old_output),
|
||||
.is_presentation = meta_output_is_presentation (old_output),
|
||||
};
|
||||
}
|
||||
else
|
||||
{
|
||||
output_info = (MetaOutputInfo) {
|
||||
output_assignment = (MetaOutputAssignment) {
|
||||
.is_primary = FALSE,
|
||||
.is_presentation = FALSE,
|
||||
};
|
||||
}
|
||||
meta_output_assign_crtc (output, crtc, &output_info);
|
||||
meta_output_assign_crtc (output, crtc, &output_assignment);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user