monitor-manager/dummy: Define tile count instead of using array length
Explicitly define the tile count (2) and use this instead of the crtc_decl array length. https://bugzilla.gnome.org/show_bug.cgi?id=785381
This commit is contained in:
parent
5bb6f0ad8b
commit
39bc2e0333
@ -158,14 +158,7 @@ append_tiled_monitor (GArray *modes,
|
|||||||
.refresh_rate = 60.0
|
.refresh_rate = 60.0
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
MetaCrtc crtcs_decl[] = {
|
unsigned int n_tiles = 2;
|
||||||
{
|
|
||||||
.all_transforms = ALL_TRANSFORMS,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
.all_transforms = ALL_TRANSFORMS,
|
|
||||||
},
|
|
||||||
};
|
|
||||||
MetaOutput *output;
|
MetaOutput *output;
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
uint32_t tile_group_id;
|
uint32_t tile_group_id;
|
||||||
@ -174,12 +167,18 @@ append_tiled_monitor (GArray *modes,
|
|||||||
modes_decl[i].mode_id = modes->len + i;
|
modes_decl[i].mode_id = modes->len + i;
|
||||||
g_array_append_vals (modes, modes_decl, G_N_ELEMENTS (modes_decl));
|
g_array_append_vals (modes, modes_decl, G_N_ELEMENTS (modes_decl));
|
||||||
|
|
||||||
for (i = 0; i < G_N_ELEMENTS (crtcs_decl); i++)
|
for (i = 0; i < n_tiles; i++)
|
||||||
crtcs_decl[i].crtc_id = crtcs->len + i + 1;
|
{
|
||||||
g_array_append_vals (crtcs, crtcs_decl, G_N_ELEMENTS (crtcs_decl));
|
MetaCrtc crtc = {
|
||||||
|
.crtc_id = crtcs->len + i + 1,
|
||||||
|
.all_transforms = ALL_TRANSFORMS
|
||||||
|
};
|
||||||
|
|
||||||
|
g_array_append_val (crtcs, crtc);
|
||||||
|
}
|
||||||
|
|
||||||
tile_group_id = g_list_length (*outputs) + 1;
|
tile_group_id = g_list_length (*outputs) + 1;
|
||||||
for (i = 0; i < G_N_ELEMENTS (crtcs_decl); i++)
|
for (i = 0; i < n_tiles; i++)
|
||||||
{
|
{
|
||||||
MetaOutputDummy *output_dummy;
|
MetaOutputDummy *output_dummy;
|
||||||
MetaCrtcMode *preferred_mode;
|
MetaCrtcMode *preferred_mode;
|
||||||
@ -214,7 +213,7 @@ append_tiled_monitor (GArray *modes,
|
|||||||
output->connector_type = META_CONNECTOR_TYPE_LVDS;
|
output->connector_type = META_CONNECTOR_TYPE_LVDS;
|
||||||
output->tile_info = (MetaTileInfo) {
|
output->tile_info = (MetaTileInfo) {
|
||||||
.group_id = tile_group_id,
|
.group_id = tile_group_id,
|
||||||
.max_h_tiles = G_N_ELEMENTS (crtcs_decl),
|
.max_h_tiles = n_tiles,
|
||||||
.max_v_tiles = 1,
|
.max_v_tiles = 1,
|
||||||
.loc_h_tile = i,
|
.loc_h_tile = i,
|
||||||
.loc_v_tile = 0,
|
.loc_v_tile = 0,
|
||||||
@ -231,11 +230,11 @@ append_tiled_monitor (GArray *modes,
|
|||||||
modes->len - (j + 1));
|
modes->len - (j + 1));
|
||||||
output->n_modes = G_N_ELEMENTS (modes_decl);
|
output->n_modes = G_N_ELEMENTS (modes_decl);
|
||||||
|
|
||||||
output->possible_crtcs = g_new0 (MetaCrtc *, G_N_ELEMENTS (crtcs_decl));
|
output->possible_crtcs = g_new0 (MetaCrtc *, n_tiles);
|
||||||
for (j = 0; j < G_N_ELEMENTS (crtcs_decl); j++)
|
for (j = 0; j < n_tiles; j++)
|
||||||
output->possible_crtcs[j] = &g_array_index (crtcs, MetaCrtc,
|
output->possible_crtcs[j] = &g_array_index (crtcs, MetaCrtc,
|
||||||
crtcs->len - (j + 1));
|
crtcs->len - (j + 1));
|
||||||
output->n_possible_crtcs = G_N_ELEMENTS (crtcs_decl);
|
output->n_possible_crtcs = n_tiles;
|
||||||
|
|
||||||
*outputs = g_list_append (*outputs, output);
|
*outputs = g_list_append (*outputs, output);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user