mirror of
https://github.com/brl/mutter.git
synced 2025-08-03 23:24:40 +00:00
output: Move configureable state to instance private
That is is_presentation, is_primary, is_underscanning and backlight. The first three are set during CRTC assignment as they are only valid when active. The other is set separately, as it is untied to monitor configuration. https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1287
This commit is contained in:

committed by
Georges Basile Stavracas Neto

parent
9186b6d6b0
commit
f71316c850
@@ -125,7 +125,6 @@ apply_crtc_assignments (MetaMonitorManager *manager,
|
||||
MetaGpu *gpu = meta_backend_test_get_gpu (backend_test);
|
||||
g_autoptr (GList) to_configure_outputs = NULL;
|
||||
g_autoptr (GList) to_configure_crtcs = NULL;
|
||||
GList *l;
|
||||
unsigned int i;
|
||||
|
||||
to_configure_outputs = g_list_copy (meta_gpu_get_outputs (gpu));
|
||||
@@ -144,7 +143,6 @@ apply_crtc_assignments (MetaMonitorManager *manager,
|
||||
}
|
||||
else
|
||||
{
|
||||
MetaOutput *output;
|
||||
unsigned int j;
|
||||
|
||||
meta_crtc_set_config (crtc,
|
||||
@@ -154,41 +152,26 @@ apply_crtc_assignments (MetaMonitorManager *manager,
|
||||
|
||||
for (j = 0; j < crtc_info->outputs->len; j++)
|
||||
{
|
||||
MetaOutput *output;
|
||||
MetaOutputInfo *output_info;
|
||||
|
||||
output = ((MetaOutput**)crtc_info->outputs->pdata)[j];
|
||||
|
||||
to_configure_outputs = g_list_remove (to_configure_outputs,
|
||||
output);
|
||||
meta_output_assign_crtc (output, crtc);
|
||||
|
||||
output_info = meta_find_output_info (outputs, n_outputs, output);
|
||||
meta_output_assign_crtc (output, crtc, output_info);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0; i < n_outputs; i++)
|
||||
{
|
||||
MetaOutputInfo *output_info = outputs[i];
|
||||
MetaOutput *output = output_info->output;
|
||||
|
||||
output->is_primary = output_info->is_primary;
|
||||
output->is_presentation = output_info->is_presentation;
|
||||
output->is_underscanning = output_info->is_underscanning;
|
||||
}
|
||||
|
||||
/* Disable CRTCs not mentioned in the list */
|
||||
for (l = to_configure_crtcs; l; l = l->next)
|
||||
{
|
||||
MetaCrtc *crtc = l->data;
|
||||
|
||||
meta_crtc_unset_config (crtc);
|
||||
}
|
||||
|
||||
/* Disable outputs not mentioned in the list */
|
||||
for (l = to_configure_outputs; l; l = l->next)
|
||||
{
|
||||
MetaOutput *output = l->data;
|
||||
|
||||
meta_output_unassign_crtc (output);
|
||||
output->is_primary = FALSE;
|
||||
}
|
||||
g_list_foreach (to_configure_crtcs,
|
||||
(GFunc) meta_crtc_unset_config,
|
||||
NULL);
|
||||
g_list_foreach (to_configure_outputs,
|
||||
(GFunc) meta_output_unassign_crtc,
|
||||
NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@@ -285,7 +285,7 @@ check_logical_monitor (MetaMonitorManager *monitor_manager,
|
||||
MetaOutput *output = l_output->data;
|
||||
MetaCrtc *crtc;
|
||||
|
||||
if (output->is_primary)
|
||||
if (meta_output_is_primary (output))
|
||||
{
|
||||
g_assert_null (primary_output);
|
||||
primary_output = output;
|
||||
@@ -296,7 +296,7 @@ check_logical_monitor (MetaMonitorManager *monitor_manager,
|
||||
meta_monitor_get_logical_monitor (monitor) == logical_monitor);
|
||||
g_assert_cmpint (logical_monitor->is_presentation,
|
||||
==,
|
||||
output->is_presentation);
|
||||
meta_output_is_presentation (output));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -370,7 +370,7 @@ check_monitor_configuration (MonitorTestCaseExpect *expect)
|
||||
g_assert (output == output_from_winsys_id (backend, winsys_id));
|
||||
g_assert_cmpint (expect->monitors[i].is_underscanning,
|
||||
==,
|
||||
output->is_underscanning);
|
||||
meta_output_is_underscanning (output));
|
||||
}
|
||||
|
||||
meta_monitor_get_physical_dimensions (monitor, &width_mm, &height_mm);
|
||||
@@ -655,7 +655,15 @@ create_monitor_test_setup (MonitorTestCaseSetup *setup,
|
||||
NULL);
|
||||
|
||||
if (crtc)
|
||||
meta_output_assign_crtc (output, crtc);
|
||||
{
|
||||
MetaOutputInfo output_info;
|
||||
|
||||
output_info = (MetaOutputInfo) {
|
||||
.is_underscanning = setup->outputs[i].is_underscanning,
|
||||
};
|
||||
meta_output_assign_crtc (output, crtc, &output_info);
|
||||
}
|
||||
|
||||
output->name = (is_laptop_panel ? g_strdup_printf ("eDP-%d",
|
||||
++n_laptop_panels)
|
||||
: g_strdup_printf ("DP-%d",
|
||||
@@ -676,11 +684,9 @@ create_monitor_test_setup (MonitorTestCaseSetup *setup,
|
||||
output->possible_crtcs = possible_crtcs;
|
||||
output->n_possible_clones = 0;
|
||||
output->possible_clones = NULL;
|
||||
output->backlight = -1;
|
||||
output->connector_type = (is_laptop_panel ? META_CONNECTOR_TYPE_eDP
|
||||
: META_CONNECTOR_TYPE_DisplayPort);
|
||||
output->tile_info = setup->outputs[i].tile_info;
|
||||
output->is_underscanning = setup->outputs[i].is_underscanning;
|
||||
output->panel_orientation_transform =
|
||||
setup->outputs[i].panel_orientation_transform;
|
||||
output->driver_private = output_test;
|
||||
|
Reference in New Issue
Block a user