x11-libs/libdrm: get newest version from main Gentoo tree

This version includes the boexec patch that was present in
chromiumos-overlay.

Change-Id: I9b0aa22f2f2615a3c03986d865df6a531271448b

R=marcheu@chromium.org
BUG=none
TEST=./setup_board && ./build_packages --nousepkg for x86-generic and arm-generic

Review URL: http://codereview.chromium.org/6778012
This commit is contained in:
Diego Elio Pettenò 2011-04-23 20:25:48 +02:00
parent f7b35e7a1c
commit 74fe398e98
2 changed files with 154 additions and 0 deletions

View File

@ -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 *)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

View File

@ -0,0 +1,43 @@
# Copyright 1999-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/x11-libs/libdrm/libdrm-2.4.24.ebuild,v 1.3 2011/03/28 22:08:38 flameeyes Exp $
EAPI=4
inherit xorg-2
EGIT_REPO_URI="git://anongit.freedesktop.org/git/mesa/drm"
DESCRIPTION="X.Org libdrm library"
HOMEPAGE="http://dri.freedesktop.org/"
if [[ ${PV} = 9999* ]]; then
SRC_URI=""
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 ~x86-fbsd ~x64-freebsd ~x86-freebsd ~amd64-linux ~x86-linux ~sparc-solaris ~x64-solaris ~x86-solaris"
VIDEO_CARDS="intel nouveau radeon 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"
DEPEND="${RDEPEND}"
PATCHES=(
"${FILESDIR}"/${PN}-2.4.23-solaris.patch
)
pkg_setup() {
CONFIGURE_OPTIONS="--enable-udev
$(use_enable video_cards_intel intel)
$(use_enable video_cards_nouveau nouveau-experimental-api)
$(use_enable video_cards_radeon radeon)
$(use_enable video_cards_vmware vmwgfx-experimental-api)
$(use_enable libkms)"
xorg-2_pkg_setup
}