2014-03-31 21:50:09 -04:00
|
|
|
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Copyright (C) 2001, 2002 Havoc Pennington
|
|
|
|
* Copyright (C) 2002, 2003 Red Hat Inc.
|
|
|
|
* Some ICCCM manager selection code derived from fvwm2,
|
|
|
|
* Copyright (C) 2001 Dominik Vogt, Matthias Clasen, and fvwm2 team
|
|
|
|
* Copyright (C) 2003 Rob Adams
|
|
|
|
* Copyright (C) 2004-2006 Elijah Newren
|
|
|
|
* Copyright (C) 2013 Red Hat Inc.
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License as
|
|
|
|
* published by the Free Software Foundation; either version 2 of the
|
|
|
|
* License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful, but
|
|
|
|
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "config.h"
|
|
|
|
|
2018-07-10 04:36:24 -04:00
|
|
|
#include "backends/meta-monitor-manager-dummy.h"
|
2014-03-31 21:50:09 -04:00
|
|
|
|
2015-03-30 06:33:21 -04:00
|
|
|
#include <stdlib.h>
|
|
|
|
|
2017-02-15 03:06:46 -05:00
|
|
|
#include "backends/meta-backend-private.h"
|
2017-03-28 00:35:19 -04:00
|
|
|
#include "backends/meta-crtc.h"
|
2017-06-05 03:59:47 -04:00
|
|
|
#include "backends/meta-monitor.h"
|
2017-01-09 01:31:18 -05:00
|
|
|
#include "backends/meta-monitor-config-manager.h"
|
2017-03-24 05:35:51 -04:00
|
|
|
#include "backends/meta-output.h"
|
2018-07-10 04:36:24 -04:00
|
|
|
#include "meta/util.h"
|
2015-03-30 06:33:21 -04:00
|
|
|
|
2014-07-10 17:39:47 -04:00
|
|
|
#define ALL_TRANSFORMS ((1 << (META_MONITOR_TRANSFORM_FLIPPED_270 + 1)) - 1)
|
2014-03-31 21:50:09 -04:00
|
|
|
|
2017-03-07 22:40:04 -05:00
|
|
|
#define MAX_MONITORS 5
|
|
|
|
#define MAX_OUTPUTS (MAX_MONITORS * 2)
|
|
|
|
#define MAX_CRTCS (MAX_MONITORS * 2)
|
|
|
|
#define MAX_MODES (MAX_MONITORS * 4)
|
|
|
|
|
2014-03-31 21:50:09 -04:00
|
|
|
struct _MetaMonitorManagerDummy
|
|
|
|
{
|
|
|
|
MetaMonitorManager parent_instance;
|
2017-03-08 03:08:49 -05:00
|
|
|
|
|
|
|
gboolean is_transform_handled;
|
2014-03-31 21:50:09 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
struct _MetaMonitorManagerDummyClass
|
|
|
|
{
|
|
|
|
MetaMonitorManagerClass parent_class;
|
|
|
|
};
|
|
|
|
|
2017-01-20 02:07:12 -05:00
|
|
|
typedef struct _MetaOutputDummy
|
|
|
|
{
|
2017-05-25 04:12:51 -04:00
|
|
|
float scale;
|
2017-01-20 02:07:12 -05:00
|
|
|
} MetaOutputDummy;
|
|
|
|
|
2014-03-31 21:50:09 -04:00
|
|
|
G_DEFINE_TYPE (MetaMonitorManagerDummy, meta_monitor_manager_dummy, META_TYPE_MONITOR_MANAGER);
|
|
|
|
|
2017-07-10 06:19:32 -04:00
|
|
|
struct _MetaGpuDummy
|
|
|
|
{
|
|
|
|
MetaGpu parent;
|
|
|
|
};
|
|
|
|
|
|
|
|
G_DEFINE_TYPE (MetaGpuDummy, meta_gpu_dummy, META_TYPE_GPU)
|
|
|
|
|
2017-01-20 02:07:12 -05:00
|
|
|
static void
|
|
|
|
meta_output_dummy_notify_destroy (MetaOutput *output);
|
|
|
|
|
2017-03-28 04:52:15 -04:00
|
|
|
typedef struct _CrtcModeSpec
|
|
|
|
{
|
|
|
|
int width;
|
|
|
|
int height;
|
|
|
|
float refresh_rate;
|
|
|
|
} CrtcModeSpec;
|
2018-11-21 04:17:54 -05:00
|
|
|
G_DEFINE_AUTOPTR_CLEANUP_FUNC(CrtcModeSpec, g_free);
|
2017-03-28 04:52:15 -04:00
|
|
|
|
|
|
|
static MetaCrtcMode *
|
|
|
|
create_mode (CrtcModeSpec *spec,
|
|
|
|
long mode_id)
|
|
|
|
{
|
|
|
|
MetaCrtcMode *mode;
|
|
|
|
|
|
|
|
mode = g_object_new (META_TYPE_CRTC_MODE, NULL);
|
|
|
|
|
|
|
|
mode->mode_id = mode_id;
|
|
|
|
mode->width = spec->width;
|
|
|
|
mode->height = spec->height;
|
|
|
|
mode->refresh_rate = spec->refresh_rate;
|
|
|
|
|
|
|
|
return mode;
|
|
|
|
}
|
2017-03-07 22:40:04 -05:00
|
|
|
|
2019-01-11 09:35:42 -05:00
|
|
|
static MetaGpu *
|
|
|
|
get_gpu (MetaMonitorManager *manager)
|
|
|
|
{
|
|
|
|
MetaBackend *backend = meta_monitor_manager_get_backend (manager);
|
|
|
|
|
|
|
|
return META_GPU (meta_backend_get_gpus (backend)->data);
|
|
|
|
}
|
|
|
|
|
2017-03-07 22:40:04 -05:00
|
|
|
static void
|
2017-07-03 23:56:18 -04:00
|
|
|
append_monitor (MetaMonitorManager *manager,
|
|
|
|
GList **modes,
|
|
|
|
GList **crtcs,
|
|
|
|
GList **outputs,
|
|
|
|
float scale)
|
2017-03-07 22:40:04 -05:00
|
|
|
{
|
2019-01-11 09:35:42 -05:00
|
|
|
MetaGpu *gpu = get_gpu (manager);
|
2018-11-21 04:17:54 -05:00
|
|
|
CrtcModeSpec default_specs[] = {
|
2017-03-07 22:58:44 -05:00
|
|
|
{
|
|
|
|
.width = 800,
|
|
|
|
.height = 600,
|
|
|
|
.refresh_rate = 60.0
|
|
|
|
},
|
|
|
|
{
|
|
|
|
.width = 1024,
|
|
|
|
.height = 768,
|
|
|
|
.refresh_rate = 60.0
|
2018-11-21 04:17:54 -05:00
|
|
|
},
|
|
|
|
{
|
|
|
|
.width = 1440,
|
|
|
|
.height = 900,
|
|
|
|
.refresh_rate = 60.0
|
|
|
|
},
|
|
|
|
{
|
|
|
|
.width = 1600,
|
|
|
|
.height = 920,
|
|
|
|
.refresh_rate = 60.0
|
|
|
|
},
|
2017-03-07 22:58:44 -05:00
|
|
|
};
|
2018-11-21 04:17:54 -05:00
|
|
|
g_autolist (CrtcModeSpec) mode_specs = NULL;
|
|
|
|
unsigned int n_mode_specs = 0;
|
2017-03-28 04:52:15 -04:00
|
|
|
GList *new_modes = NULL;
|
2017-03-28 00:35:19 -04:00
|
|
|
MetaCrtc *crtc;
|
2017-01-20 02:07:12 -05:00
|
|
|
MetaOutputDummy *output_dummy;
|
2017-03-24 05:35:51 -04:00
|
|
|
MetaOutput *output;
|
2017-03-07 22:58:44 -05:00
|
|
|
unsigned int i;
|
2017-03-24 05:35:51 -04:00
|
|
|
unsigned int number;
|
2018-11-21 04:17:54 -05:00
|
|
|
const char *mode_specs_str;
|
2017-03-28 04:52:15 -04:00
|
|
|
GList *l;
|
|
|
|
|
2019-04-09 07:08:21 -04:00
|
|
|
mode_specs_str = getenv ("MUTTER_DEBUG_DUMMY_MODE_SPECS");
|
2018-11-21 04:17:54 -05:00
|
|
|
if (mode_specs_str && *mode_specs_str != '\0')
|
|
|
|
{
|
|
|
|
g_auto (GStrv) specs = g_strsplit (mode_specs_str, ":", -1);
|
|
|
|
for (i = 0; specs[i]; ++i)
|
|
|
|
{
|
|
|
|
int width, height;
|
|
|
|
float refresh_rate = 60.0;
|
|
|
|
|
|
|
|
if (sscanf (specs[i], "%dx%d@%f",
|
|
|
|
&width, &height, &refresh_rate) == 3 ||
|
|
|
|
sscanf (specs[i], "%dx%d",
|
|
|
|
&width, &height) == 2)
|
|
|
|
{
|
|
|
|
CrtcModeSpec *spec;
|
|
|
|
|
|
|
|
if (width < META_MONITOR_MANAGER_MIN_SCREEN_WIDTH ||
|
|
|
|
height < META_MONITOR_MANAGER_MIN_SCREEN_HEIGHT)
|
|
|
|
continue;
|
|
|
|
|
|
|
|
spec = g_new0 (CrtcModeSpec, 1);
|
|
|
|
spec->width = width;
|
|
|
|
spec->height = height;
|
|
|
|
spec->refresh_rate = refresh_rate;
|
|
|
|
mode_specs = g_list_prepend (mode_specs, spec);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2019-04-09 04:50:28 -04:00
|
|
|
else
|
|
|
|
{
|
|
|
|
for (i = 0; i < G_N_ELEMENTS (default_specs); i++)
|
|
|
|
{
|
|
|
|
CrtcModeSpec *spec;
|
|
|
|
|
|
|
|
spec = g_memdup (&default_specs[i], sizeof (CrtcModeSpec));
|
|
|
|
mode_specs = g_list_prepend (mode_specs, spec);
|
|
|
|
}
|
|
|
|
}
|
2018-11-21 04:17:54 -05:00
|
|
|
|
|
|
|
for (l = mode_specs; l; l = l->next)
|
|
|
|
{
|
|
|
|
CrtcModeSpec *spec = l->data;
|
2017-03-28 04:52:15 -04:00
|
|
|
long mode_id;
|
|
|
|
MetaCrtcMode *mode;
|
2017-03-07 22:40:04 -05:00
|
|
|
|
2018-11-21 04:17:54 -05:00
|
|
|
mode_id = g_list_length (*modes) + n_mode_specs + 1;
|
|
|
|
mode = create_mode (spec, mode_id);
|
2017-03-28 04:52:15 -04:00
|
|
|
|
|
|
|
new_modes = g_list_append (new_modes, mode);
|
2018-11-21 04:17:54 -05:00
|
|
|
n_mode_specs++;
|
2017-03-28 04:52:15 -04:00
|
|
|
}
|
|
|
|
*modes = g_list_concat (*modes, new_modes);
|
2017-03-07 22:40:04 -05:00
|
|
|
|
2020-02-25 04:39:56 -05:00
|
|
|
crtc = g_object_new (META_TYPE_CRTC,
|
2020-02-25 05:34:43 -05:00
|
|
|
"id", g_list_length (*crtcs) + 1,
|
2020-02-25 04:39:56 -05:00
|
|
|
"gpu", gpu,
|
|
|
|
NULL);
|
2017-03-28 00:35:19 -04:00
|
|
|
crtc->all_transforms = ALL_TRANSFORMS;
|
|
|
|
*crtcs = g_list_append (*crtcs, crtc);
|
2017-03-07 22:40:04 -05:00
|
|
|
|
2020-02-25 10:13:52 -05:00
|
|
|
number = g_list_length (*outputs) + 1;
|
|
|
|
|
2020-02-25 04:54:40 -05:00
|
|
|
output = g_object_new (META_TYPE_OUTPUT,
|
2020-02-25 10:13:52 -05:00
|
|
|
"id", number,
|
2020-02-25 04:54:40 -05:00
|
|
|
"gpu", gpu,
|
|
|
|
NULL);
|
2017-03-24 05:35:51 -04:00
|
|
|
|
2017-01-20 02:07:12 -05:00
|
|
|
output_dummy = g_new0 (MetaOutputDummy, 1);
|
|
|
|
*output_dummy = (MetaOutputDummy) {
|
|
|
|
.scale = scale
|
|
|
|
};
|
|
|
|
|
2017-03-24 05:35:51 -04:00
|
|
|
output->name = g_strdup_printf ("LVDS%d", number);
|
|
|
|
output->vendor = g_strdup ("MetaProducts Inc.");
|
|
|
|
output->product = g_strdup ("MetaMonitor");
|
|
|
|
output->serial = g_strdup_printf ("0xC0FFEE-%d", number);
|
|
|
|
output->suggested_x = -1;
|
|
|
|
output->suggested_y = -1;
|
|
|
|
output->width_mm = 222;
|
|
|
|
output->height_mm = 125;
|
|
|
|
output->subpixel_order = COGL_SUBPIXEL_ORDER_UNKNOWN;
|
2017-03-28 04:52:15 -04:00
|
|
|
output->preferred_mode = g_list_last (*modes)->data;
|
2017-03-24 05:35:51 -04:00
|
|
|
output->n_possible_clones = 0;
|
|
|
|
output->connector_type = META_CONNECTOR_TYPE_LVDS;
|
|
|
|
output->driver_private = output_dummy;
|
|
|
|
output->driver_notify =
|
|
|
|
(GDestroyNotify) meta_output_dummy_notify_destroy;
|
|
|
|
|
2018-11-21 04:17:54 -05:00
|
|
|
output->modes = g_new0 (MetaCrtcMode *, n_mode_specs);
|
2017-03-28 04:52:15 -04:00
|
|
|
for (l = new_modes, i = 0; l; l = l->next, i++)
|
|
|
|
{
|
|
|
|
MetaCrtcMode *mode = l->data;
|
|
|
|
|
|
|
|
output->modes[i] = mode;
|
|
|
|
}
|
2018-11-21 04:17:54 -05:00
|
|
|
output->n_modes = n_mode_specs;
|
2017-03-24 05:35:51 -04:00
|
|
|
output->possible_crtcs = g_new0 (MetaCrtc *, 1);
|
2017-03-28 00:35:19 -04:00
|
|
|
output->possible_crtcs[0] = g_list_last (*crtcs)->data;
|
2017-03-24 05:35:51 -04:00
|
|
|
output->n_possible_crtcs = 1;
|
|
|
|
|
|
|
|
*outputs = g_list_append (*outputs, output);
|
2017-03-07 22:40:04 -05:00
|
|
|
}
|
|
|
|
|
2017-03-08 01:14:16 -05:00
|
|
|
static void
|
2017-07-03 23:56:18 -04:00
|
|
|
append_tiled_monitor (MetaMonitorManager *manager,
|
|
|
|
GList **modes,
|
|
|
|
GList **crtcs,
|
|
|
|
GList **outputs,
|
|
|
|
int scale)
|
2017-03-08 01:14:16 -05:00
|
|
|
{
|
2019-01-11 09:35:42 -05:00
|
|
|
MetaGpu *gpu = get_gpu (manager);
|
2017-03-28 04:52:15 -04:00
|
|
|
CrtcModeSpec mode_specs[] = {
|
2017-03-08 01:14:16 -05:00
|
|
|
{
|
|
|
|
.width = 800,
|
|
|
|
.height = 600,
|
|
|
|
.refresh_rate = 60.0
|
|
|
|
},
|
|
|
|
{
|
|
|
|
.width = 512,
|
|
|
|
.height = 768,
|
|
|
|
.refresh_rate = 60.0
|
|
|
|
}
|
|
|
|
};
|
2017-03-28 00:29:16 -04:00
|
|
|
unsigned int n_tiles = 2;
|
2017-03-28 04:52:15 -04:00
|
|
|
GList *new_modes = NULL;
|
2017-03-28 00:35:19 -04:00
|
|
|
GList *new_crtcs = NULL;
|
2017-03-24 05:35:51 -04:00
|
|
|
MetaOutput *output;
|
2017-03-08 01:14:16 -05:00
|
|
|
unsigned int i;
|
|
|
|
uint32_t tile_group_id;
|
|
|
|
|
2017-03-28 04:52:15 -04:00
|
|
|
for (i = 0; i < G_N_ELEMENTS (mode_specs); i++)
|
|
|
|
{
|
|
|
|
long mode_id;
|
|
|
|
MetaCrtcMode *mode;
|
|
|
|
|
|
|
|
mode_id = g_list_length (*modes) + i + 1;
|
|
|
|
mode = create_mode (&mode_specs[i], mode_id);
|
|
|
|
|
|
|
|
new_modes = g_list_append (new_modes, mode);
|
|
|
|
}
|
|
|
|
*modes = g_list_concat (*modes, new_modes);
|
2017-03-08 01:14:16 -05:00
|
|
|
|
2017-03-28 00:29:16 -04:00
|
|
|
for (i = 0; i < n_tiles; i++)
|
|
|
|
{
|
2017-03-28 00:35:19 -04:00
|
|
|
MetaCrtc *crtc;
|
2017-03-28 00:29:16 -04:00
|
|
|
|
2020-02-25 04:39:56 -05:00
|
|
|
crtc = g_object_new (META_TYPE_CRTC,
|
2020-02-25 05:34:43 -05:00
|
|
|
"id", g_list_length (*crtcs) + i + 1,
|
2020-02-25 04:39:56 -05:00
|
|
|
"gpu", gpu,
|
|
|
|
NULL);
|
2017-03-28 00:35:19 -04:00
|
|
|
crtc->all_transforms = ALL_TRANSFORMS;
|
|
|
|
new_crtcs = g_list_append (new_crtcs, crtc);
|
2017-03-28 00:29:16 -04:00
|
|
|
}
|
2017-03-28 00:35:19 -04:00
|
|
|
*crtcs = g_list_concat (*crtcs, new_crtcs);
|
2017-03-08 01:14:16 -05:00
|
|
|
|
2017-03-24 05:35:51 -04:00
|
|
|
tile_group_id = g_list_length (*outputs) + 1;
|
2017-03-28 00:29:16 -04:00
|
|
|
for (i = 0; i < n_tiles; i++)
|
2017-03-08 01:14:16 -05:00
|
|
|
{
|
2017-01-20 02:07:12 -05:00
|
|
|
MetaOutputDummy *output_dummy;
|
2017-03-08 01:14:16 -05:00
|
|
|
MetaCrtcMode *preferred_mode;
|
|
|
|
unsigned int j;
|
2017-03-24 05:35:51 -04:00
|
|
|
unsigned int number;
|
2017-03-28 00:35:19 -04:00
|
|
|
GList *l;
|
2017-03-08 01:14:16 -05:00
|
|
|
|
2017-01-20 02:07:12 -05:00
|
|
|
output_dummy = g_new0 (MetaOutputDummy, 1);
|
|
|
|
*output_dummy = (MetaOutputDummy) {
|
|
|
|
.scale = scale
|
|
|
|
};
|
|
|
|
|
2017-03-24 05:35:51 -04:00
|
|
|
/* Arbitrary ID unique for this output */
|
|
|
|
number = g_list_length (*outputs) + 1;
|
|
|
|
|
2017-03-28 04:52:15 -04:00
|
|
|
preferred_mode = g_list_last (*modes)->data;
|
2017-03-24 05:35:51 -04:00
|
|
|
|
2020-02-25 04:54:40 -05:00
|
|
|
output = g_object_new (META_TYPE_OUTPUT,
|
2020-02-25 10:13:52 -05:00
|
|
|
"id", number,
|
2020-02-25 04:54:40 -05:00
|
|
|
"gpu", gpu,
|
|
|
|
NULL);
|
2017-03-24 05:35:51 -04:00
|
|
|
|
|
|
|
output->name = g_strdup_printf ("LVDS%d", number);
|
|
|
|
output->vendor = g_strdup ("MetaProducts Inc.");
|
|
|
|
output->product = g_strdup ("MetaMonitor");
|
|
|
|
output->serial = g_strdup_printf ("0xC0FFEE-%d", number);
|
|
|
|
output->suggested_x = -1;
|
|
|
|
output->suggested_y = -1;
|
|
|
|
output->width_mm = 222;
|
|
|
|
output->height_mm = 125;
|
|
|
|
output->subpixel_order = COGL_SUBPIXEL_ORDER_UNKNOWN;
|
|
|
|
output->preferred_mode = preferred_mode;
|
|
|
|
output->n_possible_clones = 0;
|
|
|
|
output->connector_type = META_CONNECTOR_TYPE_LVDS;
|
|
|
|
output->tile_info = (MetaTileInfo) {
|
|
|
|
.group_id = tile_group_id,
|
2017-03-28 00:29:16 -04:00
|
|
|
.max_h_tiles = n_tiles,
|
2017-03-24 05:35:51 -04:00
|
|
|
.max_v_tiles = 1,
|
|
|
|
.loc_h_tile = i,
|
|
|
|
.loc_v_tile = 0,
|
|
|
|
.tile_w = preferred_mode->width,
|
|
|
|
.tile_h = preferred_mode->height
|
|
|
|
},
|
|
|
|
output->driver_private = output_dummy;
|
|
|
|
output->driver_notify =
|
|
|
|
(GDestroyNotify) meta_output_dummy_notify_destroy;
|
|
|
|
|
2017-03-28 04:52:15 -04:00
|
|
|
output->modes = g_new0 (MetaCrtcMode *, G_N_ELEMENTS (mode_specs));
|
|
|
|
for (l = new_modes, j = 0; l; l = l->next, j++)
|
|
|
|
{
|
|
|
|
MetaCrtcMode *mode = l->data;
|
|
|
|
|
|
|
|
output->modes[j] = mode;
|
|
|
|
}
|
|
|
|
output->n_modes = G_N_ELEMENTS (mode_specs);
|
2017-03-08 01:14:16 -05:00
|
|
|
|
2017-03-28 00:29:16 -04:00
|
|
|
output->possible_crtcs = g_new0 (MetaCrtc *, n_tiles);
|
2017-03-28 00:35:19 -04:00
|
|
|
for (l = new_crtcs, j = 0; l; l = l->next, j++)
|
|
|
|
{
|
|
|
|
MetaCrtc *crtc = l->data;
|
|
|
|
|
|
|
|
output->possible_crtcs[j] = crtc;
|
|
|
|
}
|
2017-03-28 00:29:16 -04:00
|
|
|
output->n_possible_crtcs = n_tiles;
|
2017-03-08 01:14:16 -05:00
|
|
|
|
2017-03-24 05:35:51 -04:00
|
|
|
*outputs = g_list_append (*outputs, output);
|
2017-03-08 01:14:16 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-01-20 02:07:12 -05:00
|
|
|
static void
|
|
|
|
meta_output_dummy_notify_destroy (MetaOutput *output)
|
|
|
|
{
|
|
|
|
g_clear_pointer (&output->driver_private, g_free);
|
|
|
|
}
|
|
|
|
|
2014-03-31 21:50:09 -04:00
|
|
|
static void
|
|
|
|
meta_monitor_manager_dummy_read_current (MetaMonitorManager *manager)
|
|
|
|
{
|
2019-01-11 09:35:42 -05:00
|
|
|
MetaGpu *gpu = get_gpu (manager);
|
2015-03-30 06:33:21 -04:00
|
|
|
unsigned int num_monitors = 1;
|
2017-05-25 04:12:51 -04:00
|
|
|
float *monitor_scales = NULL;
|
2015-03-30 06:33:21 -04:00
|
|
|
const char *num_monitors_str;
|
|
|
|
const char *monitor_scales_str;
|
2017-03-08 01:14:16 -05:00
|
|
|
const char *tiled_monitors_str;
|
|
|
|
gboolean tiled_monitors;
|
2015-03-30 06:33:21 -04:00
|
|
|
unsigned int i;
|
2017-03-24 05:35:51 -04:00
|
|
|
GList *outputs;
|
2017-03-28 00:35:19 -04:00
|
|
|
GList *crtcs;
|
2017-03-28 04:52:15 -04:00
|
|
|
GList *modes;
|
2015-03-30 06:33:21 -04:00
|
|
|
|
|
|
|
/* To control what monitor configuration is generated, there are two available
|
|
|
|
* environmental variables that can be used:
|
|
|
|
*
|
|
|
|
* MUTTER_DEBUG_NUM_DUMMY_MONITORS
|
|
|
|
*
|
|
|
|
* Specifies the number of dummy monitors to include in the stage. Every
|
|
|
|
* monitor is 1024x786 pixels and they are placed on a horizontal row.
|
|
|
|
*
|
2019-04-09 07:08:21 -04:00
|
|
|
* MUTTER_DEBUG_DUMMY_MODE_SPECS
|
2018-11-21 04:17:54 -05:00
|
|
|
*
|
2019-04-09 07:08:21 -04:00
|
|
|
* A colon separated list of mode specifications that can be used to
|
|
|
|
* configure the monitor via dbus API. Setting this environment variable
|
|
|
|
* overrides the default set of modes available.
|
2018-11-21 04:17:54 -05:00
|
|
|
* Format should be WWxHH:WWxHH@RR
|
|
|
|
*
|
2015-03-30 06:33:21 -04:00
|
|
|
* MUTTER_DEBUG_DUMMY_MONITOR_SCALES
|
|
|
|
*
|
|
|
|
* A comma separated list that specifies the scales of the dummy monitors.
|
|
|
|
*
|
2017-03-08 01:14:16 -05:00
|
|
|
* MUTTER_DEBUG_TILED_DUMMY_MONITORS
|
|
|
|
*
|
|
|
|
* If set to "1" the dummy monitors will emulate being tiled, i.e. each have a
|
|
|
|
* unique tile group id, made up of multiple outputs and CRTCs.
|
|
|
|
*
|
2015-03-30 06:33:21 -04:00
|
|
|
* For example the following configuration results in two monitors, where the
|
|
|
|
* first one has the monitor scale 1, and the other the monitor scale 2.
|
|
|
|
*
|
|
|
|
* MUTTER_DEBUG_NUM_DUMMY_MONITORS=2
|
|
|
|
* MUTTER_DEBUG_DUMMY_MONITOR_SCALES=1,2
|
2017-03-08 01:14:16 -05:00
|
|
|
* MUTTER_DEBUG_TILED_DUMMY_MONITORS=1
|
2015-03-30 06:33:21 -04:00
|
|
|
*/
|
|
|
|
num_monitors_str = getenv ("MUTTER_DEBUG_NUM_DUMMY_MONITORS");
|
|
|
|
if (num_monitors_str)
|
|
|
|
{
|
|
|
|
num_monitors = g_ascii_strtoll (num_monitors_str, NULL, 10);
|
|
|
|
if (num_monitors <= 0)
|
|
|
|
{
|
|
|
|
meta_warning ("Invalid number of dummy monitors");
|
|
|
|
num_monitors = 1;
|
|
|
|
}
|
2017-03-07 22:40:04 -05:00
|
|
|
|
|
|
|
if (num_monitors > MAX_MONITORS)
|
|
|
|
{
|
|
|
|
meta_warning ("Clamping monitor count to max (%d)",
|
|
|
|
MAX_MONITORS);
|
|
|
|
num_monitors = MAX_MONITORS;
|
|
|
|
}
|
2015-03-30 06:33:21 -04:00
|
|
|
}
|
|
|
|
|
2017-05-25 04:12:51 -04:00
|
|
|
monitor_scales = g_newa (typeof (*monitor_scales), num_monitors);
|
2015-03-30 06:33:21 -04:00
|
|
|
for (i = 0; i < num_monitors; i++)
|
2017-05-25 04:12:51 -04:00
|
|
|
monitor_scales[i] = 1.0;
|
2015-03-30 06:33:21 -04:00
|
|
|
|
|
|
|
monitor_scales_str = getenv ("MUTTER_DEBUG_DUMMY_MONITOR_SCALES");
|
|
|
|
if (monitor_scales_str)
|
|
|
|
{
|
|
|
|
gchar **scales_str_list;
|
|
|
|
|
|
|
|
scales_str_list = g_strsplit (monitor_scales_str, ",", -1);
|
|
|
|
if (g_strv_length (scales_str_list) != num_monitors)
|
|
|
|
meta_warning ("Number of specified monitor scales differ from number "
|
|
|
|
"of monitors (defaults to 1).\n");
|
|
|
|
for (i = 0; i < num_monitors && scales_str_list[i]; i++)
|
|
|
|
{
|
2017-05-25 04:12:51 -04:00
|
|
|
float scale = g_ascii_strtod (scales_str_list[i], NULL);
|
2017-06-05 03:59:47 -04:00
|
|
|
|
|
|
|
monitor_scales[i] = scale;
|
2015-03-30 06:33:21 -04:00
|
|
|
}
|
|
|
|
g_strfreev (scales_str_list);
|
|
|
|
}
|
|
|
|
|
2017-03-08 01:14:16 -05:00
|
|
|
tiled_monitors_str = g_getenv ("MUTTER_DEBUG_TILED_DUMMY_MONITORS");
|
|
|
|
tiled_monitors = g_strcmp0 (tiled_monitors_str, "1") == 0;
|
|
|
|
|
2017-03-28 04:52:15 -04:00
|
|
|
modes = NULL;
|
2017-03-28 00:35:19 -04:00
|
|
|
crtcs = NULL;
|
2017-03-24 05:35:51 -04:00
|
|
|
outputs = NULL;
|
2015-03-30 06:33:21 -04:00
|
|
|
|
|
|
|
for (i = 0; i < num_monitors; i++)
|
2017-03-08 01:14:16 -05:00
|
|
|
{
|
|
|
|
if (tiled_monitors)
|
2017-07-03 23:56:18 -04:00
|
|
|
append_tiled_monitor (manager,
|
|
|
|
&modes, &crtcs, &outputs, monitor_scales[i]);
|
2017-03-08 01:14:16 -05:00
|
|
|
else
|
2017-07-03 23:56:18 -04:00
|
|
|
append_monitor (manager, &modes, &crtcs, &outputs, monitor_scales[i]);
|
2017-03-08 01:14:16 -05:00
|
|
|
}
|
2017-03-07 22:40:04 -05:00
|
|
|
|
2017-07-10 06:19:32 -04:00
|
|
|
meta_gpu_take_modes (gpu, modes);
|
|
|
|
meta_gpu_take_crtcs (gpu, crtcs);
|
|
|
|
meta_gpu_take_outputs (gpu, outputs);
|
2014-03-31 21:50:09 -04:00
|
|
|
}
|
|
|
|
|
2017-01-06 00:27:21 -05:00
|
|
|
static void
|
|
|
|
meta_monitor_manager_dummy_ensure_initial_config (MetaMonitorManager *manager)
|
|
|
|
{
|
2017-01-09 01:31:18 -05:00
|
|
|
MetaMonitorsConfig *config;
|
2017-01-06 00:27:21 -05:00
|
|
|
|
2017-01-09 01:31:18 -05:00
|
|
|
config = meta_monitor_manager_ensure_configured (manager);
|
|
|
|
|
2017-03-24 03:36:12 -04:00
|
|
|
if (meta_is_stage_views_enabled ())
|
|
|
|
meta_monitor_manager_update_logical_state (manager, config);
|
2017-01-09 01:31:18 -05:00
|
|
|
else
|
2017-09-11 02:10:26 -04:00
|
|
|
meta_monitor_manager_update_logical_state_derived (manager, NULL);
|
2017-01-06 00:27:21 -05:00
|
|
|
}
|
|
|
|
|
2014-03-31 21:50:09 -04:00
|
|
|
static void
|
2020-02-25 14:30:46 -05:00
|
|
|
apply_crtc_assignments (MetaMonitorManager *manager,
|
|
|
|
MetaCrtcAssignment **crtcs,
|
|
|
|
unsigned int n_crtcs,
|
|
|
|
MetaOutputAssignment **outputs,
|
|
|
|
unsigned int n_outputs)
|
2014-03-31 21:50:09 -04:00
|
|
|
{
|
2020-02-25 10:54:20 -05:00
|
|
|
g_autoptr (GList) to_configure_outputs = NULL;
|
|
|
|
g_autoptr (GList) to_configure_crtcs = NULL;
|
2017-01-09 01:31:18 -05:00
|
|
|
unsigned i;
|
2014-03-31 21:50:09 -04:00
|
|
|
|
2020-02-25 10:54:20 -05:00
|
|
|
to_configure_outputs = g_list_copy (meta_gpu_get_outputs (get_gpu (manager)));
|
|
|
|
to_configure_crtcs = g_list_copy (meta_gpu_get_crtcs (get_gpu (manager)));
|
|
|
|
|
2014-03-31 21:50:09 -04:00
|
|
|
for (i = 0; i < n_crtcs; i++)
|
|
|
|
{
|
2020-02-25 14:30:46 -05:00
|
|
|
MetaCrtcAssignment *crtc_assignment = crtcs[i];
|
|
|
|
MetaCrtc *crtc = crtc_assignment->crtc;
|
2020-02-25 10:54:20 -05:00
|
|
|
|
|
|
|
to_configure_crtcs = g_list_remove (to_configure_crtcs, crtc);
|
2014-03-31 21:50:09 -04:00
|
|
|
|
2020-02-25 14:30:46 -05:00
|
|
|
if (crtc_assignment->mode == NULL)
|
2014-03-31 21:50:09 -04:00
|
|
|
{
|
2020-01-14 16:34:44 -05:00
|
|
|
meta_crtc_unset_config (crtc);
|
2014-03-31 21:50:09 -04:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2015-09-23 19:24:33 -04:00
|
|
|
unsigned int j;
|
2014-03-31 21:50:09 -04:00
|
|
|
|
2020-01-14 16:34:44 -05:00
|
|
|
meta_crtc_set_config (crtc,
|
2020-02-25 14:30:46 -05:00
|
|
|
&crtc_assignment->layout,
|
|
|
|
crtc_assignment->mode,
|
|
|
|
crtc_assignment->transform);
|
2014-03-31 21:50:09 -04:00
|
|
|
|
2020-02-25 14:30:46 -05:00
|
|
|
for (j = 0; j < crtc_assignment->outputs->len; j++)
|
2014-03-31 21:50:09 -04:00
|
|
|
{
|
2020-02-25 12:37:21 -05:00
|
|
|
MetaOutput *output;
|
2020-02-25 14:30:46 -05:00
|
|
|
MetaOutputAssignment *output_assignment;
|
2020-02-25 12:37:21 -05:00
|
|
|
|
2020-02-25 14:30:46 -05:00
|
|
|
output = ((MetaOutput**) crtc_assignment->outputs->pdata)[j];
|
2014-03-31 21:50:09 -04:00
|
|
|
|
2020-02-25 10:54:20 -05:00
|
|
|
to_configure_outputs = g_list_remove (to_configure_outputs,
|
|
|
|
output);
|
2020-02-25 12:37:21 -05:00
|
|
|
|
2020-02-25 14:30:46 -05:00
|
|
|
output_assignment = meta_find_output_assignment (outputs,
|
|
|
|
n_outputs,
|
|
|
|
output);
|
|
|
|
meta_output_assign_crtc (output, crtc, output_assignment);
|
2014-03-31 21:50:09 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-02-25 12:37:21 -05:00
|
|
|
g_list_foreach (to_configure_crtcs,
|
|
|
|
(GFunc) meta_crtc_unset_config,
|
|
|
|
NULL);
|
|
|
|
g_list_foreach (to_configure_outputs,
|
|
|
|
(GFunc) meta_output_unassign_crtc,
|
|
|
|
NULL);
|
2017-02-24 05:01:17 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
update_screen_size (MetaMonitorManager *manager,
|
|
|
|
MetaMonitorsConfig *config)
|
|
|
|
{
|
|
|
|
GList *l;
|
|
|
|
int screen_width = 0;
|
|
|
|
int screen_height = 0;
|
|
|
|
|
|
|
|
for (l = config->logical_monitor_configs; l; l = l->next)
|
|
|
|
{
|
|
|
|
MetaLogicalMonitorConfig *logical_monitor_config = l->data;
|
|
|
|
int right_edge;
|
|
|
|
int bottom_edge;
|
|
|
|
|
|
|
|
right_edge = (logical_monitor_config->layout.width +
|
|
|
|
logical_monitor_config->layout.x);
|
|
|
|
if (right_edge > screen_width)
|
|
|
|
screen_width = right_edge;
|
|
|
|
|
|
|
|
bottom_edge = (logical_monitor_config->layout.height +
|
|
|
|
logical_monitor_config->layout.y);
|
|
|
|
if (bottom_edge > screen_height)
|
|
|
|
screen_height = bottom_edge;
|
|
|
|
}
|
2014-03-31 21:50:09 -04:00
|
|
|
|
|
|
|
manager->screen_width = screen_width;
|
|
|
|
manager->screen_height = screen_height;
|
2017-01-09 01:31:18 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
static gboolean
|
2017-02-14 06:54:04 -05:00
|
|
|
meta_monitor_manager_dummy_apply_monitors_config (MetaMonitorManager *manager,
|
|
|
|
MetaMonitorsConfig *config,
|
|
|
|
MetaMonitorsConfigMethod method,
|
|
|
|
GError **error)
|
2017-01-09 01:31:18 -05:00
|
|
|
{
|
2020-02-25 14:30:46 -05:00
|
|
|
GPtrArray *crtc_assignments;
|
|
|
|
GPtrArray *output_assignments;
|
2017-01-09 01:31:18 -05:00
|
|
|
|
2017-01-20 01:50:11 -05:00
|
|
|
if (!config)
|
|
|
|
{
|
2017-04-12 02:15:33 -04:00
|
|
|
manager->screen_width = META_MONITOR_MANAGER_MIN_SCREEN_WIDTH;
|
|
|
|
manager->screen_height = META_MONITOR_MANAGER_MIN_SCREEN_HEIGHT;
|
2017-01-20 01:50:11 -05:00
|
|
|
|
|
|
|
meta_monitor_manager_rebuild (manager, NULL);
|
2017-04-12 02:15:33 -04:00
|
|
|
return TRUE;
|
2017-01-20 01:50:11 -05:00
|
|
|
}
|
|
|
|
|
2017-01-09 01:31:18 -05:00
|
|
|
if (!meta_monitor_config_manager_assign (manager, config,
|
2020-02-25 14:30:46 -05:00
|
|
|
&crtc_assignments,
|
|
|
|
&output_assignments,
|
2017-01-09 01:31:18 -05:00
|
|
|
error))
|
|
|
|
return FALSE;
|
|
|
|
|
2017-02-14 06:54:04 -05:00
|
|
|
if (method == META_MONITORS_CONFIG_METHOD_VERIFY)
|
|
|
|
{
|
2020-02-25 14:30:46 -05:00
|
|
|
g_ptr_array_free (crtc_assignments, TRUE);
|
|
|
|
g_ptr_array_free (output_assignments, TRUE);
|
2017-02-14 06:54:04 -05:00
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2017-01-09 01:31:18 -05:00
|
|
|
apply_crtc_assignments (manager,
|
2020-02-25 14:30:46 -05:00
|
|
|
(MetaCrtcAssignment **) crtc_assignments->pdata,
|
|
|
|
crtc_assignments->len,
|
|
|
|
(MetaOutputAssignment **) output_assignments->pdata,
|
|
|
|
output_assignments->len);
|
2017-01-09 01:31:18 -05:00
|
|
|
|
2020-02-25 14:30:46 -05:00
|
|
|
g_ptr_array_free (crtc_assignments, TRUE);
|
|
|
|
g_ptr_array_free (output_assignments, TRUE);
|
2017-01-09 01:31:18 -05:00
|
|
|
|
2017-02-24 05:01:17 -05:00
|
|
|
update_screen_size (manager, config);
|
2017-01-09 01:31:18 -05:00
|
|
|
meta_monitor_manager_rebuild (manager, config);
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2017-03-08 03:05:00 -05:00
|
|
|
static gboolean
|
|
|
|
meta_monitor_manager_dummy_is_transform_handled (MetaMonitorManager *manager,
|
|
|
|
MetaCrtc *crtc,
|
|
|
|
MetaMonitorTransform transform)
|
|
|
|
{
|
2017-03-08 03:08:49 -05:00
|
|
|
MetaMonitorManagerDummy *manager_dummy = META_MONITOR_MANAGER_DUMMY (manager);
|
|
|
|
|
|
|
|
return manager_dummy->is_transform_handled;
|
2017-03-08 03:05:00 -05:00
|
|
|
}
|
|
|
|
|
2017-05-25 04:12:51 -04:00
|
|
|
static float
|
2017-01-20 02:07:12 -05:00
|
|
|
meta_monitor_manager_dummy_calculate_monitor_mode_scale (MetaMonitorManager *manager,
|
|
|
|
MetaMonitor *monitor,
|
|
|
|
MetaMonitorMode *monitor_mode)
|
|
|
|
{
|
|
|
|
MetaOutput *output;
|
|
|
|
MetaOutputDummy *output_dummy;
|
|
|
|
|
|
|
|
output = meta_monitor_get_main_output (monitor);
|
|
|
|
output_dummy = output->driver_private;
|
|
|
|
|
|
|
|
return output_dummy->scale;
|
|
|
|
}
|
|
|
|
|
2017-06-05 03:59:47 -04:00
|
|
|
static float *
|
2019-03-08 13:03:57 -05:00
|
|
|
meta_monitor_manager_dummy_calculate_supported_scales (MetaMonitorManager *manager,
|
|
|
|
MetaLogicalMonitorLayoutMode layout_mode,
|
|
|
|
MetaMonitor *monitor,
|
|
|
|
MetaMonitorMode *monitor_mode,
|
|
|
|
int *n_supported_scales)
|
2017-01-26 04:14:32 -05:00
|
|
|
{
|
2017-06-05 03:59:47 -04:00
|
|
|
MetaMonitorScalesConstraint constraints =
|
|
|
|
META_MONITOR_SCALES_CONSTRAINT_NONE;
|
|
|
|
|
2017-05-25 05:20:59 -04:00
|
|
|
switch (layout_mode)
|
|
|
|
{
|
|
|
|
case META_LOGICAL_MONITOR_LAYOUT_MODE_LOGICAL:
|
|
|
|
break;
|
|
|
|
case META_LOGICAL_MONITOR_LAYOUT_MODE_PHYSICAL:
|
2017-06-05 03:59:47 -04:00
|
|
|
constraints |= META_MONITOR_SCALES_CONSTRAINT_NO_FRAC;
|
2017-05-25 05:20:59 -04:00
|
|
|
break;
|
|
|
|
}
|
2017-06-05 03:59:47 -04:00
|
|
|
|
|
|
|
return meta_monitor_calculate_supported_scales (monitor, monitor_mode,
|
|
|
|
constraints,
|
|
|
|
n_supported_scales);
|
2017-01-26 04:14:32 -05:00
|
|
|
}
|
|
|
|
|
2017-02-24 05:10:52 -05:00
|
|
|
static gboolean
|
|
|
|
is_monitor_framebuffers_scaled (void)
|
|
|
|
{
|
|
|
|
MetaBackend *backend = meta_get_backend ();
|
2017-04-21 04:40:51 -04:00
|
|
|
MetaSettings *settings = meta_backend_get_settings (backend);
|
2017-02-24 05:10:52 -05:00
|
|
|
|
2017-04-21 04:40:51 -04:00
|
|
|
return meta_settings_is_experimental_feature_enabled (
|
|
|
|
settings,
|
2017-02-24 05:10:52 -05:00
|
|
|
META_EXPERIMENTAL_FEATURE_SCALE_MONITOR_FRAMEBUFFER);
|
|
|
|
}
|
|
|
|
|
2017-02-07 03:01:40 -05:00
|
|
|
static MetaMonitorManagerCapability
|
|
|
|
meta_monitor_manager_dummy_get_capabilities (MetaMonitorManager *manager)
|
|
|
|
{
|
2017-04-21 04:40:51 -04:00
|
|
|
MetaBackend *backend = meta_get_backend ();
|
|
|
|
MetaSettings *settings = meta_backend_get_settings (backend);
|
2017-02-24 05:10:52 -05:00
|
|
|
MetaMonitorManagerCapability capabilities =
|
|
|
|
META_MONITOR_MANAGER_CAPABILITY_NONE;
|
|
|
|
|
2017-04-21 04:40:51 -04:00
|
|
|
if (meta_settings_is_experimental_feature_enabled (
|
|
|
|
settings,
|
2017-02-24 05:10:52 -05:00
|
|
|
META_EXPERIMENTAL_FEATURE_SCALE_MONITOR_FRAMEBUFFER))
|
|
|
|
capabilities |= META_MONITOR_MANAGER_CAPABILITY_LAYOUT_MODE;
|
|
|
|
|
|
|
|
return capabilities;
|
2017-02-07 03:01:40 -05:00
|
|
|
}
|
|
|
|
|
2017-02-15 03:06:46 -05:00
|
|
|
static gboolean
|
|
|
|
meta_monitor_manager_dummy_get_max_screen_size (MetaMonitorManager *manager,
|
|
|
|
int *max_width,
|
|
|
|
int *max_height)
|
|
|
|
{
|
|
|
|
if (meta_is_stage_views_enabled ())
|
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
*max_width = 65535;
|
|
|
|
*max_height = 65535;
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2017-02-24 05:10:52 -05:00
|
|
|
static MetaLogicalMonitorLayoutMode
|
|
|
|
meta_monitor_manager_dummy_get_default_layout_mode (MetaMonitorManager *manager)
|
|
|
|
{
|
|
|
|
if (!meta_is_stage_views_enabled ())
|
|
|
|
return META_LOGICAL_MONITOR_LAYOUT_MODE_PHYSICAL;
|
|
|
|
|
|
|
|
if (is_monitor_framebuffers_scaled ())
|
|
|
|
return META_LOGICAL_MONITOR_LAYOUT_MODE_LOGICAL;
|
|
|
|
else
|
|
|
|
return META_LOGICAL_MONITOR_LAYOUT_MODE_PHYSICAL;
|
|
|
|
}
|
|
|
|
|
2019-01-11 09:35:42 -05:00
|
|
|
static void
|
|
|
|
meta_monitor_manager_dummy_constructed (GObject *object)
|
|
|
|
{
|
|
|
|
MetaMonitorManagerDummy *manager_dummy = META_MONITOR_MANAGER_DUMMY (object);
|
|
|
|
const char *nested_offscreen_transform;
|
|
|
|
GObjectClass *parent_object_class =
|
|
|
|
G_OBJECT_CLASS (meta_monitor_manager_dummy_parent_class);
|
|
|
|
|
|
|
|
parent_object_class->constructed (object);
|
|
|
|
|
|
|
|
nested_offscreen_transform =
|
|
|
|
g_getenv ("MUTTER_DEBUG_NESTED_OFFSCREEN_TRANSFORM");
|
|
|
|
if (g_strcmp0 (nested_offscreen_transform, "1") == 0)
|
|
|
|
manager_dummy->is_transform_handled = FALSE;
|
|
|
|
else
|
|
|
|
manager_dummy->is_transform_handled = TRUE;
|
|
|
|
}
|
|
|
|
|
2014-03-31 21:50:09 -04:00
|
|
|
static void
|
|
|
|
meta_monitor_manager_dummy_class_init (MetaMonitorManagerDummyClass *klass)
|
|
|
|
{
|
2019-01-11 09:35:42 -05:00
|
|
|
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
2014-03-31 21:50:09 -04:00
|
|
|
MetaMonitorManagerClass *manager_class = META_MONITOR_MANAGER_CLASS (klass);
|
|
|
|
|
2019-01-11 09:35:42 -05:00
|
|
|
object_class->constructed = meta_monitor_manager_dummy_constructed;
|
|
|
|
|
2017-01-06 00:27:21 -05:00
|
|
|
manager_class->ensure_initial_config = meta_monitor_manager_dummy_ensure_initial_config;
|
2017-01-09 01:31:18 -05:00
|
|
|
manager_class->apply_monitors_config = meta_monitor_manager_dummy_apply_monitors_config;
|
2017-03-08 03:05:00 -05:00
|
|
|
manager_class->is_transform_handled = meta_monitor_manager_dummy_is_transform_handled;
|
2017-01-20 02:07:12 -05:00
|
|
|
manager_class->calculate_monitor_mode_scale = meta_monitor_manager_dummy_calculate_monitor_mode_scale;
|
2017-06-05 03:59:47 -04:00
|
|
|
manager_class->calculate_supported_scales = meta_monitor_manager_dummy_calculate_supported_scales;
|
2017-02-07 03:01:40 -05:00
|
|
|
manager_class->get_capabilities = meta_monitor_manager_dummy_get_capabilities;
|
2017-02-15 03:06:46 -05:00
|
|
|
manager_class->get_max_screen_size = meta_monitor_manager_dummy_get_max_screen_size;
|
2017-02-24 05:10:52 -05:00
|
|
|
manager_class->get_default_layout_mode = meta_monitor_manager_dummy_get_default_layout_mode;
|
2014-03-31 21:50:09 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2017-07-10 06:19:32 -04:00
|
|
|
meta_monitor_manager_dummy_init (MetaMonitorManagerDummy *manager_dummy)
|
2014-03-31 21:50:09 -04:00
|
|
|
{
|
2017-07-10 06:19:32 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
static gboolean
|
|
|
|
meta_gpu_dummy_read_current (MetaGpu *gpu,
|
|
|
|
GError **error)
|
|
|
|
{
|
2019-01-11 09:35:42 -05:00
|
|
|
MetaBackend *backend = meta_gpu_get_backend (gpu);
|
|
|
|
MetaMonitorManager *manager = meta_backend_get_monitor_manager (backend);
|
2017-07-10 06:19:32 -04:00
|
|
|
|
|
|
|
meta_monitor_manager_dummy_read_current (manager);
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
meta_gpu_dummy_init (MetaGpuDummy *gpu_dummy)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
meta_gpu_dummy_class_init (MetaGpuDummyClass *klass)
|
|
|
|
{
|
|
|
|
MetaGpuClass *gpu_class = META_GPU_CLASS (klass);
|
|
|
|
|
|
|
|
gpu_class->read_current = meta_gpu_dummy_read_current;
|
2014-03-31 21:50:09 -04:00
|
|
|
}
|