provide the tbm_vigs.h to share the informtaion with yagl.
Change-Id: Ib1cecf827475cd4856186b9441a584550599cfc8
SUBDIRS = src
+
+pkgconfigdir = $(libdir)/pkgconfig
+pkgconfig_DATA = libtbm-vigs.pc
\ No newline at end of file
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"
--- /dev/null
+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
%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}
%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
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
#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"
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));
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");
close(drm_dev->fd);
vigs_drm_device_destroy(drm_dev);
+
+ g_drm_dev = NULL;
}
static int tbm_bufmgr_emulator_bo_size(tbm_bo bo)
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)
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;
TBM_EMULATOR_LOG_ERROR("vigs_drm_device_create failed: %s", strerror(-ret));
goto fail;
}
+ g_drm_dev = drm_dev;
backend = tbm_backend_alloc();
close(drm_fd);
}
+ g_drm_dev = NULL;
+
return 0;
}
+
+struct vigs_drm_device *
+tbm_vigs_get_drm_dev(void)
+{
+ return g_drm_dev;
+}
--- /dev/null
+/*
+ * 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