mirror of
https://github.com/brl/mutter.git
synced 2025-02-23 16:34:10 +00:00
backends: Add flags to MetaMonitorMode
And export them in the DBus API since they're useful for gnome-control-center. https://bugzilla.gnome.org/show_bug.cgi?id=763832
This commit is contained in:
parent
bbb83d4cd0
commit
1141929bc5
@ -190,6 +190,7 @@ struct _MetaMonitorMode
|
|||||||
int width;
|
int width;
|
||||||
int height;
|
int height;
|
||||||
float refresh_rate;
|
float refresh_rate;
|
||||||
|
guint32 flags;
|
||||||
|
|
||||||
gpointer driver_private;
|
gpointer driver_private;
|
||||||
GDestroyNotify driver_notify;
|
GDestroyNotify driver_notify;
|
||||||
|
@ -590,7 +590,7 @@ meta_monitor_manager_handle_get_resources (MetaDBusDisplayConfig *skeleton,
|
|||||||
|
|
||||||
g_variant_builder_init (&crtc_builder, G_VARIANT_TYPE ("a(uxiiiiiuaua{sv})"));
|
g_variant_builder_init (&crtc_builder, G_VARIANT_TYPE ("a(uxiiiiiuaua{sv})"));
|
||||||
g_variant_builder_init (&output_builder, G_VARIANT_TYPE ("a(uxiausauaua{sv})"));
|
g_variant_builder_init (&output_builder, G_VARIANT_TYPE ("a(uxiausauaua{sv})"));
|
||||||
g_variant_builder_init (&mode_builder, G_VARIANT_TYPE ("a(uxuud)"));
|
g_variant_builder_init (&mode_builder, G_VARIANT_TYPE ("a(uxuudu)"));
|
||||||
|
|
||||||
for (i = 0; i < manager->n_crtcs; i++)
|
for (i = 0; i < manager->n_crtcs; i++)
|
||||||
{
|
{
|
||||||
@ -714,12 +714,13 @@ meta_monitor_manager_handle_get_resources (MetaDBusDisplayConfig *skeleton,
|
|||||||
{
|
{
|
||||||
MetaMonitorMode *mode = &manager->modes[i];
|
MetaMonitorMode *mode = &manager->modes[i];
|
||||||
|
|
||||||
g_variant_builder_add (&mode_builder, "(uxuud)",
|
g_variant_builder_add (&mode_builder, "(uxuudu)",
|
||||||
i, /* ID */
|
i, /* ID */
|
||||||
(gint64)mode->mode_id,
|
(gint64)mode->mode_id,
|
||||||
(guint32)mode->width,
|
(guint32)mode->width,
|
||||||
(guint32)mode->height,
|
(guint32)mode->height,
|
||||||
(double)mode->refresh_rate);
|
(double)mode->refresh_rate,
|
||||||
|
(guint32)mode->flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
meta_dbus_display_config_complete_get_resources (skeleton,
|
meta_dbus_display_config_complete_get_resources (skeleton,
|
||||||
|
@ -632,6 +632,7 @@ meta_monitor_manager_kms_read_current (MetaMonitorManager *manager)
|
|||||||
meta_mode->name = g_strndup (mode->name, DRM_DISPLAY_MODE_LEN);
|
meta_mode->name = g_strndup (mode->name, DRM_DISPLAY_MODE_LEN);
|
||||||
meta_mode->width = mode->hdisplay;
|
meta_mode->width = mode->hdisplay;
|
||||||
meta_mode->height = mode->vdisplay;
|
meta_mode->height = mode->vdisplay;
|
||||||
|
meta_mode->flags = mode->flags;
|
||||||
|
|
||||||
/* Calculate refresh rate in milliHz first for extra precision. */
|
/* Calculate refresh rate in milliHz first for extra precision. */
|
||||||
meta_mode->refresh_rate = (mode->clock * 1000000LL) / mode->htotal;
|
meta_mode->refresh_rate = (mode->clock * 1000000LL) / mode->htotal;
|
||||||
|
@ -788,6 +788,7 @@ meta_monitor_manager_xrandr_read_current (MetaMonitorManager *manager)
|
|||||||
mode->height = xmode->height;
|
mode->height = xmode->height;
|
||||||
mode->refresh_rate = (xmode->dotClock /
|
mode->refresh_rate = (xmode->dotClock /
|
||||||
((float)xmode->hTotal * xmode->vTotal));
|
((float)xmode->hTotal * xmode->vTotal));
|
||||||
|
mode->flags = xmode->modeFlags;
|
||||||
mode->name = get_xmode_name (xmode);
|
mode->name = get_xmode_name (xmode);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -115,6 +115,7 @@
|
|||||||
* x winsys_id: the low-level ID of this mode
|
* x winsys_id: the low-level ID of this mode
|
||||||
* u width, height: the resolution
|
* u width, height: the resolution
|
||||||
* d frequency: refresh rate
|
* d frequency: refresh rate
|
||||||
|
* u flags: mode flags as defined in xf86drmMode.h and randr.h
|
||||||
|
|
||||||
Output and modes are read-only objects (except for output properties),
|
Output and modes are read-only objects (except for output properties),
|
||||||
they can change only in accordance to HW changes (such as hotplugging
|
they can change only in accordance to HW changes (such as hotplugging
|
||||||
@ -133,7 +134,7 @@
|
|||||||
<arg name="serial" direction="out" type="u" />
|
<arg name="serial" direction="out" type="u" />
|
||||||
<arg name="crtcs" direction="out" type="a(uxiiiiiuaua{sv})" />
|
<arg name="crtcs" direction="out" type="a(uxiiiiiuaua{sv})" />
|
||||||
<arg name="outputs" direction="out" type="a(uxiausauaua{sv})" />
|
<arg name="outputs" direction="out" type="a(uxiausauaua{sv})" />
|
||||||
<arg name="modes" direction="out" type="a(uxuud)" />
|
<arg name="modes" direction="out" type="a(uxuudu)" />
|
||||||
<arg name="max_screen_width" direction="out" type="i" />
|
<arg name="max_screen_width" direction="out" type="i" />
|
||||||
<arg name="max_screen_height" direction="out" type="i" />
|
<arg name="max_screen_height" direction="out" type="i" />
|
||||||
</method>
|
</method>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user