[gnome-flashback] backends: add CRTC structs
- From: Alberts Muktupāvels <muktupavels src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-flashback] backends: add CRTC structs
- Date: Sun, 10 Sep 2017 21:46:42 +0000 (UTC)
commit 07c8f450977b50f65b617f1fec905585ea58cd4c
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date: Sun Sep 10 17:41:51 2017 +0300
backends: add CRTC structs
backends/Makefile.am | 3 +
backends/gf-crtc-private.h | 81 +++++++++++++++++++++++++++
backends/gf-monitor-manager-enums-private.h | 69 +++++++++++++++++++++++
backends/gf-monitor-manager-types-private.h | 39 +++++++++++++
4 files changed, 192 insertions(+), 0 deletions(-)
---
diff --git a/backends/Makefile.am b/backends/Makefile.am
index 8fd8b0f..5f57955 100644
--- a/backends/Makefile.am
+++ b/backends/Makefile.am
@@ -29,14 +29,17 @@ libbackends_la_SOURCES = \
gf-backend-x11.c \
gf-backend.c \
gf-backend.h \
+ gf-crtc-private.h \
gf-display-config-shared.h \
gf-edid-parse.c \
gf-edid-private.h \
gf-monitor-manager-dummy-private.h \
gf-monitor-manager-dummy.c \
+ gf-monitor-manager-enums-private.h \
gf-monitor-manager-kms-private.h \
gf-monitor-manager-kms.c \
gf-monitor-manager-private.h \
+ gf-monitor-manager-types-private.h \
gf-monitor-manager-xrandr-private.h \
gf-monitor-manager-xrandr.c \
gf-monitor-manager.c \
diff --git a/backends/gf-crtc-private.h b/backends/gf-crtc-private.h
new file mode 100644
index 0000000..a4629c2
--- /dev/null
+++ b/backends/gf-crtc-private.h
@@ -0,0 +1,81 @@
+/*
+ * Copyright (C) 2001 Havoc Pennington
+ * Copyright (C) 2003 Rob Adams
+ * Copyright (C) 2004-2006 Elijah Newren
+ * Copyright (C) 2013 Red Hat Inc.
+ * Copyright (C) 2017 Alberts Muktupāvels
+ *
+ * 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 3 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/>.
+ *
+ * Adapted from mutter:
+ * - src/backends/meta-monitor-manager-private.h
+ */
+
+#ifndef GF_CRTC_MODE_PRIVATE_H
+#define GF_CRTC_MODE_PRIVATE_H
+
+#include "gf-monitor-manager-enums-private.h"
+#include "gf-monitor-manager-types-private.h"
+#include "gf-rectangle.h"
+
+G_BEGIN_DECLS
+
+struct _GfCrtc
+{
+ glong crtc_id;
+ GfRectangle rect;
+ GfCrtcMode *current_mode;
+ GfMonitorTransform transform;
+ guint all_transforms;
+
+ /* Only used to build the logical configuration
+ * from the HW one
+ */
+ GfLogicalMonitor *logical_monitor;
+
+ /* Used when changing configuration */
+ gboolean is_dirty;
+
+ gpointer driver_private;
+ GDestroyNotify driver_notify;
+};
+
+struct _GfCrtcMode
+{
+ /* The low-level ID of this mode, used to apply back configuration */
+ glong mode_id;
+ gchar *name;
+
+ gint width;
+ gint height;
+ gfloat refresh_rate;
+ GfCrtcModeFlag flags;
+
+ gpointer driver_private;
+ GDestroyNotify driver_notify;
+};
+
+typedef struct
+{
+ GfCrtc *crtc;
+ GfCrtcMode *mode;
+ int x;
+ int y;
+ GfMonitorTransform transform;
+ GPtrArray *outputs;
+} GfCrtcInfo;
+
+G_END_DECLS
+
+#endif
diff --git a/backends/gf-monitor-manager-enums-private.h b/backends/gf-monitor-manager-enums-private.h
new file mode 100644
index 0000000..0efeeb4
--- /dev/null
+++ b/backends/gf-monitor-manager-enums-private.h
@@ -0,0 +1,69 @@
+/*
+ * Copyright (C) 2001 Havoc Pennington
+ * Copyright (C) 2003 Rob Adams
+ * Copyright (C) 2004-2006 Elijah Newren
+ * Copyright (C) 2013 Red Hat Inc.
+ * Copyright (C) 2017 Alberts Muktupāvels
+ *
+ * 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 3 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/>.
+ *
+ * Adapted from mutter:
+ * - src/backends/meta-monitor-manager-private.h
+ */
+
+#ifndef GF_MONITOR_MANAGER_ENUMS_PRIVATE_H
+#define GF_MONITOR_MANAGER_ENUMS_PRIVATE_H
+
+#include <glib.h>
+
+G_BEGIN_DECLS
+
+typedef enum
+{
+ GF_MONITOR_TRANSFORM_NORMAL,
+ GF_MONITOR_TRANSFORM_90,
+ GF_MONITOR_TRANSFORM_180,
+ GF_MONITOR_TRANSFORM_270,
+ GF_MONITOR_TRANSFORM_FLIPPED,
+ GF_MONITOR_TRANSFORM_FLIPPED_90,
+ GF_MONITOR_TRANSFORM_FLIPPED_180,
+ GF_MONITOR_TRANSFORM_FLIPPED_270,
+} GfMonitorTransform;
+
+/* Same as KMS mode flags and X11 randr flags */
+typedef enum
+{
+ GF_CRTC_MODE_FLAG_NONE = 0,
+
+ GF_CRTC_MODE_FLAG_PHSYNC = (1 << 0),
+ GF_CRTC_MODE_FLAG_NHSYNC = (1 << 1),
+ GF_CRTC_MODE_FLAG_PVSYNC = (1 << 2),
+ GF_CRTC_MODE_FLAG_NVSYNC = (1 << 3),
+ GF_CRTC_MODE_FLAG_INTERLACE = (1 << 4),
+ GF_CRTC_MODE_FLAG_DBLSCAN = (1 << 5),
+ GF_CRTC_MODE_FLAG_CSYNC = (1 << 6),
+ GF_CRTC_MODE_FLAG_PCSYNC = (1 << 7),
+ GF_CRTC_MODE_FLAG_NCSYNC = (1 << 8),
+ GF_CRTC_MODE_FLAG_HSKEW = (1 << 9),
+ GF_CRTC_MODE_FLAG_BCAST = (1 << 10),
+ GF_CRTC_MODE_FLAG_PIXMUX = (1 << 11),
+ GF_CRTC_MODE_FLAG_DBLCLK = (1 << 12),
+ GF_CRTC_MODE_FLAG_CLKDIV2 = (1 << 13),
+
+ GF_CRTC_MODE_FLAG_MASK = 0x3fff
+} GfCrtcModeFlag;
+
+G_END_DECLS
+
+#endif
diff --git a/backends/gf-monitor-manager-types-private.h b/backends/gf-monitor-manager-types-private.h
new file mode 100644
index 0000000..f2b769b
--- /dev/null
+++ b/backends/gf-monitor-manager-types-private.h
@@ -0,0 +1,39 @@
+/*
+ * Copyright (C) 2001 Havoc Pennington
+ * Copyright (C) 2003 Rob Adams
+ * Copyright (C) 2004-2006 Elijah Newren
+ * Copyright (C) 2013 Red Hat Inc.
+ * Copyright (C) 2017 Alberts Muktupāvels
+ *
+ * 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 3 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/>.
+ *
+ * Adapted from mutter:
+ * - src/backends/meta-monitor-manager-private.h
+ */
+
+#ifndef GF_MONITOR_MANAGER_TYPES_PRIVATE_H
+#define GF_MONITOR_MANAGER_TYPES_PRIVATE_H
+
+#include <glib.h>
+
+G_BEGIN_DECLS
+
+typedef struct _GfLogicalMonitor GfLogicalMonitor;
+
+typedef struct _GfCrtc GfCrtc;
+typedef struct _GfCrtcMode GfCrtcMode;
+
+G_END_DECLS
+
+#endif
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]