make libds-tizen-backend-tdm 29/278229/1
authorSooChan Lim <sc1.lim@samsung.com>
Wed, 29 Jun 2022 08:36:40 +0000 (17:36 +0900)
committerSooChan Lim <sc1.lim@samsung.com>
Mon, 18 Jul 2022 05:59:03 +0000 (14:59 +0900)
change the build script and change tdm.h to tdm_internal.h for libds-tizen-backend-tdm.

Change-Id: I7c1db1ae8acdb81bd1ce4fc01edd121782ef1f2d

12 files changed:
examples/meson.build
packaging/libds-tizen.spec
src/backend/tdm/backend.c
src/backend/tdm/meson.build
src/backend/tdm/output.c
src/backend/tdm/tdm.h [deleted file]
src/backend/tdm/tdm_buffer_queue.c
src/backend/tdm/tdm_buffer_queue.h
src/backend/tdm/tdm_internal.h [new file with mode: 0644]
src/backend/tdm/tdm_output_hwc.c
src/backend/tdm/tdm_output_hwc.h
src/meson.build

index b7500a18b5349021516d395e098d478e98313891..ca7c6ab08fc9f7048e803a7b9c8b69c5a0eeadca 100644 (file)
@@ -5,7 +5,10 @@ common_deps = [
 
 executable('tdm-backend',
   'tdm-backend.c',
-  dependencies: common_deps,
+  dependencies: [
+    common_deps,
+    dep_libds_tizen_backend_tdm,
+  ],
   install_dir: libds_tizen_bindir,
   install : true
 )
@@ -21,6 +24,7 @@ executable('tinyds-tdm',
   tinyds_tdm_files,
   dependencies: [
     common_deps,
+    dep_libds_tizen_backend_tdm,
     dependency('pixman-1', required: true),
     dependency('threads', required: true),
   ],
@@ -39,6 +43,7 @@ executable('tinyds-tdm-libinput',
   tinyds_tdm_libinput_files,
   dependencies: [
     common_deps,
+    dep_libds_tizen_backend_tdm,
     dep_libds_tizen_input_devicemgr,
     dependency('pixman-1', required: true),
     dependency('threads', required: true),
@@ -54,6 +59,7 @@ executable('tinyds-tdm-dpms',
   'tinyds-tdm-renderer.c',
   dependencies: [
     common_deps,
+    dep_libds_tizen_backend_tdm,
     dependency('pixman-1', required: true),
     dependency('threads', required: true),
   ],
@@ -71,6 +77,7 @@ executable('tinyds-tdm-hwc',
   tinyds_tdm_hwc_files,
   dependencies: [
     common_deps,
+    dep_libds_tizen_backend_tdm,
     dependency('pixman-1', required: true),
     dependency('threads', required: true),
   ],
index 000f5a99db164540076697200d4bba928f3dc52e..99b47aed87f2559fe7bb84e3e26967abfc59cf26 100644 (file)
@@ -39,6 +39,21 @@ Requires:   %{name} = %{version}-%{release}
 %description devel
 Development package of Wayland Compositor Library for Tizen
 
+## libds-tizen-backend-tdm
+%package backend-tdm
+Summary: Display Backend Library with TDM
+Group:   Development/Libraries
+
+%description backend-tdm
+Display Backend Library with TDM
+
+%package backend-tdm-devel
+Summary: TDM Display Backend Development package
+Group:   Development/Libraries
+
+%description backend-tdm-devel
+TDM Display Backend Development package
+
 %package keyrouter
 Summary: Wayland Compositor Library for keyrouter
 Group:   Development/Libraries
@@ -106,6 +121,21 @@ ninja -C builddir install
 %{_bindir}/tinyds-tdm-libinput
 %{_bindir}/input-generator
 
+%files backend-tdm
+%manifest %{name}.manifest
+%defattr(-,root,root,-)
+%license LICENSE
+%{_libdir}/libds-tizen-backend-tdm.so.*
+
+%files backend-tdm-devel
+%manifest %{name}.manifest
+%defattr(-,root,root,-)
+%license LICENSE
+%{_includedir}/libds-tizen/backend/tdm.h
+%{_includedir}/libds-tizen/backend/tdm_output_hwc.h
+%{_libdir}/pkgconfig/libds-tizen-backend-tdm.pc
+%{_libdir}/libds-tizen-backend-tdm.so
+
 %files keyrouter
 %manifest %{name}.manifest
 %defattr(-,root,root,-)
index 2337204e0811a2b2ed6012ce84e861309baa0072..8ca365ea69df0c6a10efe36e1e2d1b4e8bccc40f 100644 (file)
@@ -3,7 +3,7 @@
 
 #include <libds/log.h>
 
-#include "tdm.h"
+#include "tdm_internal.h"
 
 static const struct ds_backend_interface tdm_backend_iface;
 
index 7a7c25f5b2998152eeb91c55274ed694b1a4b829..04ecbcf44b41c65fbe25e05a4ee0890148d45120 100644 (file)
@@ -1,14 +1,33 @@
-libds_tizen_files += files(
+libds_tizen_backend_tdm_files = files(
   'backend.c',
   'output.c',
   'tdm_buffer_queue.c',
   'tdm_output_hwc.c',
 )
 
-libtdm = dependency('libtdm', required: true)
-libtbm = dependency('libtbm', required: true)
-
-libds_tizen_deps += [
-  libtdm,
-  libtbm
+libds_tizen_backend_tdm_deps = [
+  dep_libds_tizen,
+  dependency('libtdm', required: true),
+  dependency('libtbm', required: true)
 ]
+
+lib_libds_tizen_backend_tdm = shared_library('ds-tizen-backend-tdm', libds_tizen_backend_tdm_files,
+  dependencies: libds_tizen_backend_tdm_deps,
+  include_directories: [ include_directories('/usr/include'), common_inc, include_directories('.'), include_directories('..')],
+  version: meson.project_version(),
+  install: true
+)
+
+dep_libds_tizen_backend_tdm = declare_dependency(
+  link_with: lib_libds_tizen_backend_tdm,
+  dependencies: libds_tizen_backend_tdm_deps,
+  include_directories: [ common_inc, include_directories('.') ],
+)
+
+pkgconfig = import('pkgconfig')
+pkgconfig.generate(lib_libds_tizen_backend_tdm,
+  version: meson.project_version(),
+  filebase: 'libds-tizen-backend-tdm',
+  name: 'libds-tizen-backend-tdm',
+  description: 'tdm backend of libds-tizen for tizen platform',
+)
\ No newline at end of file
index 5e874df957f5710eb44dc1a4bfbdc2d0029cda4f..c9ad137b08f3aeac35a7b84c06c1c754f8c3065a 100644 (file)
@@ -6,7 +6,7 @@
 #include <libds/log.h>
 #include "libds-tizen/allocator/tbm.h"
 
-#include "tdm.h"
+#include "tdm_internal.h"
 #include "tdm_output_hwc.h"
 #include "tdm_buffer_queue.h"
 
diff --git a/src/backend/tdm/tdm.h b/src/backend/tdm/tdm.h
deleted file mode 100644 (file)
index 7c00202..0000000
+++ /dev/null
@@ -1,79 +0,0 @@
-#ifndef DS_TIZEN_BACKEND_TDM_H
-#define DS_TIZEN_BACKEND_TDM_H
-
-#include <time.h>
-
-#include <tdm.h>
-
-#include <libds/interfaces/backend.h>
-#include <libds/interfaces/output.h>
-
-enum ds_tdm_output_status {
-    DS_TDM_OUTPUT_DISCONNECTED,
-    DS_TDM_OUTPUT_CONNECTED,
-};
-
-struct ds_tdm_output_mode {
-    struct ds_output_mode base;
-    const tdm_output_mode *tdm_mode;
-};
-
-struct ds_tdm_backend
-{
-    struct ds_backend base;
-
-    tdm_display *tdm_display;
-    struct wl_display *wl_display;
-    struct wl_event_source *tdm_event;
-
-    struct wl_list outputs; // ds_tdm_output.link
-    struct wl_list buffers; // ds_tdm_buffer.link
-
-    struct wl_listener display_destroy;
-
-    clockid_t clock;
-    int fd;
-};
-
-struct ds_tdm_output
-{
-    struct ds_output base;
-
-    struct ds_tdm_backend *backend;
-    struct ds_tdm_buffer_queue *queue;
-    struct ds_buffer *front_buffer, *back_buffer;
-
-    struct {
-        tdm_output *output;
-        tdm_hwc *hwc;
-    } tdm;
-
-    struct ds_tdm_output_hwc *hwc;
-    struct wl_listener hwc_commit_handler_listener;
-
-    struct wl_list link;
-
-    enum ds_tdm_output_status status;
-};
-
-struct ds_tdm_buffer
-{
-    struct ds_buffer *buffer;
-    tbm_surface_h surface;
-    struct wl_list link; // ds_wl_backend.buffers
-
-    struct wl_listener buffer_release;
-    struct wl_listener buffer_destroy;
-
-    bool released;
-};
-
-struct ds_tdm_backend *tdm_backend_from_backend(struct ds_backend *backend);
-
-struct ds_tdm_output *create_tdm_output(struct ds_tdm_backend *tdm,
-        tdm_output *tdm_output);
-
-void destroy_tdm_buffer(struct ds_tdm_buffer *buffer);
-
-
-#endif
index 3acec8f0290c1c53a91bc118bafd8d615aa4cfaa..40e63535a160483aa3cb470a92d9e45ee51fb41a 100644 (file)
@@ -6,7 +6,7 @@
 #include <libds/log.h>
 #include "libds/interfaces/buffer.h"
 
-#include "tdm.h"
+#include "tdm_internal.h"
 #include "tdm_buffer_queue.h"
 
 static void
index a983265e72fbc17c9c16b2a0b29260ece7b80148..51eab376ec4db99da9b2bb3df1a37c036f13709e 100644 (file)
@@ -4,7 +4,7 @@
 #include <tbm_surface_queue.h>
 #include <libds/interfaces/buffer.h>
 
-#include "tdm.h"
+#include "tdm_internal.h"
 
 struct ds_tdm_buffer_queue
 {
diff --git a/src/backend/tdm/tdm_internal.h b/src/backend/tdm/tdm_internal.h
new file mode 100644 (file)
index 0000000..ef7d88f
--- /dev/null
@@ -0,0 +1,79 @@
+#ifndef DS_TIZEN_BACKEND_TDM_H
+#define DS_TIZEN_BACKEND_TDM_H
+
+#include <time.h>
+#include <tdm.h>
+#include <wayland-server.h>
+
+#include <libds/interfaces/backend.h>
+#include <libds/interfaces/output.h>
+
+enum ds_tdm_output_status {
+    DS_TDM_OUTPUT_DISCONNECTED,
+    DS_TDM_OUTPUT_CONNECTED,
+};
+
+struct ds_tdm_output_mode {
+    struct ds_output_mode base;
+    const tdm_output_mode *tdm_mode;
+};
+
+struct ds_tdm_backend
+{
+    struct ds_backend base;
+
+    tdm_display *tdm_display;
+    struct wl_display *wl_display;
+    struct wl_event_source *tdm_event;
+
+    struct wl_list outputs; // ds_tdm_output.link
+    struct wl_list buffers; // ds_tdm_buffer.link
+
+    struct wl_listener display_destroy;
+
+    clockid_t clock;
+    int fd;
+};
+
+struct ds_tdm_output
+{
+    struct ds_output base;
+
+    struct ds_tdm_backend *backend;
+    struct ds_tdm_buffer_queue *queue;
+    struct ds_buffer *front_buffer, *back_buffer;
+
+    struct {
+        tdm_output *output;
+        tdm_hwc *hwc;
+    } tdm;
+
+    struct ds_tdm_output_hwc *hwc;
+    struct wl_listener hwc_commit_handler_listener;
+
+    struct wl_list link;
+
+    enum ds_tdm_output_status status;
+};
+
+struct ds_tdm_buffer
+{
+    struct ds_buffer *buffer;
+    tbm_surface_h surface;
+    struct wl_list link; // ds_wl_backend.buffers
+
+    struct wl_listener buffer_release;
+    struct wl_listener buffer_destroy;
+
+    bool released;
+};
+
+struct ds_tdm_backend *tdm_backend_from_backend(struct ds_backend *backend);
+
+struct ds_tdm_output *create_tdm_output(struct ds_tdm_backend *tdm,
+        tdm_output *tdm_output);
+
+void destroy_tdm_buffer(struct ds_tdm_buffer *buffer);
+
+
+#endif
index 8db29846567eadd1739d96b75d5d2eb47ae033c9..48aef1d0a169415107d9a416f38c6dbb670182f0 100644 (file)
@@ -3,10 +3,11 @@
 #include <stdlib.h>
 #include <string.h>
 
-#include <tdm.h>
 #include <libds/log.h>
 #include <libds-tizen/tbm_server.h>
 
+
+#include "tdm_internal.h"
 #include "tdm_output_hwc.h"
 
 static void
index 07b36994d16cd4d883312db8b4c746afbf17bd0b..bb634d2740615ced117c7062e209daddd8481f86 100644 (file)
@@ -1,13 +1,15 @@
 #ifndef DS_TIZEN_BACKEND_TDM_OUTPUT_HWC_H
 #define DS_TIZEN_BACKEND_TDM_OUTPUT_HWC_H
 
-#include <tdm.h>
 #include <libds/surface.h>
 #include <libds/buffer.h>
 
 #include <libds-tizen/backend/tdm.h>
 #include <libds-tizen/backend/tdm_output_hwc.h>
 
+#include "tdm_internal.h"
+
+
 struct ds_tdm_output_hwc_window {
     struct wl_list link;
 
index 1ee9b992c117b2668f47d3e80db0069663f27749..7b61b9aa2b4b0ff6cff061cc92a528b312df228f 100644 (file)
@@ -34,7 +34,6 @@ libds_tizen_deps = [
 ]
 
 subdir('allocator')
-subdir('backend')
 subdir('util')
 
 lib_libds_tizen = shared_library('ds-tizen', libds_tizen_files,
@@ -58,6 +57,6 @@ pkgconfig.generate(lib_libds_tizen,
   description: 'extension of libds for tizen platform',
 )
 
+subdir('backend')
 subdir('keyrouter')
 subdir('input-devicemgr')
-