[gnome-flashback] monitor-manager: rename *Info structs to *Assignment
- From: Alberts Muktupāvels <muktupavels src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-flashback] monitor-manager: rename *Info structs to *Assignment
- Date: Sat, 11 Jul 2020 18:42:29 +0000 (UTC)
commit e70a90fabc3411243182d6f055d85667859cd9d5
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date: Thu Jul 9 19:19:52 2020 +0300
monitor-manager: rename *Info structs to *Assignment
Based on mutter commit:
https://gitlab.gnome.org/GNOME/mutter/-/commit/b69111d8e6c06f3a27c
backends/gf-crtc-private.h | 2 +-
backends/gf-crtc-xrandr-private.h | 2 +-
backends/gf-crtc-xrandr.c | 16 +--
backends/gf-monitor-config-manager-private.h | 4 +-
backends/gf-monitor-config-manager.c | 96 +++++++--------
backends/gf-monitor-manager-xrandr.c | 167 ++++++++++++++-------------
backends/gf-output-private.h | 60 +++++-----
backends/gf-output-xrandr.c | 6 +-
backends/gf-output.c | 12 +-
9 files changed, 189 insertions(+), 176 deletions(-)
---
diff --git a/backends/gf-crtc-private.h b/backends/gf-crtc-private.h
index 9ccceea..78fafcc 100644
--- a/backends/gf-crtc-private.h
+++ b/backends/gf-crtc-private.h
@@ -79,7 +79,7 @@ typedef struct
GfRectangle layout;
GfMonitorTransform transform;
GPtrArray *outputs;
-} GfCrtcInfo;
+} GfCrtcAssignment;
#define GF_TYPE_CRTC (gf_crtc_get_type ())
G_DECLARE_FINAL_TYPE (GfCrtc, gf_crtc, GF, CRTC, GObject)
diff --git a/backends/gf-crtc-xrandr-private.h b/backends/gf-crtc-xrandr-private.h
index 6e244a8..00c031c 100644
--- a/backends/gf-crtc-xrandr-private.h
+++ b/backends/gf-crtc-xrandr-private.h
@@ -47,7 +47,7 @@ gboolean gf_crtc_xrandr_set_config (GfCrtc *crtc,
xcb_timestamp_t *out_timestamp);
gboolean gf_crtc_xrandr_is_assignment_changed (GfCrtc *crtc,
- GfCrtcInfo *crtc_info);
+ GfCrtcAssignment *crtc_assignment);
GfCrtcMode *gf_crtc_xrandr_get_current_mode (GfCrtc *crtc);
diff --git a/backends/gf-crtc-xrandr.c b/backends/gf-crtc-xrandr.c
index 0a89f26..697331b 100644
--- a/backends/gf-crtc-xrandr.c
+++ b/backends/gf-crtc-xrandr.c
@@ -235,32 +235,32 @@ gf_crtc_xrandr_set_config (GfCrtc *crtc,
}
gboolean
-gf_crtc_xrandr_is_assignment_changed (GfCrtc *crtc,
- GfCrtcInfo *crtc_info)
+gf_crtc_xrandr_is_assignment_changed (GfCrtc *crtc,
+ GfCrtcAssignment *crtc_assignment)
{
GfCrtcXrandr *crtc_xrandr;
unsigned int i;
crtc_xrandr = crtc->driver_private;
- if (crtc_xrandr->current_mode != crtc_info->mode)
+ if (crtc_xrandr->current_mode != crtc_assignment->mode)
return TRUE;
- if (crtc_xrandr->rect.x != crtc_info->layout.x)
+ if (crtc_xrandr->rect.x != crtc_assignment->layout.x)
return TRUE;
- if (crtc_xrandr->rect.y != crtc_info->layout.y)
+ if (crtc_xrandr->rect.y != crtc_assignment->layout.y)
return TRUE;
- if (crtc_xrandr->transform != crtc_info->transform)
+ if (crtc_xrandr->transform != crtc_assignment->transform)
return TRUE;
- for (i = 0; i < crtc_info->outputs->len; i++)
+ for (i = 0; i < crtc_assignment->outputs->len; i++)
{
GfOutput *output;
GfCrtc *assigned_crtc;
- output = ((GfOutput **) crtc_info->outputs->pdata)[i];
+ output = ((GfOutput **) crtc_assignment->outputs->pdata)[i];
assigned_crtc = gf_output_get_assigned_crtc (output);
if (assigned_crtc != crtc)
diff --git a/backends/gf-monitor-config-manager-private.h b/backends/gf-monitor-config-manager-private.h
index a57cf87..1498899 100644
--- a/backends/gf-monitor-config-manager-private.h
+++ b/backends/gf-monitor-config-manager-private.h
@@ -39,8 +39,8 @@ GfMonitorConfigStore *gf_monitor_config_manager_get_store (GfM
gboolean gf_monitor_config_manager_assign (GfMonitorManager
*manager,
GfMonitorsConfig
*config,
- GPtrArray
**crtc_infos,
- GPtrArray
**output_infos,
+ GPtrArray
**crtc_assignments,
+ GPtrArray
**output_assignments,
GError
**error);
GfMonitorsConfig *gf_monitor_config_manager_get_stored (GfMonitorConfigManager
*config_manager);
diff --git a/backends/gf-monitor-config-manager.c b/backends/gf-monitor-config-manager.c
index 078db9d..2d36a97 100644
--- a/backends/gf-monitor-config-manager.c
+++ b/backends/gf-monitor-config-manager.c
@@ -40,8 +40,8 @@ typedef struct
GfMonitorsConfig *config;
GfLogicalMonitorConfig *logical_monitor_config;
GfMonitorConfig *monitor_config;
- GPtrArray *crtc_infos;
- GPtrArray *output_infos;
+ GPtrArray *crtc_assignments;
+ GPtrArray *output_assignments;
GArray *reserved_crtcs;
} MonitorAssignmentData;
@@ -601,15 +601,17 @@ is_crtc_reserved (GfCrtc *crtc,
static gboolean
is_crtc_assigned (GfCrtc *crtc,
- GPtrArray *crtc_infos)
+ GPtrArray *crtc_assignments)
{
unsigned int i;
- for (i = 0; i < crtc_infos->len; i++)
+ for (i = 0; i < crtc_assignments->len; i++)
{
- GfCrtcInfo *assigned_crtc_info = g_ptr_array_index (crtc_infos, i);
+ GfCrtcAssignment *assigned_crtc_assignment;
- if (assigned_crtc_info->crtc == crtc)
+ assigned_crtc_assignment = g_ptr_array_index (crtc_assignments, i);
+
+ if (assigned_crtc_assignment->crtc == crtc)
return TRUE;
}
@@ -618,14 +620,14 @@ is_crtc_assigned (GfCrtc *crtc,
static GfCrtc *
find_unassigned_crtc (GfOutput *output,
- GPtrArray *crtc_infos,
+ GPtrArray *crtc_assignments,
GArray *reserved_crtcs)
{
GfCrtc *crtc;
unsigned int i;
crtc = gf_output_get_assigned_crtc (output);
- if (crtc && !is_crtc_assigned (crtc, crtc_infos))
+ if (crtc && !is_crtc_assigned (crtc, crtc_assignments))
return crtc;
/* then try to assign a CRTC that wasn't used */
@@ -633,7 +635,7 @@ find_unassigned_crtc (GfOutput *output,
{
crtc = output->possible_crtcs[i];
- if (is_crtc_assigned (crtc, crtc_infos))
+ if (is_crtc_assigned (crtc, crtc_assignments))
continue;
if (is_crtc_reserved (crtc, reserved_crtcs))
@@ -647,7 +649,7 @@ find_unassigned_crtc (GfOutput *output,
{
crtc = output->possible_crtcs[i];
- if (is_crtc_assigned (crtc, crtc_infos))
+ if (is_crtc_assigned (crtc, crtc_assignments))
continue;
return crtc;
@@ -675,14 +677,16 @@ assign_monitor_crtc (GfMonitor *monitor,
float width, height;
GfCrtcMode *crtc_mode;
GfRectangle crtc_layout;
- GfCrtcInfo *crtc_info;
- GfOutputInfo *output_info;
+ GfCrtcAssignment *crtc_assignment;
+ GfOutputAssignment *output_assignment;
GfMonitorConfig *first_monitor_config;
gboolean assign_output_as_primary;
gboolean assign_output_as_presentation;
output = monitor_crtc_mode->output;
- crtc = find_unassigned_crtc (output, data->crtc_infos, data->reserved_crtcs);
+ crtc = find_unassigned_crtc (output,
+ data->crtc_assignments,
+ data->reserved_crtcs);
if (!crtc)
{
@@ -740,15 +744,15 @@ assign_monitor_crtc (GfMonitor *monitor,
crtc_layout.width = (int) roundf (width);
crtc_layout.height = (int) roundf (height);
- crtc_info = g_slice_new0 (GfCrtcInfo);
- *crtc_info = (GfCrtcInfo) {
+ crtc_assignment = g_slice_new0 (GfCrtcAssignment);
+ *crtc_assignment = (GfCrtcAssignment) {
.crtc = crtc,
.mode = crtc_mode,
.layout = crtc_layout,
.transform = crtc_hw_transform,
.outputs = g_ptr_array_new ()
};
- g_ptr_array_add (crtc_info->outputs, output);
+ g_ptr_array_add (crtc_assignment->outputs, output);
/*
* Only one output can be marked as primary (due to Xrandr limitation),
@@ -768,16 +772,16 @@ assign_monitor_crtc (GfMonitor *monitor,
else
assign_output_as_presentation = FALSE;
- output_info = g_slice_new0 (GfOutputInfo);
- *output_info = (GfOutputInfo) {
+ output_assignment = g_slice_new0 (GfOutputAssignment);
+ *output_assignment = (GfOutputAssignment) {
.output = output,
.is_primary = assign_output_as_primary,
.is_presentation = assign_output_as_presentation,
.is_underscanning = data->monitor_config->enable_underscanning
};
- g_ptr_array_add (data->crtc_infos, crtc_info);
- g_ptr_array_add (data->output_infos, output_info);
+ g_ptr_array_add (data->crtc_assignments, crtc_assignment);
+ g_ptr_array_add (data->output_assignments, output_assignment);
return TRUE;
}
@@ -787,8 +791,8 @@ assign_monitor_crtcs (GfMonitorManager *manager,
GfMonitorsConfig *config,
GfLogicalMonitorConfig *logical_monitor_config,
GfMonitorConfig *monitor_config,
- GPtrArray *crtc_infos,
- GPtrArray *output_infos,
+ GPtrArray *crtc_assignments,
+ GPtrArray *output_assignments,
GArray *reserved_crtcs,
GError **error)
{
@@ -825,8 +829,8 @@ assign_monitor_crtcs (GfMonitorManager *manager,
.config = config,
.logical_monitor_config = logical_monitor_config,
.monitor_config = monitor_config,
- .crtc_infos = crtc_infos,
- .output_infos = output_infos,
+ .crtc_assignments = crtc_assignments,
+ .output_assignments = output_assignments,
.reserved_crtcs = reserved_crtcs
};
@@ -842,8 +846,8 @@ static gboolean
assign_logical_monitor_crtcs (GfMonitorManager *manager,
GfMonitorsConfig *config,
GfLogicalMonitorConfig *logical_monitor_config,
- GPtrArray *crtc_infos,
- GPtrArray *output_infos,
+ GPtrArray *crtc_assignments,
+ GPtrArray *output_assignments,
GArray *reserved_crtcs,
GError **error)
{
@@ -857,8 +861,10 @@ assign_logical_monitor_crtcs (GfMonitorManager *manager,
config,
logical_monitor_config,
monitor_config,
- crtc_infos, output_infos,
- reserved_crtcs, error))
+ crtc_assignments,
+ output_assignments,
+ reserved_crtcs,
+ error))
return FALSE;
}
@@ -910,16 +916,16 @@ gf_create_monitors_config_key_for_current_state (GfMonitorManager *monitor_manag
}
static void
-gf_crtc_info_free (GfCrtcInfo *info)
+gf_crtc_assignment_free (GfCrtcAssignment *assignment)
{
- g_ptr_array_free (info->outputs, TRUE);
- g_slice_free (GfCrtcInfo, info);
+ g_ptr_array_free (assignment->outputs, TRUE);
+ g_slice_free (GfCrtcAssignment, assignment);
}
static void
-gf_output_info_free (GfOutputInfo *info)
+gf_output_assignment_free (GfOutputAssignment *assignment)
{
- g_slice_free (GfOutputInfo, info);
+ g_slice_free (GfOutputAssignment, assignment);
}
static void
@@ -972,17 +978,17 @@ gf_monitor_config_manager_get_store (GfMonitorConfigManager *config_manager)
gboolean
gf_monitor_config_manager_assign (GfMonitorManager *manager,
GfMonitorsConfig *config,
- GPtrArray **out_crtc_infos,
- GPtrArray **out_output_infos,
+ GPtrArray **out_crtc_assignments,
+ GPtrArray **out_output_assignments,
GError **error)
{
- GPtrArray *crtc_infos;
- GPtrArray *output_infos;
+ GPtrArray *crtc_assignments;
+ GPtrArray *output_assignments;
GArray *reserved_crtcs;
GList *l;
- crtc_infos = g_ptr_array_new_with_free_func ((GDestroyNotify) gf_crtc_info_free);
- output_infos = g_ptr_array_new_with_free_func ((GDestroyNotify) gf_output_info_free);
+ crtc_assignments = g_ptr_array_new_with_free_func ((GDestroyNotify) gf_crtc_assignment_free);
+ output_assignments = g_ptr_array_new_with_free_func ((GDestroyNotify) gf_output_assignment_free);
reserved_crtcs = g_array_new (FALSE, FALSE, sizeof (uint64_t));
for (l = config->logical_monitor_configs; l; l = l->next)
@@ -1024,20 +1030,20 @@ gf_monitor_config_manager_assign (GfMonitorManager *manager,
if (!assign_logical_monitor_crtcs (manager,
config,
logical_monitor_config,
- crtc_infos,
- output_infos,
+ crtc_assignments,
+ output_assignments,
reserved_crtcs,
error))
{
- 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);
g_array_free (reserved_crtcs, TRUE);
return FALSE;
}
}
- *out_crtc_infos = crtc_infos;
- *out_output_infos = output_infos;
+ *out_crtc_assignments = crtc_assignments;
+ *out_output_assignments = output_assignments;
g_array_free (reserved_crtcs, TRUE);
diff --git a/backends/gf-monitor-manager-xrandr.c b/backends/gf-monitor-manager-xrandr.c
index 098ef96..13d971d 100644
--- a/backends/gf-monitor-manager-xrandr.c
+++ b/backends/gf-monitor-manager-xrandr.c
@@ -195,31 +195,33 @@ xrandr_set_crtc_config (GfMonitorManagerXrandr *xrandr,
}
static gboolean
-is_crtc_assignment_changed (GfCrtc *crtc,
- GfCrtcInfo **crtc_infos,
- guint n_crtc_infos)
+is_crtc_assignment_changed (GfCrtc *crtc,
+ GfCrtcAssignment **crtc_assignments,
+ unsigned int n_crtc_assignments)
{
guint i;
- for (i = 0; i < n_crtc_infos; i++)
+ for (i = 0; i < n_crtc_assignments; i++)
{
- GfCrtcInfo *crtc_info = crtc_infos[i];
+ GfCrtcAssignment *crtc_assignment;
- if (crtc_info->crtc != crtc)
+ crtc_assignment = crtc_assignments[i];
+
+ if (crtc_assignment->crtc != crtc)
continue;
- return gf_crtc_xrandr_is_assignment_changed (crtc, crtc_info);
+ return gf_crtc_xrandr_is_assignment_changed (crtc, crtc_assignment);
}
return !!gf_crtc_xrandr_get_current_mode (crtc);
}
static gboolean
-is_output_assignment_changed (GfOutput *output,
- GfCrtcInfo **crtc_infos,
- guint n_crtc_infos,
- GfOutputInfo **output_infos,
- guint n_output_infos)
+is_output_assignment_changed (GfOutput *output,
+ GfCrtcAssignment **crtc_assignments,
+ guint n_crtc_assignments,
+ GfOutputAssignment **output_assignments,
+ guint n_output_assignments)
{
gboolean output_is_found;
GfCrtc *assigned_crtc;
@@ -227,20 +229,22 @@ is_output_assignment_changed (GfOutput *output,
output_is_found = FALSE;
- for (i = 0; i < n_output_infos; i++)
+ for (i = 0; i < n_output_assignments; i++)
{
- GfOutputInfo *output_info = output_infos[i];
+ GfOutputAssignment *output_assignment;
+
+ output_assignment = output_assignments[i];
- if (output_info->output != output)
+ if (output_assignment->output != output)
continue;
- if (gf_output_is_primary (output) != output_info->is_primary)
+ if (gf_output_is_primary (output) != output_assignment->is_primary)
return TRUE;
- if (gf_output_is_presentation (output) != output_info->is_presentation)
+ if (gf_output_is_presentation (output) != output_assignment->is_presentation)
return TRUE;
- if (gf_output_is_underscanning (output) != output_info->is_underscanning)
+ if (gf_output_is_underscanning (output) != output_assignment->is_underscanning)
return TRUE;
output_is_found = TRUE;
@@ -251,19 +255,21 @@ is_output_assignment_changed (GfOutput *output,
if (!output_is_found)
return assigned_crtc != NULL;
- for (i = 0; i < n_crtc_infos; i++)
+ for (i = 0; i < n_crtc_assignments; i++)
{
- GfCrtcInfo *crtc_info = crtc_infos[i];
+ GfCrtcAssignment *crtc_assignment;
guint j;
- for (j = 0; j < crtc_info->outputs->len; j++)
+ crtc_assignment = crtc_assignments[i];
+
+ for (j = 0; j < crtc_assignment->outputs->len; j++)
{
- GfOutput *crtc_info_output;
+ GfOutput *crtc_assignment_output;
- crtc_info_output = ((GfOutput**) crtc_info->outputs->pdata)[j];
+ crtc_assignment_output = ((GfOutput**) crtc_assignment->outputs->pdata)[j];
- if (crtc_info_output == output &&
- crtc_info->crtc == assigned_crtc)
+ if (crtc_assignment_output == output &&
+ crtc_assignment->crtc == assigned_crtc)
return FALSE;
}
}
@@ -284,11 +290,11 @@ get_gpu (GfMonitorManagerXrandr *self)
}
static gboolean
-is_assignments_changed (GfMonitorManager *manager,
- GfCrtcInfo **crtc_infos,
- guint n_crtc_infos,
- GfOutputInfo **output_infos,
- guint n_output_infos)
+is_assignments_changed (GfMonitorManager *manager,
+ GfCrtcAssignment **crtc_assignments,
+ guint n_crtc_assignments,
+ GfOutputAssignment **output_assignments,
+ guint n_output_assignments)
{
GfMonitorManagerXrandr *manager_xrandr;
GfGpu *gpu;
@@ -301,7 +307,7 @@ is_assignments_changed (GfMonitorManager *manager,
{
GfCrtc *crtc = l->data;
- if (is_crtc_assignment_changed (crtc, crtc_infos, n_crtc_infos))
+ if (is_crtc_assignment_changed (crtc, crtc_assignments, n_crtc_assignments))
return TRUE;
}
@@ -310,10 +316,10 @@ is_assignments_changed (GfMonitorManager *manager,
GfOutput *output = l->data;
if (is_output_assignment_changed (output,
- crtc_infos,
- n_crtc_infos,
- output_infos,
- n_output_infos))
+ crtc_assignments,
+ n_crtc_assignments,
+ output_assignments,
+ n_output_assignments))
return TRUE;
}
@@ -370,12 +376,12 @@ gf_monitor_transform_to_xrandr (GfMonitorTransform transform)
}
static void
-apply_crtc_assignments (GfMonitorManager *manager,
- gboolean save_timestamp,
- GfCrtcInfo **crtcs,
- guint n_crtcs,
- GfOutputInfo **outputs,
- guint n_outputs)
+apply_crtc_assignments (GfMonitorManager *manager,
+ gboolean save_timestamp,
+ GfCrtcAssignment **crtcs,
+ guint n_crtcs,
+ GfOutputAssignment **outputs,
+ guint n_outputs)
{
GfMonitorManagerXrandr *xrandr;
GfGpu *gpu;
@@ -397,16 +403,16 @@ apply_crtc_assignments (GfMonitorManager *manager,
width = 0; height = 0;
for (i = 0; i < n_crtcs; i++)
{
- GfCrtcInfo *crtc_info = crtcs[i];
- GfCrtc *crtc = crtc_info->crtc;
+ GfCrtcAssignment *crtc_assignment = crtcs[i];
+ GfCrtc *crtc = crtc_assignment->crtc;
- if (crtc_info->mode == NULL)
+ if (crtc_assignment->mode == NULL)
continue;
to_disable_crtcs = g_list_remove (to_disable_crtcs, crtc);
- width = MAX (width, crtc_info->layout.x + crtc_info->layout.width);
- height = MAX (height, crtc_info->layout.y + crtc_info->layout.height);
+ width = MAX (width, crtc_assignment->layout.x + crtc_assignment->layout.width);
+ height = MAX (height, crtc_assignment->layout.y + crtc_assignment->layout.height);
}
/* Second disable all newly disabled CRTCs, or CRTCs that in the previous
@@ -416,8 +422,8 @@ apply_crtc_assignments (GfMonitorManager *manager,
*/
for (i = 0; i < n_crtcs; i++)
{
- GfCrtcInfo *crtc_info = crtcs[i];
- GfCrtc *crtc = crtc_info->crtc;
+ GfCrtcAssignment *crtc_assignment = crtcs[i];
+ GfCrtc *crtc = crtc_assignment->crtc;
GfCrtcConfig *crtc_config;
int x2, y2;
@@ -428,7 +434,7 @@ apply_crtc_assignments (GfMonitorManager *manager,
x2 = crtc_config->layout.x + crtc_config->layout.width;
y2 = crtc_config->layout.y + crtc_config->layout.height;
- if (crtc_info->mode == NULL || x2 > width || y2 > height)
+ if (crtc_assignment->mode == NULL || x2 > width || y2 > height)
{
xrandr_set_crtc_config (xrandr,
crtc,
@@ -476,44 +482,44 @@ apply_crtc_assignments (GfMonitorManager *manager,
for (i = 0; i < n_crtcs; i++)
{
- GfCrtcInfo *crtc_info = crtcs[i];
- GfCrtc *crtc = crtc_info->crtc;
+ GfCrtcAssignment *crtc_assignment = crtcs[i];
+ GfCrtc *crtc = crtc_assignment->crtc;
- if (crtc_info->mode != NULL)
+ if (crtc_assignment->mode != NULL)
{
GfCrtcMode *mode;
xcb_randr_output_t *output_ids;
guint j, n_output_ids;
xcb_randr_rotation_t rotation;
- mode = crtc_info->mode;
+ mode = crtc_assignment->mode;
- n_output_ids = crtc_info->outputs->len;
+ n_output_ids = crtc_assignment->outputs->len;
output_ids = g_new0 (xcb_randr_output_t, n_output_ids);
for (j = 0; j < n_output_ids; j++)
{
GfOutput *output;
- GfOutputInfo *output_info;
+ GfOutputAssignment *output_assignment;
- output = ((GfOutput**) crtc_info->outputs->pdata)[j];
+ output = ((GfOutput**) crtc_assignment->outputs->pdata)[j];
to_configure_outputs = g_list_remove (to_configure_outputs, output);
- output_info = gf_find_output_info (outputs, n_outputs, output);
- gf_output_assign_crtc (output, crtc, output_info);
+ output_assignment = gf_find_output_assignment (outputs, n_outputs, output);
+ gf_output_assign_crtc (output, crtc, output_assignment);
output_ids[j] = gf_output_get_id (output);
}
- rotation = gf_monitor_transform_to_xrandr (crtc_info->transform);
+ rotation = gf_monitor_transform_to_xrandr (crtc_assignment->transform);
if (!xrandr_set_crtc_config (xrandr,
crtc,
save_timestamp,
(xcb_randr_crtc_t) gf_crtc_get_id (crtc),
XCB_CURRENT_TIME,
- crtc_info->layout.x,
- crtc_info->layout.y,
+ crtc_assignment->layout.x,
+ crtc_assignment->layout.y,
(xcb_randr_mode_t) mode->mode_id,
rotation,
output_ids, n_output_ids))
@@ -521,17 +527,18 @@ apply_crtc_assignments (GfMonitorManager *manager,
g_warning ("Configuring CRTC %d with mode %d (%d x %d @ %f) at position %d, %d and transform
%u failed\n",
(guint) gf_crtc_get_id (crtc), (guint) (mode->mode_id),
mode->width, mode->height, (gdouble) mode->refresh_rate,
- crtc_info->layout.x, crtc_info->layout.y,
- crtc_info->transform);
+ crtc_assignment->layout.x,
+ crtc_assignment->layout.y,
+ crtc_assignment->transform);
g_free (output_ids);
continue;
}
gf_crtc_set_config (crtc,
- &crtc_info->layout,
+ &crtc_assignment->layout,
mode,
- crtc_info->transform);
+ crtc_assignment->transform);
g_free (output_ids);
}
@@ -539,8 +546,8 @@ apply_crtc_assignments (GfMonitorManager *manager,
for (i = 0; i < n_outputs; i++)
{
- GfOutputInfo *output_info = outputs[i];
- GfOutput *output = output_info->output;
+ GfOutputAssignment *output_assignment = outputs[i];
+ GfOutput *output = output_assignment->output;
gf_output_xrandr_apply_mode (output);
}
@@ -803,8 +810,8 @@ gf_monitor_manager_xrandr_apply_monitors_config (GfMonitorManager *manage
GfMonitorsConfigMethod method,
GError **error)
{
- GPtrArray *crtc_infos;
- GPtrArray *output_infos;
+ GPtrArray *crtc_assignments;
+ GPtrArray *output_assignments;
if (!config)
{
@@ -813,7 +820,7 @@ gf_monitor_manager_xrandr_apply_monitors_config (GfMonitorManager *manage
}
if (!gf_monitor_config_manager_assign (manager, config,
- &crtc_infos, &output_infos,
+ &crtc_assignments, &output_assignments,
error))
return FALSE;
@@ -828,17 +835,17 @@ gf_monitor_manager_xrandr_apply_monitors_config (GfMonitorManager *manage
* just update the logical state.
*/
if (is_assignments_changed (manager,
- (GfCrtcInfo **) crtc_infos->pdata,
- crtc_infos->len,
- (GfOutputInfo **) output_infos->pdata,
- output_infos->len))
+ (GfCrtcAssignment **) crtc_assignments->pdata,
+ crtc_assignments->len,
+ (GfOutputAssignment **) output_assignments->pdata,
+ output_assignments->len))
{
apply_crtc_assignments (manager,
TRUE,
- (GfCrtcInfo **) crtc_infos->pdata,
- crtc_infos->len,
- (GfOutputInfo **) output_infos->pdata,
- output_infos->len);
+ (GfCrtcAssignment **) crtc_assignments->pdata,
+ crtc_assignments->len,
+ (GfOutputAssignment **) output_assignments->pdata,
+ output_assignments->len);
}
else
{
@@ -846,8 +853,8 @@ gf_monitor_manager_xrandr_apply_monitors_config (GfMonitorManager *manage
}
}
- 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;
}
diff --git a/backends/gf-output-private.h b/backends/gf-output-private.h
index 2632fff..4d8956d 100644
--- a/backends/gf-output-private.h
+++ b/backends/gf-output-private.h
@@ -52,7 +52,7 @@ typedef struct
gboolean is_primary;
gboolean is_presentation;
gboolean is_underscanning;
-} GfOutputInfo;
+} GfOutputAssignment;
struct _GfOutput
{
@@ -99,57 +99,57 @@ struct _GfOutput
#define GF_TYPE_OUTPUT (gf_output_get_type ())
G_DECLARE_FINAL_TYPE (GfOutput, gf_output, GF, OUTPUT, GObject)
-uint64_t gf_output_get_id (GfOutput *self);
+uint64_t gf_output_get_id (GfOutput *self);
-GfGpu *gf_output_get_gpu (GfOutput *output);
+GfGpu *gf_output_get_gpu (GfOutput *self);
-const char *gf_output_get_name (GfOutput *self);
+const char *gf_output_get_name (GfOutput *self);
-void gf_output_assign_crtc (GfOutput *output,
- GfCrtc *crtc,
- const GfOutputInfo *output_info);
+void gf_output_assign_crtc (GfOutput *self,
+ GfCrtc *crtc,
+ const GfOutputAssignment *output_assignment);
-void gf_output_unassign_crtc (GfOutput *output);
+void gf_output_unassign_crtc (GfOutput *self);
-GfCrtc *gf_output_get_assigned_crtc (GfOutput *output);
+GfCrtc *gf_output_get_assigned_crtc (GfOutput *self);
-void gf_output_parse_edid (GfOutput *output,
- GBytes *edid);
+void gf_output_parse_edid (GfOutput *self,
+ GBytes *edid);
-gboolean gf_output_is_laptop (GfOutput *output);
+gboolean gf_output_is_laptop (GfOutput *self);
-GfMonitorTransform gf_output_logical_to_crtc_transform (GfOutput *output,
- GfMonitorTransform transform);
+GfMonitorTransform gf_output_logical_to_crtc_transform (GfOutput *self,
+ GfMonitorTransform transform);
-GfMonitorTransform gf_output_crtc_to_logical_transform (GfOutput *output,
- GfMonitorTransform transform);
+GfMonitorTransform gf_output_crtc_to_logical_transform (GfOutput *self,
+ GfMonitorTransform transform);
-gboolean gf_output_is_primary (GfOutput *self);
+gboolean gf_output_is_primary (GfOutput *self);
-gboolean gf_output_is_presentation (GfOutput *self);
+gboolean gf_output_is_presentation (GfOutput *self);
-gboolean gf_output_is_underscanning (GfOutput *self);
+gboolean gf_output_is_underscanning (GfOutput *self);
-void gf_output_set_backlight (GfOutput *self,
- int backlight);
+void gf_output_set_backlight (GfOutput *self,
+ int backlight);
-int gf_output_get_backlight (GfOutput *self);
+int gf_output_get_backlight (GfOutput *self);
-static inline GfOutputInfo *
-gf_find_output_info (GfOutputInfo **outputs,
- unsigned int n_outputs,
- GfOutput *output)
+static inline GfOutputAssignment *
+gf_find_output_assignment (GfOutputAssignment **outputs,
+ unsigned int n_outputs,
+ GfOutput *output)
{
unsigned int i;
for (i = 0; i < n_outputs; i++)
{
- GfOutputInfo *output_info;
+ GfOutputAssignment *output_assignment;
- output_info = outputs[i];
+ output_assignment = outputs[i];
- if (output == output_info->output)
- return output_info;
+ if (output == output_assignment->output)
+ return output_assignment;
}
return NULL;
diff --git a/backends/gf-output-xrandr.c b/backends/gf-output-xrandr.c
index 62158cc..46fe1dc 100644
--- a/backends/gf-output-xrandr.c
+++ b/backends/gf-output-xrandr.c
@@ -807,15 +807,15 @@ gf_create_xrandr_output (GfGpuXrandr *gpu_xrandr,
if (assigned_crtc)
{
- GfOutputInfo output_info;
+ GfOutputAssignment output_assignment;
- output_info = (GfOutputInfo) {
+ output_assignment = (GfOutputAssignment) {
.is_primary = (XID) gf_output_get_id (output) == primary_output,
.is_presentation = output_get_presentation_xrandr (output),
.is_underscanning = output_get_underscanning_xrandr (output),
};
- gf_output_assign_crtc (output, assigned_crtc, &output_info);
+ gf_output_assign_crtc (output, assigned_crtc, &output_assignment);
}
output->n_possible_clones = xrandr_output->nclone;
diff --git a/backends/gf-output.c b/backends/gf-output.c
index 3251b54..28d34d8 100644
--- a/backends/gf-output.c
+++ b/backends/gf-output.c
@@ -225,9 +225,9 @@ gf_output_get_name (GfOutput *self)
}
void
-gf_output_assign_crtc (GfOutput *self,
- GfCrtc *crtc,
- const GfOutputInfo *output_info)
+gf_output_assign_crtc (GfOutput *self,
+ GfCrtc *crtc,
+ const GfOutputAssignment *output_assignment)
{
GfOutputPrivate *priv;
@@ -237,9 +237,9 @@ gf_output_assign_crtc (GfOutput *self,
g_set_object (&priv->crtc, crtc);
- priv->is_primary = output_info->is_primary;
- priv->is_presentation = output_info->is_presentation;
- priv->is_underscanning = output_info->is_underscanning;
+ priv->is_primary = output_assignment->is_primary;
+ priv->is_presentation = output_assignment->is_presentation;
+ priv->is_underscanning = output_assignment->is_underscanning;
}
void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]