Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 477512 Details for
Bug 622390
x11-libs/libdrm add nexell support
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
patch for adding nexell support
libdrm+nexell.patch (text/plain), 10.38 KB, created by
Alexander 'E-Razor' Krause
on 2017-06-21 14:06:37 UTC
(
hide
)
Description:
patch for adding nexell support
Filename:
MIME Type:
Creator:
Alexander 'E-Razor' Krause
Created:
2017-06-21 14:06:37 UTC
Size:
10.38 KB
patch
obsolete
>diff -Naur ./configure.ac configure.ac >--- ./configure.ac 2017-05-24 17:03:41.000000000 +0200 >+++ configure.ac 2017-06-20 14:51:50.423472446 +0200 >@@ -154,6 +154,11 @@ > [Enable support for etnaviv's experimental API (default: disabled)]), > [ETNAVIV=$enableval], [ETNAVIV=no]) > >+AC_ARG_ENABLE(nexell, >+ AS_HELP_STRING([--enable-nexell], >+ [Enable support for nexell (default: disabled)]), >+ [NEXELL=$enableval], [NEXELL=no]) >+ > AC_ARG_ENABLE(install-test-programs, > AS_HELP_STRING([--enable-install-test-programs], > [Install test programs (default: no)]), >@@ -443,6 +448,11 @@ > AC_DEFINE(HAVE_ETNAVIV, 1, [Have etnaviv support]) > fi > >+AM_CONDITIONAL(HAVE_NEXELL, [test "x$NEXELL" = xyes]) >+if test "x$NEXELL" = xyes; then >+ AC_DEFINE(HAVE_NEXELL, 1, [Have NEXELL support]) >+fi >+ > AM_CONDITIONAL(HAVE_INSTALL_TESTS, [test "x$INSTALL_TESTS" = xyes]) > if test "x$INSTALL_TESTS" = xyes; then > AC_DEFINE(HAVE_INSTALL_TESTS, 1, [Install test programs]) >@@ -547,6 +557,8 @@ > tegra/libdrm_tegra.pc > vc4/Makefile > vc4/libdrm_vc4.pc >+ nexell/Makefile >+ nexell/libdrm_nexell.pc > etnaviv/Makefile > etnaviv/libdrm_etnaviv.pc > tests/Makefile >@@ -581,5 +593,6 @@ > echo " Freedreno API $FREEDRENO (kgsl: $FREEDRENO_KGSL)" > echo " Tegra API $TEGRA" > echo " VC4 API $VC4" >+echo " NEXELL API $NEXELL" > echo " Etnaviv API $ETNAVIV" > echo "" >diff -Naur ./Makefile.am Makefile.am >--- ./Makefile.am 2017-05-24 17:03:41.000000000 +0200 >+++ Makefile.am 2017-06-20 14:51:40.080127934 +0200 >@@ -90,6 +90,10 @@ > ETNAVIV_SUBDIR = etnaviv > endif > >+if HAVE_NEXELL >+NEXELL_SUBDIR = nexell >+endif >+ > if BUILD_MANPAGES > if HAVE_MANPAGES_STYLESHEET > MAN_SUBDIR = man >@@ -108,6 +112,7 @@ > $(FREEDRENO_SUBDIR) \ > $(TEGRA_SUBDIR) \ > $(VC4_SUBDIR) \ >+ $(NEXELL_SUBDIR) \ > $(ETNAVIV_SUBDIR) \ > tests \ > $(MAN_SUBDIR) >diff -Naur ./nexell/Makefile.am nexell/Makefile.am >--- ./nexell/Makefile.am 1970-01-01 01:00:00.000000000 +0100 >+++ nexell/Makefile.am 2017-06-20 14:50:03.350260609 +0200 >@@ -0,0 +1,22 @@ >+AM_CFLAGS = \ >+ $(WARN_CFLAGS) \ >+ $(VISIBILITY_CFLAGS) \ >+ -I$(top_srcdir) \ >+ -I$(top_srcdir)/nexell \ >+ -I$(top_srcdir)/include/drm >+ >+libdrm_nexell_la_LTLIBRARIES = libdrm_nexell.la >+libdrm_nexell_ladir = $(libdir) >+libdrm_nexell_la_LDFLAGS = -version-number 1:0:0 -no-undefined >+libdrm_nexell_la_LIBADD = ../libdrm.la >+ >+libdrm_nexell_la_SOURCES = \ >+ nexell_drm.c >+ >+libdrm_nexellcommonincludedir = ${includedir}/nexell >+libdrm_nexellcommoninclude_HEADERS = nexell_drm.h >+libdrm_nexellincludedir = ${includedir}/libdrm >+libdrm_nexellinclude_HEADERS = nexell_drmif.h >+ >+pkgconfigdir = @pkgconfigdir@ >+pkgconfig_DATA = libdrm_nexell.pc >diff -Naur ./nexell/Makefile.in nexell/Makefile.in >--- ./nexell/Makefile.in 1970-01-01 01:00:00.000000000 +0100 >+++ nexell/Makefile.in 2017-06-20 14:50:48.643388408 +0200 >@@ -0,0 +1,11 @@ >+prefix=@prefix@ >+exec_prefix=@exec_prefix@ >+libdir=@libdir@ >+includedir=@includedir@ >+ >+Name: libdrm_nexell >+Description: Userspace interface to nexell kernel DRM services >+Version: 0.7 >+Libs: -L${libdir} -ldrm_nexell >+Cflags: -I${includedir} -I${includedir}/libdrm -I${includedir}/nexell >+Requires.private: libdrm >diff -Naur ./nexell/libdrm_nexell.pc.in nexell/libdrm_nexell.pc.in >--- ./nexell/libdrm_nexell.pc.in 1970-01-01 01:00:00.000000000 +0100 >+++ nexell/libdrm_nexell.pc.in 2017-06-20 14:50:48.643388408 +0200 >@@ -0,0 +1,11 @@ >+prefix=@prefix@ >+exec_prefix=@exec_prefix@ >+libdir=@libdir@ >+includedir=@includedir@ >+ >+Name: libdrm_nexell >+Description: Userspace interface to nexell kernel DRM services >+Version: 0.7 >+Libs: -L${libdir} -ldrm_nexell >+Cflags: -I${includedir} -I${includedir}/libdrm -I${includedir}/nexell >+Requires.private: libdrm >diff -Naur ./nexell/nexell_drm.c nexell/nexell_drm.c >--- ./nexell/nexell_drm.c 1970-01-01 01:00:00.000000000 +0100 >+++ nexell/nexell_drm.c 2017-06-20 14:50:03.354260355 +0200 >@@ -0,0 +1,82 @@ >+/* >+ * Copyright (C) 2016 Nexell Co., Ltd. >+ * Author: hyejung, kwon <cjscld15@nexell.co.kr> >+ * >+ * 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, sub license, 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 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 NON-INFRINGEMENT. IN NO EVENT SHALL >+ * THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS 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. >+ * >+ * The above copyright notice and this permission notice (including the >+ * next paragraph) shall be included in all copies or substantial portions >+ * of the Software. >+ * >+ */ >+ >+#ifdef HAVE_CONFIG_H >+#include "config.h" >+#endif >+ >+#include <stdio.h> >+#include <stdlib.h> >+#include <errno.h> >+#include <stdint.h> >+ >+#include <xf86drm.h> >+ >+#include "nexell_drm.h" >+#include "nexell_drmif.h" >+ >+/** >+ * return gem_fd >+ */ >+int nx_alloc_gem(int drm_fd, int size, int flags) >+{ >+ struct nx_drm_gem_create arg = { 0, }; >+ int ret; >+ >+ arg.size = size; >+ arg.flags = flags; >+ >+ ret = drmCommandWriteRead(drm_fd, DRM_NX_GEM_CREATE, &arg, >+ sizeof(arg)); >+ if (ret) { >+ perror("drmCommandWriteRead\n"); >+ return ret; >+ } >+ >+ return arg.handle; >+} >+ >+void nx_free_gem(int drm_fd, int gem) >+{ >+ struct drm_gem_close arg = {0, }; >+ >+ arg.handle = gem; >+ drmIoctl(drm_fd, DRM_IOCTL_GEM_CLOSE, &arg); >+} >+ >+/** >+ * return dmabuf fd >+ */ >+int nx_gem_to_dmafd(int drm_fd, int gem_fd) >+{ >+ int ret, fd; >+ >+ ret = drmPrimeHandleToFD(drm_fd, gem_fd, 0, &fd); >+ if (ret) >+ return ret; >+ >+ return fd; >+} >diff -Naur ./nexell/nexell_drm.h nexell/nexell_drm.h >--- ./nexell/nexell_drm.h 1970-01-01 01:00:00.000000000 +0100 >+++ nexell/nexell_drm.h 2017-06-20 14:50:03.354260355 +0200 >@@ -0,0 +1,74 @@ >+/* >+ * Copyright (C) 2016 Nexell Co., Ltd. >+ * Author: hyejung, kwon <cjscld15@nexell.co.kr> >+ * >+ * 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, sub license, 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 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 NON-INFRINGEMENT. IN NO EVENT SHALL >+ * THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS 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. >+ * >+ * The above copyright notice and this permission notice (including the >+ * next paragraph) shall be included in all copies or substantial portions >+ * of the Software. >+ * >+ */ >+ >+#ifndef _UAPI_NX_DRM_H_ >+#define _UAPI_NX_DRM_H_ >+ >+#include "drm.h" >+ >+/** >+ * User-desired buffer creation information structure. >+ * >+ * @size: user-desired memory allocation size. >+ * - this size value would be page-aligned internally. >+ * @flags: user request for setting memory type or cache attributes. >+ * @handle: returned a handle to created gem object. >+ * - this handle will be set by gem module of kernel side. >+ */ >+struct nx_drm_gem_create { >+ uint64_t size; >+ unsigned int flags; >+ unsigned int handle; >+}; >+ >+/** >+ * A structure to gem information. >+ * >+ * @handle: a handle to gem object created. >+ * @flags: flag value including memory type and cache attribute and >+ * this value would be set by driver. >+ * @size: size to memory region allocated by gem and this size would >+ * be set by driver. >+ */ >+struct nx_drm_gem_info { >+ unsigned int handle; >+ unsigned int flags; >+ uint64_t size; >+}; >+ >+#define DRM_NX_GEM_CREATE 0x00 >+#define DRM_NX_GEM_GET 0x04 >+#define DRM_NX_GEM_SYNC 0x05 >+ >+#define DRM_IOCTL_NX_GEM_CREATE DRM_IOWR(DRM_COMMAND_BASE + \ >+ DRM_NX_GEM_CREATE, struct nx_drm_gem_create) >+ >+#define DRM_IOCTL_NX_GEM_SYNC DRM_IOWR(DRM_COMMAND_BASE + \ >+ DRM_NX_GEM_SYNC, struct nx_drm_gem_create) >+ >+#define DRM_IOCTL_NX_GEM_GET DRM_IOWR(DRM_COMMAND_BASE + \ >+ DRM_NX_GEM_GET, struct nx_drm_gem_info) >+#endif >diff -Naur ./nexell/nexell_drmif.h nexell/nexell_drmif.h >--- ./nexell/nexell_drmif.h 1970-01-01 01:00:00.000000000 +0100 >+++ nexell/nexell_drmif.h 2017-06-20 14:50:03.358260101 +0200 >@@ -0,0 +1,43 @@ >+/* >+ * Copyright (C) 2016 Nexell Co., Ltd. >+ * Author: hyejung, kwon <cjscld15@nexell.co.kr> >+ * >+ * 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, sub license, 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 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 NON-INFRINGEMENT. IN NO EVENT SHALL >+ * THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS 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. >+ * >+ * The above copyright notice and this permission notice (including the >+ * next paragraph) shall be included in all copies or substantial portions >+ * of the Software. >+ * >+ */ >+ >+#ifndef _NEXELL_DRMIF_H >+#define _NEXELL_DRMIF_H >+ >+#ifdef __cplusplus >+extern "C" { >+#endif >+ >+int nx_alloc_gem(int drm_fd, int size, int flags); >+int nx_gem_to_dmafd(int drm_fd, int gem_fd); >+void nx_free_gem(int drm_fd, int gem); >+ >+#ifdef __cplusplus >+} >+#endif >+ >+#endif >+
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 622390
:
477510
| 477512