[gnome-flashback/wip/randr-1.5: 2/7] display-config: add output tile info retrieval
- From: Alberts Muktupāvels <muktupavels src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-flashback/wip/randr-1.5: 2/7] display-config: add output tile info retrieval
- Date: Thu, 4 Jun 2015 11:03:34 +0000 (UTC)
commit cfa319be53a504600c7fca496effc9460c579be3
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date: Thu Jun 4 02:06:20 2015 +0300
display-config: add output tile info retrieval
This just adds support for retrieving the tile information from
X11 (randr 1.5) and stores the tiling information into the output
struct.
Based on:
https://git.gnome.org/browse/mutter/commit/?id=6a77d9722a22e638a4e02ff286c546c657967a9d
.../libdisplay-config/flashback-monitor-manager.c | 38 ++++++++++++++++++++
.../libdisplay-config/flashback-monitor-manager.h | 14 +++++++
2 files changed, 52 insertions(+), 0 deletions(-)
---
diff --git a/gnome-flashback/libdisplay-config/flashback-monitor-manager.c
b/gnome-flashback/libdisplay-config/flashback-monitor-manager.c
index 6cf127a..3c5ae6c 100644
--- a/gnome-flashback/libdisplay-config/flashback-monitor-manager.c
+++ b/gnome-flashback/libdisplay-config/flashback-monitor-manager.c
@@ -429,6 +429,42 @@ out:
free (reply);
}
+static void
+output_get_tile_info (FlashbackMonitorManagerPrivate *priv,
+ MetaOutput *output)
+{
+ Atom tile_atom;
+ unsigned char *prop;
+ unsigned long nitems, bytes_after;
+ int actual_format;
+ Atom actual_type;
+
+ if (priv->has_randr15 == FALSE)
+ return;
+
+ tile_atom = XInternAtom (priv->xdisplay, "TILE", FALSE);
+ XRRGetOutputProperty (priv->xdisplay, output->winsys_id,
+ tile_atom, 0, 100, False,
+ False, AnyPropertyType,
+ &actual_type, &actual_format,
+ &nitems, &bytes_after, &prop);
+
+ if (actual_type == XA_INTEGER && actual_format == 32 && nitems == 8)
+ {
+ long *values = (long *)prop;
+ output->tile_info.group_id = values[0];
+ output->tile_info.flags = values[1];
+ output->tile_info.max_h_tiles = values[2];
+ output->tile_info.max_v_tiles = values[3];
+ output->tile_info.loc_h_tile = values[4];
+ output->tile_info.loc_v_tile = values[5];
+ output->tile_info.tile_w = values[6];
+ output->tile_info.tile_h = values[7];
+ }
+
+ XFree (prop);
+}
+
static gboolean
output_get_hotplug_mode_update (FlashbackMonitorManagerPrivate *priv,
MetaOutput *output)
@@ -979,6 +1015,8 @@ read_current_config (FlashbackMonitorManager *manager)
meta_output->suggested_y = output_get_suggested_y (priv, meta_output);
meta_output->connector_type = output_get_connector_type (priv, meta_output);
+ output_get_tile_info (priv, meta_output);
+
meta_output->n_modes = output->nmode;
meta_output->modes = g_new0 (MetaMonitorMode *, meta_output->n_modes);
diff --git a/gnome-flashback/libdisplay-config/flashback-monitor-manager.h
b/gnome-flashback/libdisplay-config/flashback-monitor-manager.h
index 0300180..f16f621 100644
--- a/gnome-flashback/libdisplay-config/flashback-monitor-manager.h
+++ b/gnome-flashback/libdisplay-config/flashback-monitor-manager.h
@@ -41,6 +41,7 @@ typedef struct _MetaMonitorMode MetaMonitorMode;
typedef struct _MetaMonitorInfo MetaMonitorInfo;
typedef struct _MetaCRTCInfo MetaCRTCInfo;
typedef struct _MetaOutputInfo MetaOutputInfo;
+typedef struct _MetaTileInfo MetaTileInfo;
typedef enum {
META_MONITOR_TRANSFORM_NORMAL,
@@ -74,6 +75,17 @@ typedef enum {
META_CONNECTOR_TYPE_DSI = 16,
} MetaConnectorType;
+struct _MetaTileInfo {
+ guint32 group_id;
+ guint32 flags;
+ guint32 max_h_tiles;
+ guint32 max_v_tiles;
+ guint32 loc_h_tile;
+ guint32 loc_v_tile;
+ guint32 tile_w;
+ guint32 tile_h;
+};
+
struct _MetaOutput
{
/* The CRTC driving this output, NULL if the output is not enabled */
@@ -121,6 +133,8 @@ struct _MetaOutput
gboolean hotplug_mode_update;
gint suggested_x;
gint suggested_y;
+
+ MetaTileInfo tile_info;
};
struct _MetaCRTC
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]