monitor-config-manager: Allow backends to assign extra data

When we're configuring monitors, allow backends to add backend specific
assignments during resource assignment (mapping connectors and CRTCs
etc).

This will later allow the native backend's KMS monitor resources to
assign a primary plane and optionally a cursor plane during
configuration. This will then dictate what plane will be used for
primary plane updates, as well as cursor updates, until reconfigured
again.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3428>
This commit is contained in:
Jonas Ådahl
2023-11-28 09:25:59 +01:00
committed by Marge Bot
parent 2bb75a3c97
commit 429e65b993
9 changed files with 57 additions and 7 deletions

View File

@ -261,6 +261,12 @@ assign_monitor_crtc (MetaMonitor *monitor,
};
g_ptr_array_add (crtc_assignment->outputs, output);
if (!meta_crtc_assign_extra (crtc,
crtc_assignment,
data->crtc_assignments,
error))
return FALSE;
/*
* Only one output can be marked as primary (due to Xrandr limitation),
* so only mark the main output of the first monitor in the logical monitor
@ -1748,6 +1754,8 @@ meta_monitors_config_class_init (MetaMonitorsConfigClass *klass)
static void
meta_crtc_assignment_free (MetaCrtcAssignment *assignment)
{
g_clear_pointer (&assignment->backend_private,
assignment->backend_private_destroy);
g_ptr_array_free (assignment->outputs, TRUE);
g_free (assignment);
}