[gnome-flashback] crtc: move out GfCrtcMode into its own file



commit 6a2a2d4f4d181710b1a907c256bedf371b675686
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date:   Fri Jul 10 13:10:36 2020 +0300

    crtc: move out GfCrtcMode into its own file
    
    Based on mutter commit:
    https://gitlab.gnome.org/GNOME/mutter/-/commit/980ece9a4b069d14a7f9

 backends/Makefile.am                        |  1 +
 backends/gf-crtc-mode-private.h             | 72 +++++++++++++++++++++++++++++
 backends/gf-crtc-mode.c                     |  6 +--
 backends/gf-crtc-private.h                  | 21 +--------
 backends/gf-monitor-manager-enums-private.h | 23 ---------
 backends/gf-monitor-private.h               |  1 +
 6 files changed, 78 insertions(+), 46 deletions(-)
---
diff --git a/backends/Makefile.am b/backends/Makefile.am
index 17d1196..d99849b 100644
--- a/backends/Makefile.am
+++ b/backends/Makefile.am
@@ -25,6 +25,7 @@ libbackends_la_SOURCES = \
        gf-backend-x11.c \
        gf-backend.c \
        gf-backend.h \
+       gf-crtc-mode-private.h \
        gf-crtc-mode.c \
        gf-crtc-private.h \
        gf-crtc-xrandr-private.h \
diff --git a/backends/gf-crtc-mode-private.h b/backends/gf-crtc-mode-private.h
new file mode 100644
index 0000000..d8996f2
--- /dev/null
+++ b/backends/gf-crtc-mode-private.h
@@ -0,0 +1,72 @@
+/*
+ * Copyright (C) 2017-2020 Red Hat
+ * Copyright (C) 2020 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/>.
+ */
+
+#ifndef GF_CRTC_MODE_PRIVATE_H
+#define GF_CRTC_MODE_PRIVATE_H
+
+#include <glib-object.h>
+#include <stdint.h>
+
+G_BEGIN_DECLS
+
+/* 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;
+
+struct _GfCrtcMode
+{
+  GObject         parent;
+
+  /* The low-level ID of this mode, used to apply back configuration */
+  uint64_t        mode_id;
+  char           *name;
+
+  int             width;
+  int             height;
+  float           refresh_rate;
+  GfCrtcModeFlag  flags;
+
+  gpointer        driver_private;
+  GDestroyNotify  driver_notify;
+};
+
+#define GF_TYPE_CRTC_MODE (gf_crtc_mode_get_type ())
+G_DECLARE_FINAL_TYPE (GfCrtcMode, gf_crtc_mode, GF, CRTC_MODE, GObject)
+
+G_END_DECLS
+
+#endif
diff --git a/backends/gf-crtc-mode.c b/backends/gf-crtc-mode.c
index 1163ec4..f7d58d8 100644
--- a/backends/gf-crtc-mode.c
+++ b/backends/gf-crtc-mode.c
@@ -1,6 +1,6 @@
 /*
- * Copyright (C) 2017 Red Hat
- * Copyright (C) 2018 Alberts Muktupāvels
+ * Copyright (C) 2017-2020 Red Hat
+ * Copyright (C) 2018-2020 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
@@ -17,7 +17,7 @@
  */
 
 #include "config.h"
-#include "gf-crtc-private.h"
+#include "gf-crtc-mode-private.h"
 
 G_DEFINE_TYPE (GfCrtcMode, gf_crtc_mode, G_TYPE_OBJECT)
 
diff --git a/backends/gf-crtc-private.h b/backends/gf-crtc-private.h
index 388da77..0961048 100644
--- a/backends/gf-crtc-private.h
+++ b/backends/gf-crtc-private.h
@@ -28,6 +28,7 @@
 #include <glib-object.h>
 #include <stdint.h>
 
+#include "gf-crtc-mode-private.h"
 #include "gf-gpu-private.h"
 #include "gf-monitor-manager-enums-private.h"
 #include "gf-monitor-manager-types-private.h"
@@ -43,23 +44,6 @@ typedef struct
   GfCrtcMode         *mode;
 } GfCrtcConfig;
 
-struct _GfCrtcMode
-{
-  GObject         parent;
-
-  /* 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;
@@ -77,9 +61,6 @@ struct _GfCrtcClass
   GObjectClass parent_class;
 };
 
-#define GF_TYPE_CRTC_MODE (gf_crtc_mode_get_type ())
-G_DECLARE_FINAL_TYPE (GfCrtcMode, gf_crtc_mode, GF, CRTC_MODE, GObject)
-
 uint64_t            gf_crtc_get_id             (GfCrtc             *self);
 
 GfGpu              *gf_crtc_get_gpu            (GfCrtc             *self);
diff --git a/backends/gf-monitor-manager-enums-private.h b/backends/gf-monitor-manager-enums-private.h
index 717b68d..ea2eb82 100644
--- a/backends/gf-monitor-manager-enums-private.h
+++ b/backends/gf-monitor-manager-enums-private.h
@@ -73,29 +73,6 @@ typedef enum
   GF_CONNECTOR_TYPE_DSI = 16
 } GfConnectorType;
 
-/* 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-private.h b/backends/gf-monitor-private.h
index 85b9132..70b357d 100644
--- a/backends/gf-monitor-private.h
+++ b/backends/gf-monitor-private.h
@@ -22,6 +22,7 @@
 #ifndef GF_MONITOR_PRIVATE_H
 #define GF_MONITOR_PRIVATE_H
 
+#include "gf-crtc-mode-private.h"
 #include "gf-gpu-private.h"
 #include "gf-monitor-manager-enums-private.h"
 #include "gf-monitor-manager-types-private.h"


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]