Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 622390
Collapse All | Expand All

(-)./configure.ac (+13 lines)
Lines 154-159 Link Here
154
	      [Enable support for etnaviv's experimental API (default: disabled)]),
154
	      [Enable support for etnaviv's experimental API (default: disabled)]),
155
	      [ETNAVIV=$enableval], [ETNAVIV=no])
155
	      [ETNAVIV=$enableval], [ETNAVIV=no])
156
156
157
AC_ARG_ENABLE(nexell,
158
	      AS_HELP_STRING([--enable-nexell],
159
	      [Enable support for nexell (default: disabled)]),
160
	      [NEXELL=$enableval], [NEXELL=no])
161
157
AC_ARG_ENABLE(install-test-programs,
162
AC_ARG_ENABLE(install-test-programs,
158
		  AS_HELP_STRING([--enable-install-test-programs],
163
		  AS_HELP_STRING([--enable-install-test-programs],
159
		  [Install test programs (default: no)]),
164
		  [Install test programs (default: no)]),
Lines 443-448 Link Here
443
	AC_DEFINE(HAVE_ETNAVIV, 1, [Have etnaviv support])
448
	AC_DEFINE(HAVE_ETNAVIV, 1, [Have etnaviv support])
444
fi
449
fi
445
450
451
AM_CONDITIONAL(HAVE_NEXELL, [test "x$NEXELL" = xyes])
452
if test "x$NEXELL" = xyes; then
453
	AC_DEFINE(HAVE_NEXELL, 1, [Have NEXELL support])
454
fi
455
446
AM_CONDITIONAL(HAVE_INSTALL_TESTS, [test "x$INSTALL_TESTS" = xyes])
456
AM_CONDITIONAL(HAVE_INSTALL_TESTS, [test "x$INSTALL_TESTS" = xyes])
447
if test "x$INSTALL_TESTS" = xyes; then
457
if test "x$INSTALL_TESTS" = xyes; then
448
	AC_DEFINE(HAVE_INSTALL_TESTS, 1, [Install test programs])
458
	AC_DEFINE(HAVE_INSTALL_TESTS, 1, [Install test programs])
Lines 547-552 Link Here
547
	tegra/libdrm_tegra.pc
557
	tegra/libdrm_tegra.pc
548
	vc4/Makefile
558
	vc4/Makefile
549
	vc4/libdrm_vc4.pc
559
	vc4/libdrm_vc4.pc
560
	nexell/Makefile
561
	nexell/libdrm_nexell.pc
550
	etnaviv/Makefile
562
	etnaviv/Makefile
551
	etnaviv/libdrm_etnaviv.pc
563
	etnaviv/libdrm_etnaviv.pc
552
	tests/Makefile
564
	tests/Makefile
Lines 581-585 Link Here
581
echo "  Freedreno API  $FREEDRENO (kgsl: $FREEDRENO_KGSL)"
593
echo "  Freedreno API  $FREEDRENO (kgsl: $FREEDRENO_KGSL)"
582
echo "  Tegra API      $TEGRA"
594
echo "  Tegra API      $TEGRA"
583
echo "  VC4 API        $VC4"
595
echo "  VC4 API        $VC4"
596
echo "  NEXELL API     $NEXELL"
584
echo "  Etnaviv API    $ETNAVIV"
597
echo "  Etnaviv API    $ETNAVIV"
585
echo ""
598
echo ""
(-)./Makefile.am (+5 lines)
Lines 90-95 Link Here
90
ETNAVIV_SUBDIR = etnaviv
90
ETNAVIV_SUBDIR = etnaviv
91
endif
91
endif
92
92
93
if HAVE_NEXELL
94
NEXELL_SUBDIR = nexell
95
endif
96
93
if BUILD_MANPAGES
97
if BUILD_MANPAGES
94
if HAVE_MANPAGES_STYLESHEET
98
if HAVE_MANPAGES_STYLESHEET
95
MAN_SUBDIR = man
99
MAN_SUBDIR = man
Lines 108-113 Link Here
108
	$(FREEDRENO_SUBDIR) \
112
	$(FREEDRENO_SUBDIR) \
109
	$(TEGRA_SUBDIR) \
113
	$(TEGRA_SUBDIR) \
110
	$(VC4_SUBDIR) \
114
	$(VC4_SUBDIR) \
115
	$(NEXELL_SUBDIR) \
111
	$(ETNAVIV_SUBDIR) \
116
	$(ETNAVIV_SUBDIR) \
112
	tests \
117
	tests \
113
	$(MAN_SUBDIR)
118
	$(MAN_SUBDIR)
(-)./nexell/Makefile.am (+22 lines)
Line 0 Link Here
1
AM_CFLAGS = \
2
	$(WARN_CFLAGS) \
3
	$(VISIBILITY_CFLAGS) \
4
	-I$(top_srcdir) \
5
	-I$(top_srcdir)/nexell \
6
	-I$(top_srcdir)/include/drm
7
8
libdrm_nexell_la_LTLIBRARIES = libdrm_nexell.la
9
libdrm_nexell_ladir = $(libdir)
10
libdrm_nexell_la_LDFLAGS = -version-number 1:0:0 -no-undefined
11
libdrm_nexell_la_LIBADD = ../libdrm.la
12
13
libdrm_nexell_la_SOURCES = \
14
	nexell_drm.c
15
16
libdrm_nexellcommonincludedir = ${includedir}/nexell
17
libdrm_nexellcommoninclude_HEADERS = nexell_drm.h
18
libdrm_nexellincludedir = ${includedir}/libdrm
19
libdrm_nexellinclude_HEADERS = nexell_drmif.h
20
21
pkgconfigdir = @pkgconfigdir@
22
pkgconfig_DATA = libdrm_nexell.pc
(-)./nexell/Makefile.in (+11 lines)
Line 0 Link Here
1
prefix=@prefix@
2
exec_prefix=@exec_prefix@
3
libdir=@libdir@
4
includedir=@includedir@
5
6
Name: libdrm_nexell
7
Description: Userspace interface to nexell kernel DRM services
8
Version: 0.7
9
Libs: -L${libdir} -ldrm_nexell
10
Cflags: -I${includedir} -I${includedir}/libdrm -I${includedir}/nexell
11
Requires.private: libdrm
(-)./nexell/libdrm_nexell.pc.in (+11 lines)
Line 0 Link Here
1
prefix=@prefix@
2
exec_prefix=@exec_prefix@
3
libdir=@libdir@
4
includedir=@includedir@
5
6
Name: libdrm_nexell
7
Description: Userspace interface to nexell kernel DRM services
8
Version: 0.7
9
Libs: -L${libdir} -ldrm_nexell
10
Cflags: -I${includedir} -I${includedir}/libdrm -I${includedir}/nexell
11
Requires.private: libdrm
(-)./nexell/nexell_drm.c (+82 lines)
Line 0 Link Here
1
/*
2
 * Copyright (C) 2016  Nexell Co., Ltd.
3
 * Author: hyejung, kwon <cjscld15@nexell.co.kr>
4
 *
5
 * Permission is hereby granted, free of charge, to any person obtaining a
6
 * copy of this software and associated documentation files (the
7
 * "Software"), to deal in the Software without restriction, including
8
 * without limitation the rights to use, copy, modify, merge, publish,
9
 * distribute, sub license, and/or sell copies of the Software, and to
10
 * permit persons to whom the Software is furnished to do so, subject to
11
 * the following conditions:
12
 *
13
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
 * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
16
 * THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM,
17
 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
18
 * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
19
 * USE OR OTHER DEALINGS IN THE SOFTWARE.
20
 *
21
 * The above copyright notice and this permission notice (including the
22
 * next paragraph) shall be included in all copies or substantial portions
23
 * of the Software.
24
 *
25
 */
26
27
#ifdef HAVE_CONFIG_H
28
#include "config.h"
29
#endif
30
31
#include <stdio.h>
32
#include <stdlib.h>
33
#include <errno.h>
34
#include <stdint.h>
35
36
#include <xf86drm.h>
37
38
#include "nexell_drm.h"
39
#include "nexell_drmif.h"
40
41
/**
42
 * return gem_fd
43
 */
44
int nx_alloc_gem(int drm_fd, int size, int flags)
45
{
46
	struct nx_drm_gem_create arg = { 0, };
47
	int ret;
48
49
	arg.size = size;
50
	arg.flags = flags;
51
52
	ret = drmCommandWriteRead(drm_fd, DRM_NX_GEM_CREATE, &arg,
53
				     sizeof(arg));
54
	if (ret) {
55
		perror("drmCommandWriteRead\n");
56
		return ret;
57
	}
58
59
	return arg.handle;
60
}
61
62
void nx_free_gem(int drm_fd, int gem)
63
{
64
	struct drm_gem_close arg = {0, };
65
66
	arg.handle = gem;
67
	drmIoctl(drm_fd, DRM_IOCTL_GEM_CLOSE, &arg);
68
}
69
70
/**
71
 * return dmabuf fd
72
 */
73
int nx_gem_to_dmafd(int drm_fd, int gem_fd)
74
{
75
	int ret, fd;
76
77
	ret = drmPrimeHandleToFD(drm_fd, gem_fd, 0, &fd);
78
	if (ret)
79
		return ret;
80
81
	return fd;
82
}
(-)./nexell/nexell_drm.h (+74 lines)
Line 0 Link Here
1
/*
2
 * Copyright (C) 2016  Nexell Co., Ltd.
3
 * Author: hyejung, kwon <cjscld15@nexell.co.kr>
4
 *
5
 * Permission is hereby granted, free of charge, to any person obtaining a
6
 * copy of this software and associated documentation files (the
7
 * "Software"), to deal in the Software without restriction, including
8
 * without limitation the rights to use, copy, modify, merge, publish,
9
 * distribute, sub license, and/or sell copies of the Software, and to
10
 * permit persons to whom the Software is furnished to do so, subject to
11
 * the following conditions:
12
 *
13
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
 * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
16
 * THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM,
17
 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
18
 * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
19
 * USE OR OTHER DEALINGS IN THE SOFTWARE.
20
 *
21
 * The above copyright notice and this permission notice (including the
22
 * next paragraph) shall be included in all copies or substantial portions
23
 * of the Software.
24
 *
25
 */
26
27
#ifndef _UAPI_NX_DRM_H_
28
#define _UAPI_NX_DRM_H_
29
30
#include "drm.h"
31
32
/**
33
 * User-desired buffer creation information structure.
34
 *
35
 * @size: user-desired memory allocation size.
36
 *	- this size value would be page-aligned internally.
37
 * @flags: user request for setting memory type or cache attributes.
38
 * @handle: returned a handle to created gem object.
39
 *	- this handle will be set by gem module of kernel side.
40
 */
41
struct nx_drm_gem_create {
42
	uint64_t size;
43
	unsigned int flags;
44
	unsigned int handle;
45
};
46
47
/**
48
 * A structure to gem information.
49
 *
50
 * @handle: a handle to gem object created.
51
 * @flags: flag value including memory type and cache attribute and
52
 *	this value would be set by driver.
53
 * @size: size to memory region allocated by gem and this size would
54
 *	be set by driver.
55
 */
56
struct nx_drm_gem_info {
57
	unsigned int handle;
58
	unsigned int flags;
59
	uint64_t size;
60
};
61
62
#define DRM_NX_GEM_CREATE		0x00
63
#define DRM_NX_GEM_GET			0x04
64
#define DRM_NX_GEM_SYNC			0x05
65
66
#define DRM_IOCTL_NX_GEM_CREATE	DRM_IOWR(DRM_COMMAND_BASE + \
67
		DRM_NX_GEM_CREATE, struct nx_drm_gem_create)
68
69
#define DRM_IOCTL_NX_GEM_SYNC	DRM_IOWR(DRM_COMMAND_BASE + \
70
		DRM_NX_GEM_SYNC, struct nx_drm_gem_create)
71
72
#define DRM_IOCTL_NX_GEM_GET	DRM_IOWR(DRM_COMMAND_BASE + \
73
		DRM_NX_GEM_GET,	struct nx_drm_gem_info)
74
#endif
(-)./nexell/nexell_drmif.h (+43 lines)
Line 0 Link Here
1
/*
2
 * Copyright (C) 2016  Nexell Co., Ltd.
3
 * Author: hyejung, kwon <cjscld15@nexell.co.kr>
4
 *
5
 * Permission is hereby granted, free of charge, to any person obtaining a
6
 * copy of this software and associated documentation files (the
7
 * "Software"), to deal in the Software without restriction, including
8
 * without limitation the rights to use, copy, modify, merge, publish,
9
 * distribute, sub license, and/or sell copies of the Software, and to
10
 * permit persons to whom the Software is furnished to do so, subject to
11
 * the following conditions:
12
 *
13
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
 * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
16
 * THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM,
17
 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
18
 * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
19
 * USE OR OTHER DEALINGS IN THE SOFTWARE.
20
 *
21
 * The above copyright notice and this permission notice (including the
22
 * next paragraph) shall be included in all copies or substantial portions
23
 * of the Software.
24
 *
25
 */
26
27
#ifndef _NEXELL_DRMIF_H
28
#define _NEXELL_DRMIF_H
29
30
#ifdef __cplusplus
31
extern "C" {
32
#endif
33
34
int nx_alloc_gem(int drm_fd, int size, int flags);
35
int nx_gem_to_dmafd(int drm_fd, int gem_fd);
36
void nx_free_gem(int drm_fd, int gem);
37
38
#ifdef __cplusplus
39
}
40
#endif
41
42
#endif
43

Return to bug 622390