[mutter] crtc/kms: Add an abstract MetaCrtcNative that sits under MetaCrtcKms



commit c4a422bc24e4e20fd02528a2d4dabc84cc126e8a
Author: Jonas Ã…dahl <jadahl gmail com>
Date:   Thu Jan 14 11:15:53 2021 +0100

    crtc/kms: Add an abstract MetaCrtcNative that sits under MetaCrtcKms
    
    There is going to me another non-abstract MetaCrtcNative type, just as
    there will be for MetaOutputNative.
    
    Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1698>

 src/backends/native/meta-crtc-kms.c    |  4 ++--
 src/backends/native/meta-crtc-kms.h    |  3 ++-
 src/backends/native/meta-crtc-native.c | 35 ++++++++++++++++++++++++++++++++++
 src/backends/native/meta-crtc-native.h | 35 ++++++++++++++++++++++++++++++++++
 src/meson.build                        |  2 ++
 5 files changed, 76 insertions(+), 3 deletions(-)
---
diff --git a/src/backends/native/meta-crtc-kms.c b/src/backends/native/meta-crtc-kms.c
index 02b4999bf3..fb38e4d672 100644
--- a/src/backends/native/meta-crtc-kms.c
+++ b/src/backends/native/meta-crtc-kms.c
@@ -40,7 +40,7 @@
 
 struct _MetaCrtcKms
 {
-  MetaCrtc parent;
+  MetaCrtcNative parent;
 
   MetaKmsCrtc *kms_crtc;
 
@@ -54,7 +54,7 @@ struct _MetaCrtcKms
 
 static GQuark kms_crtc_crtc_kms_quark;
 
-G_DEFINE_TYPE (MetaCrtcKms, meta_crtc_kms, META_TYPE_CRTC)
+G_DEFINE_TYPE (MetaCrtcKms, meta_crtc_kms, META_TYPE_CRTC_NATIVE)
 
 gpointer
 meta_crtc_kms_get_cursor_renderer_private (MetaCrtcKms *crtc_kms)
diff --git a/src/backends/native/meta-crtc-kms.h b/src/backends/native/meta-crtc-kms.h
index 8c4df1fad0..df957be15c 100644
--- a/src/backends/native/meta-crtc-kms.h
+++ b/src/backends/native/meta-crtc-kms.h
@@ -28,6 +28,7 @@
 
 #include "backends/meta-backend-types.h"
 #include "backends/meta-crtc.h"
+#include "backends/native/meta-crtc-native.h"
 #include "backends/native/meta-drm-buffer.h"
 #include "backends/native/meta-gpu-kms.h"
 #include "backends/native/meta-kms-crtc.h"
@@ -36,7 +37,7 @@
 #define META_TYPE_CRTC_KMS (meta_crtc_kms_get_type ())
 G_DECLARE_FINAL_TYPE (MetaCrtcKms, meta_crtc_kms,
                       META, CRTC_KMS,
-                      MetaCrtc)
+                      MetaCrtcNative)
 
 gpointer meta_crtc_kms_get_cursor_renderer_private (MetaCrtcKms *crtc_kms);
 
diff --git a/src/backends/native/meta-crtc-native.c b/src/backends/native/meta-crtc-native.c
new file mode 100644
index 0000000000..3a0e7a9521
--- /dev/null
+++ b/src/backends/native/meta-crtc-native.c
@@ -0,0 +1,35 @@
+/*
+ * Copyright (C) 2021 Red Hat
+ *
+ * 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, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+ * 02111-1307, USA.
+ */
+
+#include "config.h"
+
+#include "backends/native/meta-crtc-native.h"
+
+G_DEFINE_ABSTRACT_TYPE (MetaCrtcNative, meta_crtc_native,
+                        META_TYPE_CRTC)
+
+static void
+meta_crtc_native_init (MetaCrtcNative *crtc_native)
+{
+}
+
+static void
+meta_crtc_native_class_init (MetaCrtcNativeClass *klass)
+{
+}
diff --git a/src/backends/native/meta-crtc-native.h b/src/backends/native/meta-crtc-native.h
new file mode 100644
index 0000000000..61ea15be31
--- /dev/null
+++ b/src/backends/native/meta-crtc-native.h
@@ -0,0 +1,35 @@
+/*
+ * Copyright (C) 2021 Red Hat
+ *
+ * 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, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+ * 02111-1307, USA.
+ */
+
+#ifndef META_CRTC_NATIVE_H
+#define META_CRTC_NATIVE_H
+
+#include "backends/meta-crtc.h"
+
+#define META_TYPE_CRTC_NATIVE (meta_crtc_native_get_type ())
+G_DECLARE_DERIVABLE_TYPE (MetaCrtcNative, meta_crtc_native,
+                          META, CRTC_NATIVE,
+                          MetaCrtc)
+
+struct _MetaCrtcNativeClass
+{
+  MetaCrtcClass parent_class;
+};
+
+#endif /* META_CRTC_NATIVE_H */
diff --git a/src/meson.build b/src/meson.build
index 705a704070..dc968ad2ef 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -645,6 +645,8 @@ if have_native_backend
     'backends/native/meta-cogl-utils.h',
     'backends/native/meta-crtc-kms.c',
     'backends/native/meta-crtc-kms.h',
+    'backends/native/meta-crtc-native.c',
+    'backends/native/meta-crtc-native.h',
     'backends/native/meta-crtc-mode-kms.c',
     'backends/native/meta-crtc-mode-kms.h',
     'backends/native/meta-cursor-renderer-native.c',


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