make the libtbm-vigs-devel package. 19/173619/1
authorSooChan Lim <sc1.lim@samsung.com>
Thu, 22 Mar 2018 23:07:24 +0000 (08:07 +0900)
committerSooChan Lim <sc1.lim@samsung.com>
Thu, 22 Mar 2018 23:25:32 +0000 (08:25 +0900)
provide the tbm_vigs.h to share the informtaion with yagl.

Change-Id: Ib1cecf827475cd4856186b9441a584550599cfc8

Makefile.am
configure.ac
libtbm-vigs.pc.in [new file with mode: 0644]
packaging/libtbm-vigs.spec
src/Makefile.am
src/tbm_bufmgr_emulator.c
src/tbm_vigs.h [new file with mode: 0644]

index af437a6..4d3fc73 100644 (file)
@@ -1 +1,4 @@
 SUBDIRS = src
+
+pkgconfigdir = $(libdir)/pkgconfig
+pkgconfig_DATA = libtbm-vigs.pc
\ No newline at end of file
index b4683c2..b05a0be 100644 (file)
@@ -45,12 +45,14 @@ LIBTBM_EMULATOR_LIBS="$LIBDRM_LIBS $LIBDRM_VIGS_LIBS $LIBTBM_LIBS "
 AC_SUBST(LIBTBM_EMULATOR_CFLAGS)
 AC_SUBST(LIBTBM_EMULATOR_LIBS)
 
-bufmgr_dir=${libdir#*/}
+#bufmgr_dir=${libdir#*/}
+bufmgr_dir=${libdir}/bufmgr/
 AC_SUBST(bufmgr_dir)
 
 AC_OUTPUT([
        Makefile
-       src/Makefile])
+       src/Makefile
+       libtbm-vigs.pc])
 
 echo ""
 echo "CFLAGS  : $CFLAGS"
diff --git a/libtbm-vigs.pc.in b/libtbm-vigs.pc.in
new file mode 100644 (file)
index 0000000..abc8d19
--- /dev/null
@@ -0,0 +1,10 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: libtbm-vigs
+Description: the library for Tizen Buffer Manager vigs backend
+Version: @PACKAGE_VERSION@
+Libs: -L${libdir}/bufmgr -ltbm_emulator
+Cflags: -I${includedir} -I${includedir}/tbm-vigs
index 831142d..89cf35f 100644 (file)
@@ -16,13 +16,20 @@ Requires:   libdrm
 %description
 description: ${summary}
 
+%package devel
+Summary:       Tizen Buffer Manager Library Backend for vigs
+Group:         Development/Libraries
+
+%description devel
+TBM vigs backend. Developement Files.
+
 %prep
 %setup -q
 cp %{SOURCE1001} .
 
 %build
 autoreconf -vfi
-./configure --prefix=%{_prefix} --libdir=%{_libdir}/bufmgr \
+./configure --prefix=%{_prefix} --libdir=%{_libdir} \
             CFLAGS="${CFLAGS} -Wall -Werror" LDFLAGS="${LDFLAGS} -Wl,--hash-style=both -Wl,--as-needed"
 
 make %{?_smp_mflags}
@@ -45,3 +52,10 @@ ln -s libtbm_emulator.so %{_libdir}/bufmgr/libtbm_default.so
 %defattr(-,root,root,-)
 %license COPYING
 %{_libdir}/bufmgr/libtbm_*.so*
+
+%files devel
+%defattr(-,root,root,-)
+%dir %{_includedir}
+%{_includedir}/tbm-vigs/tbm_vigs.h
+%{_libdir}/bufmgr/libtbm_*.so
+%{_libdir}/pkgconfig/libtbm-vigs.pc
index fd662af..1a0c23d 100644 (file)
@@ -10,3 +10,6 @@ libtbm_emulator_la_LIBADD = @LIBTBM_EMULATOR_LIBS@
 libtbm_emulator_la_SOURCES = \
        tbm_bufmgr_emulator.c \
        tbm_emulator_log.c
+
+libtbm_emulator_includedir=$(includedir)/tbm-vigs
+libtbm_emulator_include_HEADERS = tbm_vigs.h
\ No newline at end of file
index 5af6783..0dba5fe 100755 (executable)
@@ -47,6 +47,9 @@
 #include <stdlib.h>
 #include <unistd.h>
 #include <xf86drm.h>
+#include "tbm_vigs.h"
+
+static struct vigs_drm_device *g_drm_dev = NULL;
 
 #define VIGS_DRM_NAME "vigs"
 
@@ -73,10 +76,11 @@ static int _tbm_vigs_open_drm(void)
        return fd;
 }
 
-static tbm_bo_handle get_tbm_bo_handle(struct vigs_drm_gem *gem, int device)
+static tbm_bo_handle get_tbm_bo_handle(struct vigs_drm_surface *sfc, int device)
 {
        tbm_bo_handle bo_handle;
        int ret;
+       struct vigs_drm_gem *gem = &sfc->gem;
 
        memset(&bo_handle, 0, sizeof(bo_handle));
 
@@ -95,7 +99,7 @@ static tbm_bo_handle get_tbm_bo_handle(struct vigs_drm_gem *gem, int device)
 
                break;
        case TBM_DEVICE_3D:
-               TBM_EMULATOR_LOG_ERROR("TBM_DEVICE_3D not supported");
+               bo_handle.ptr = (void *)sfc;
                break;
        case TBM_DEVICE_MM:
                TBM_EMULATOR_LOG_ERROR("TBM_DEVICE_MM not supported");
@@ -122,6 +126,8 @@ static void tbm_bufmgr_emulator_deinit(void *priv)
        close(drm_dev->fd);
 
        vigs_drm_device_destroy(drm_dev);
+
+       g_drm_dev = NULL;
 }
 
 static int tbm_bufmgr_emulator_bo_size(tbm_bo bo)
@@ -261,7 +267,7 @@ static tbm_bo_handle tbm_bufmgr_emulator_bo_get_handle(tbm_bo bo, int device)
 
        sfc = (struct vigs_drm_surface *)tbm_backend_get_bo_priv(bo);
 
-       return get_tbm_bo_handle(&sfc->gem, device);
+       return get_tbm_bo_handle(sfc, device);
 }
 
 static tbm_bo_handle tbm_bufmgr_emulator_bo_map(tbm_bo bo, int device, int opt)
@@ -274,7 +280,7 @@ static tbm_bo_handle tbm_bufmgr_emulator_bo_map(tbm_bo bo, int device, int opt)
 
        sfc = (struct vigs_drm_surface *)tbm_backend_get_bo_priv(bo);
 
-       handle = get_tbm_bo_handle(&sfc->gem, device);
+       handle = get_tbm_bo_handle(sfc, device);
 
        if (!handle.ptr)
                return handle;
@@ -539,6 +545,7 @@ int tbm_bufmgr_emulator_init(tbm_bufmgr bufmgr, int fd)
                TBM_EMULATOR_LOG_ERROR("vigs_drm_device_create failed: %s", strerror(-ret));
                goto fail;
        }
+       g_drm_dev = drm_dev;
 
        backend = tbm_backend_alloc();
 
@@ -589,5 +596,13 @@ int tbm_bufmgr_emulator_init(tbm_bufmgr bufmgr, int fd)
                close(drm_fd);
        }
 
+       g_drm_dev = NULL;
+
        return 0;
 }
+
+struct vigs_drm_device *
+tbm_vigs_get_drm_dev(void)
+{
+       return g_drm_dev;
+}
diff --git a/src/tbm_vigs.h b/src/tbm_vigs.h
new file mode 100644 (file)
index 0000000..eefeacb
--- /dev/null
@@ -0,0 +1,39 @@
+/*
+ * libtbm-vigs header
+ *
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact :
+ * SooChan Lim <sc1.lim@samsung.com>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+#ifndef _TBM_VIGS_LOG_H_
+#define _TBM_VIGS_LOG_H_
+
+#include "vigs.h"
+
+struct vigs_drm_device *tbm_vigs_get_drm_dev(void);
+
+#endif