diff options
author | Steev Klimaszewski <steev@gentoo.org> | 2013-08-06 19:40:16 -0500 |
---|---|---|
committer | Steev Klimaszewski <steev@gentoo.org> | 2013-08-06 19:40:16 -0500 |
commit | 272ddc1bbaeee9c3bf44b04c7d192f6d30250182 (patch) | |
tree | d54d04e06c6f1a1fd68b12739011c8e7df78edb9 | |
parent | mesa: Add mesa with tegra support (diff) | |
download | arm-272ddc1bbaeee9c3bf44b04c7d192f6d30250182.tar.gz arm-272ddc1bbaeee9c3bf44b04c7d192f6d30250182.tar.bz2 arm-272ddc1bbaeee9c3bf44b04c7d192f6d30250182.zip |
libdrm: Add libdrm with tegra support
This is based off the libdrm-9999 ebuild from the x11 overlay
-rw-r--r-- | x11-libs/libdrm/Manifest | 2 | ||||
-rw-r--r-- | x11-libs/libdrm/files/libdrm-2.4.28-solaris.patch | 111 | ||||
-rw-r--r-- | x11-libs/libdrm/libdrm-9999.ebuild | 55 |
3 files changed, 168 insertions, 0 deletions
diff --git a/x11-libs/libdrm/Manifest b/x11-libs/libdrm/Manifest new file mode 100644 index 0000000..556c98e --- /dev/null +++ b/x11-libs/libdrm/Manifest @@ -0,0 +1,2 @@ +AUX libdrm-2.4.28-solaris.patch 3202 SHA256 04440ea802761e27c6f3a39a8bbfba71d707c3b3380885540be2e0f56ef58334 SHA512 5e7edfdad3090a84ef1876281986d0e6af949af6c61eeaff17bf250891d6d7d9f594802f02fe01921c350b05c15e52bc27f3235c3cf4803441a524ea741471d2 WHIRLPOOL bedeb2a2faab18dff6bf5894a3adc9c7a3ccc6f825fa257125be7c25965de3c354f43b4c35b5e370a06d674ec205747fb1d1c5f86329f6c8cfa1cbc33aceeef4 +EBUILD libdrm-9999.ebuild 1637 SHA256 c55f9a42b66aa0b8a5ad154f1694814ec8ef6aee65dcb213acc2b37fa0e503f7 SHA512 9ec9ae8db315725f1fa308df91be36179a094254297478ba34cdb70cc25617e3b88cc0efa4f15811f876903b4f468921859f3f32db7b4d760e7e0bba1ebd2c38 WHIRLPOOL 001ad2d6f5b9aeba9f1cc207d0bb2eccadd6b719b16e021f1519bb1f6250515bfc81b86f9d26f6a1c57bd3b5280fffece8fa42b1ebc19a19a868cc23e0f4eef4 diff --git a/x11-libs/libdrm/files/libdrm-2.4.28-solaris.patch b/x11-libs/libdrm/files/libdrm-2.4.28-solaris.patch new file mode 100644 index 0000000..0311a00 --- /dev/null +++ b/x11-libs/libdrm/files/libdrm-2.4.28-solaris.patch @@ -0,0 +1,111 @@ +Index: libdrm-2.4.23/include/drm/drm.h +=================================================================== +--- libdrm-2.4.23.orig/include/drm/drm.h ++++ libdrm-2.4.23/include/drm/drm.h +@@ -54,7 +54,11 @@ typedef int32_t __s32; + typedef uint32_t __u32; + typedef int64_t __s64; + typedef uint64_t __u64; ++#if defined(__sun) ++typedef unsigned long long drm_handle_t; ++#else + typedef unsigned long drm_handle_t; ++#endif + + #endif + +@@ -210,12 +214,22 @@ struct drm_ctx_priv_map { + * \sa drmAddMap(). + */ + struct drm_map { ++#ifdef __sun ++ unsigned long long offset; ++ /**< Requested physical address (0 for SAREA)*/ ++ unsigned long long handle; ++ /**< User-space: "Handle" to pass to mmap() */ ++ /**< Kernel-space: kernel-virtual address */ ++#else + unsigned long offset; /**< Requested physical address (0 for SAREA)*/ ++#endif + unsigned long size; /**< Requested physical size (bytes) */ + enum drm_map_type type; /**< Type of memory to map */ + enum drm_map_flags flags; /**< Flags */ ++#ifndef __sun + void *handle; /**< User-space: "Handle" to pass to mmap() */ + /**< Kernel-space: kernel-virtual address */ ++#endif + int mtrr; /**< MTRR slot used */ + /* Private data */ + }; +@@ -379,6 +393,9 @@ struct drm_buf_map { + void *virtual; /**< Mmap'd area in user-virtual */ + #endif + struct drm_buf_pub *list; /**< Buffer information */ ++#ifdef __sun ++ int fd; ++#endif + }; + + /** +Index: libdrm-2.4.23/radeon/radeon_bo_gem.c +=================================================================== +--- libdrm-2.4.23.orig/radeon/radeon_bo_gem.c ++++ libdrm-2.4.23/radeon/radeon_bo_gem.c +@@ -38,6 +38,13 @@ + #include <string.h> + #include <sys/mman.h> + #include <errno.h> ++ ++/* On solaris unistd.h and stropts.h are needed for ioctl */ ++#ifdef __sun ++#include <unistd.h> ++#include <stropts.h> ++#endif ++ + #include "xf86drm.h" + #include "xf86atomic.h" + #include "drm.h" +Index: libdrm-2.4.23/xf86drm.c +=================================================================== +--- libdrm-2.4.23.orig/xf86drm.c ++++ libdrm-2.4.23/xf86drm.c +@@ -972,7 +972,11 @@ int drmRmMap(int fd, drm_handle_t handle + { + drm_map_t map; + ++#ifdef __sun ++ map.handle = handle; ++#else + map.handle = (void *)(uintptr_t)handle; ++#endif + + if(drmIoctl(fd, DRM_IOCTL_RM_MAP, &map)) + return -errno; +@@ -1210,6 +1214,9 @@ drmBufMapPtr drmMapBufs(int fd) + bufs.count = 0; + bufs.list = NULL; + bufs.virtual = NULL; ++#ifdef __sun ++ bufs.fd = fd; ++#endif + if (drmIoctl(fd, DRM_IOCTL_MAP_BUFS, &bufs)) + return NULL; + +Index: libdrm-2.4.23/xf86drm.h +=================================================================== +--- libdrm-2.4.23.orig/xf86drm.h ++++ libdrm-2.4.23/xf86drm.h +@@ -64,6 +64,13 @@ + + #endif + ++#if defined(__sun) && !defined(_IOC) ++#define _IOC(dir, group, nr, size) \ ++ (dir == DRM_IOC_READWRITE ? _IOWRN(group, nr, size) : \ ++ (dir == DRM_IOC_WRITE ? _IOWN(group, nr, size) : \ ++ /* dir == DRM_IOC_READ */ _IORN(group, nr, size) )) ++#endif ++ + /* Defaults, if nothing set in xf86config */ + #define DRM_DEV_UID 0 + #define DRM_DEV_GID 0 diff --git a/x11-libs/libdrm/libdrm-9999.ebuild b/x11-libs/libdrm/libdrm-9999.ebuild new file mode 100644 index 0000000..0bdbafc --- /dev/null +++ b/x11-libs/libdrm/libdrm-9999.ebuild @@ -0,0 +1,55 @@ +# Copyright 1999-2013 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: $ + +EAPI=5 +inherit xorg-2 + +DESCRIPTION="X.Org libdrm library" +HOMEPAGE="http://dri.freedesktop.org/" +if [[ ${PV} = 9999* ]]; then + EGIT_REPO_URI="git://github.com/grate-driver/libdrm" +else + SRC_URI="http://dri.freedesktop.org/${PN}/${P}.tar.bz2" +fi + +KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~x64-freebsd ~x86-freebsd ~amd64-linux ~arm-linux ~x86-linux ~sparc-solaris ~x64-solaris ~x86-solaris" +VIDEO_CARDS="exynos freedreno intel nouveau omap radeon tegra vmware" +for card in ${VIDEO_CARDS}; do + IUSE_VIDEO_CARDS+=" video_cards_${card}" +done + +IUSE="${IUSE_VIDEO_CARDS} libkms" +RESTRICT="test" # see bug #236845 + +RDEPEND="dev-libs/libpthread-stubs + video_cards_intel? ( >=x11-libs/libpciaccess-0.10 )" +DEPEND="${RDEPEND}" + +PATCHES=( + "${FILESDIR}"/${PN}-2.4.28-solaris.patch +) + +src_prepare() { + if [[ ${PV} = 9999* ]]; then + # tests are restricted, no point in building them + sed -ie 's/tests //' "${S}"/Makefile.am + fi + xorg-2_src_prepare +} + +src_configure() { + XORG_CONFIGURE_OPTIONS=( + --enable-udev + $(use_enable video_cards_exynos exynos-experimental-api) + $(use_enable video_cards_freedreno freedreno-experimental-api) + $(use_enable video_cards_intel intel) + $(use_enable video_cards_nouveau nouveau) + $(use_enable video_cards_omap omap-experimental-api) + $(use_enable video_cards_radeon radeon) + $(use_enable video_cards_tegra tegra-experimental-api) + $(use_enable video_cards_vmware vmwgfx) + $(use_enable libkms) + ) + xorg-2_src_configure +} |