diff options
author | SooChan Lim <sc1.lim@samsung.com> | 2018-03-23 08:07:24 +0900 |
---|---|---|
committer | SooChan Lim <sc1.lim@samsung.com> | 2018-03-23 08:25:32 +0900 |
commit | 810ca2638b9f543c1addcb4ed3b91147004dc633 (patch) | |
tree | 28104fef56d7e34c2f928f957075a6713c74d8d2 /src | |
parent | 3971c609a9d47dab178df36ddf3a5e66400cf576 (diff) | |
download | libtbm-vigs-810ca2638b9f543c1addcb4ed3b91147004dc633.tar.gz libtbm-vigs-810ca2638b9f543c1addcb4ed3b91147004dc633.tar.bz2 libtbm-vigs-810ca2638b9f543c1addcb4ed3b91147004dc633.zip |
make the libtbm-vigs-devel package.
provide the tbm_vigs.h to share the informtaion with yagl.
Change-Id: Ib1cecf827475cd4856186b9441a584550599cfc8
Diffstat (limited to 'src')
-rw-r--r-- | src/Makefile.am | 3 | ||||
-rwxr-xr-x | src/tbm_bufmgr_emulator.c | 23 | ||||
-rw-r--r-- | src/tbm_vigs.h | 39 |
3 files changed, 61 insertions, 4 deletions
diff --git a/src/Makefile.am b/src/Makefile.am index fd662af..1a0c23d 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -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 diff --git a/src/tbm_bufmgr_emulator.c b/src/tbm_bufmgr_emulator.c index 5af6783..0dba5fe 100755 --- a/src/tbm_bufmgr_emulator.c +++ b/src/tbm_bufmgr_emulator.c @@ -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 index 0000000..eefeacb --- /dev/null +++ b/src/tbm_vigs.h @@ -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 |