summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--x11/libdrm/Makefile3
-rw-r--r--x11/libdrm/distinfo11
-rw-r--r--x11/libdrm/patches/patch-ab34
-rw-r--r--x11/libdrm/patches/patch-include_drm_drm.h27
-rw-r--r--x11/libdrm/patches/patch-intel_intel__bufmgr__gem.c68
-rw-r--r--x11/libdrm/patches/patch-radeon_radeon__bo__gem.c27
-rw-r--r--x11/libdrm/patches/patch-radeon_radeon__cs__gem.c16
-rw-r--r--x11/libdrm/patches/patch-xf86drmMode.c33
-rw-r--r--x11/libdrm/patches/patch-xf86drmMode.h13
9 files changed, 223 insertions, 9 deletions
diff --git a/x11/libdrm/Makefile b/x11/libdrm/Makefile
index 811933761da..e441e598249 100644
--- a/x11/libdrm/Makefile
+++ b/x11/libdrm/Makefile
@@ -1,6 +1,7 @@
-# $NetBSD: Makefile,v 1.48 2014/10/01 09:39:30 wiz Exp $
+# $NetBSD: Makefile,v 1.49 2014/10/26 10:20:10 wiz Exp $
DISTNAME= libdrm-2.4.58
+PKGREVISION= 1
CATEGORIES= x11 graphics
MASTER_SITES= http://dri.freedesktop.org/libdrm/
EXTRACT_SUFX= .tar.bz2
diff --git a/x11/libdrm/distinfo b/x11/libdrm/distinfo
index fecbee7df47..987beeeb31a 100644
--- a/x11/libdrm/distinfo
+++ b/x11/libdrm/distinfo
@@ -1,11 +1,16 @@
-$NetBSD: distinfo,v 1.46 2014/10/01 09:39:30 wiz Exp $
+$NetBSD: distinfo,v 1.47 2014/10/26 10:20:10 wiz Exp $
SHA1 (libdrm-2.4.58.tar.bz2) = ef9a647796fa326e99ca9026a6d847172f39c66c
RMD160 (libdrm-2.4.58.tar.bz2) = d765d1d5860014e7295c12edc28a4d696ce8b0f1
Size (libdrm-2.4.58.tar.bz2) = 573202 bytes
-SHA1 (patch-ab) = 66dadd3244bfa9c69be0982fd2108deb94483de2
+SHA1 (patch-ab) = f58a2edde2dde7cac69c1b196982431e79f04af6
SHA1 (patch-ac) = 67c998df7dfc0dabc86320ea6d015cede3e464ea
SHA1 (patch-ad) = b9c8d708830c8b182c8e491fe5a9e5d0f2d44a5f
-SHA1 (patch-include_drm_drm.h) = d370e83da5c39f0e49094787c5f4580758c911b0
+SHA1 (patch-include_drm_drm.h) = 5d6910c1548af6f9abc6cf0353238e7477119b0c
+SHA1 (patch-intel_intel__bufmgr__gem.c) = bab22f43ba85c48fd063b6ac667369d1223f908f
SHA1 (patch-libkms_linux.c) = 737d0a8e7b742ee9d24fec94c72de6b4915dd675
SHA1 (patch-libkms_vmwgfx.c) = d49c046a70e5c0edbdb0a424473324cc2a3b6243
+SHA1 (patch-radeon_radeon__bo__gem.c) = 4924fde172b2a2a713d47bf7b60a6b52851d7a8f
+SHA1 (patch-radeon_radeon__cs__gem.c) = 516b5dd6408c10a4f33f2815b3719e34a16d863a
+SHA1 (patch-xf86drmMode.c) = bb453075acd6e2ac8dcc588048c1d642defbf248
+SHA1 (patch-xf86drmMode.h) = a28b02887389be8670193c119f711901af61a6b2
diff --git a/x11/libdrm/patches/patch-ab b/x11/libdrm/patches/patch-ab
index 5becab0a760..e6ebbfd695b 100644
--- a/x11/libdrm/patches/patch-ab
+++ b/x11/libdrm/patches/patch-ab
@@ -1,6 +1,6 @@
-$NetBSD: patch-ab,v 1.5 2010/04/16 13:43:36 tnn Exp $
+$NetBSD: patch-ab,v 1.6 2014/10/26 10:20:10 wiz Exp $
---- xf86drm.c.orig 2010-03-05 23:21:13.000000000 +0000
+--- xf86drm.c.orig 2014-09-28 16:19:54.000000000 +0000
+++ xf86drm.c
@@ -64,7 +64,7 @@
#endif
@@ -11,3 +11,33 @@ $NetBSD: patch-ab,v 1.5 2010/04/16 13:43:36 tnn Exp $
#endif
# ifdef __OpenBSD__
+@@ -1128,6 +1128,9 @@ int drmClose(int fd)
+ int drmMap(int fd, drm_handle_t handle, drmSize size, drmAddressPtr address)
+ {
+ static unsigned long pagesize_mask = 0;
++#ifdef DRM_IOCTL_MMAP
++ struct drm_mmap mmap_req = {0};
++#endif
+
+ if (fd < 0)
+ return -EINVAL;
+@@ -1137,7 +1140,18 @@ int drmMap(int fd, drm_handle_t handle,
+
+ size = (size + pagesize_mask) & ~pagesize_mask;
+
+- *address = drm_mmap(0, size, PROT_READ|PROT_WRITE, MAP_SHARED, fd, handle);
++#ifdef DRM_IOCTL_MMAP
++ mmap_req.dnm_addr = NULL;
++ mmap_req.dnm_size = size;
++ mmap_req.dnm_prot = (PROT_READ | PROT_WRITE);
++ mmap_req.dnm_flags = MAP_SHARED;
++ mmap_req.dnm_offset = handle;
++ if (drmIoctl(fd, DRM_IOCTL_MMAP, &mmap_req) == 0) {
++ *address = mmap_req.dnm_addr;
++ return 0;
++ }
++#endif
++ *address = drm_mmap(0, size, PROT_READ|PROT_WRITE, MAP_SHARED, fd, handle);
+ if (*address == MAP_FAILED)
+ return -errno;
+ return 0;
diff --git a/x11/libdrm/patches/patch-include_drm_drm.h b/x11/libdrm/patches/patch-include_drm_drm.h
index 4ede5cfb53d..e310fd1a64d 100644
--- a/x11/libdrm/patches/patch-include_drm_drm.h
+++ b/x11/libdrm/patches/patch-include_drm_drm.h
@@ -1,10 +1,10 @@
-$NetBSD: patch-include_drm_drm.h,v 1.1 2012/08/13 09:05:07 wiz Exp $
+$NetBSD: patch-include_drm_drm.h,v 1.2 2014/10/26 10:20:10 wiz Exp $
Fix compilation on systems that don't provide O_CLOEXEC.
---- include/drm/drm.h.orig 2012-08-11 18:49:45.000000000 +0000
+--- include/drm/drm.h.orig 2014-06-14 12:33:26.000000000 +0000
+++ include/drm/drm.h
-@@ -618,7 +618,11 @@ struct drm_get_cap {
+@@ -641,7 +641,11 @@ struct drm_set_client_cap {
__u64 value;
};
@@ -16,3 +16,24 @@ Fix compilation on systems that don't provide O_CLOEXEC.
struct drm_prime_handle {
__u32 handle;
+@@ -759,6 +763,20 @@ struct drm_prime_handle {
+ #define DRM_IOCTL_MODE_OBJ_SETPROPERTY DRM_IOWR(0xBA, struct drm_mode_obj_set_property)
+ #define DRM_IOCTL_MODE_CURSOR2 DRM_IOWR(0xBB, struct drm_mode_cursor2)
+
++#ifdef __NetBSD__
++/*
++ * Instrumenting mmap is trickier than just making an ioctl to do it.
++ */
++struct drm_mmap {
++ void *dnm_addr; /* in/out */
++ size_t dnm_size; /* in */
++ int dnm_prot; /* in */
++ int dnm_flags; /* in */
++ off_t dnm_offset; /* in */
++};
++#define DRM_IOCTL_MMAP DRM_IOWR(0xff, struct drm_mmap)
++#endif
++
+ /**
+ * Device specific ioctls should only be in their respective headers
+ * The device specific ioctl range is from 0x40 to 0x99.
diff --git a/x11/libdrm/patches/patch-intel_intel__bufmgr__gem.c b/x11/libdrm/patches/patch-intel_intel__bufmgr__gem.c
new file mode 100644
index 00000000000..fc2cb017317
--- /dev/null
+++ b/x11/libdrm/patches/patch-intel_intel__bufmgr__gem.c
@@ -0,0 +1,68 @@
+$NetBSD: patch-intel_intel__bufmgr__gem.c,v 1.5 2014/10/26 10:20:10 wiz Exp $
+
+--- intel/intel_bufmgr_gem.c.orig 2014-09-28 16:19:54.000000000 +0000
++++ intel/intel_bufmgr_gem.c
+@@ -47,6 +47,7 @@
+ #include <unistd.h>
+ #include <assert.h>
+ #include <pthread.h>
++#include <stddef.h>
+ #include <sys/ioctl.h>
+ #include <sys/stat.h>
+ #include <sys/types.h>
+@@ -399,13 +400,13 @@ drm_intel_gem_dump_validation_list(drm_i
+ (drm_intel_bo_gem *) target_bo;
+
+ DBG("%2d: %d (%s)@0x%08llx -> "
+- "%d (%s)@0x%08lx + 0x%08x\n",
++ "%d (%s)@0x%08llx + 0x%08x\n",
+ i,
+ bo_gem->gem_handle, bo_gem->name,
+ (unsigned long long)bo_gem->relocs[j].offset,
+ target_gem->gem_handle,
+ target_gem->name,
+- target_bo->offset64,
++ (unsigned long long)target_bo->offset64,
+ bo_gem->relocs[j].delta);
+ }
+ }
+@@ -1380,12 +1381,10 @@ map_gtt(drm_intel_bo *bo)
+ }
+
+ /* and mmap it */
+- bo_gem->gtt_virtual = drm_mmap(0, bo->size, PROT_READ | PROT_WRITE,
+- MAP_SHARED, bufmgr_gem->fd,
+- mmap_arg.offset);
+- if (bo_gem->gtt_virtual == MAP_FAILED) {
++ ret = drmMap(bufmgr_gem->fd, mmap_arg.offset, bo->size,
++ &bo_gem->gtt_virtual);
++ if (ret) {
+ bo_gem->gtt_virtual = NULL;
+- ret = -errno;
+ DBG("%s:%d: Error mapping buffer %d (%s): %s .\n",
+ __FILE__, __LINE__,
+ bo_gem->gem_handle, bo_gem->name,
+@@ -1991,8 +1990,9 @@ drm_intel_update_buffer_offsets(drm_inte
+
+ /* Update the buffer offset */
+ if (bufmgr_gem->exec_objects[i].offset != bo->offset64) {
+- DBG("BO %d (%s) migrated: 0x%08lx -> 0x%08llx\n",
+- bo_gem->gem_handle, bo_gem->name, bo->offset64,
++ DBG("BO %d (%s) migrated: 0x%08llx -> 0x%08llx\n",
++ bo_gem->gem_handle, bo_gem->name,
++ (unsigned long long)bo->offset64,
+ (unsigned long long)bufmgr_gem->exec_objects[i].
+ offset);
+ bo->offset64 = bufmgr_gem->exec_objects[i].offset;
+@@ -2012,8 +2012,9 @@ drm_intel_update_buffer_offsets2 (drm_in
+
+ /* Update the buffer offset */
+ if (bufmgr_gem->exec2_objects[i].offset != bo->offset64) {
+- DBG("BO %d (%s) migrated: 0x%08lx -> 0x%08llx\n",
+- bo_gem->gem_handle, bo_gem->name, bo->offset64,
++ DBG("BO %d (%s) migrated: 0x%08llx -> 0x%08llx\n",
++ bo_gem->gem_handle, bo_gem->name,
++ (unsigned long long)bo->offset64,
+ (unsigned long long)bufmgr_gem->exec2_objects[i].offset);
+ bo->offset64 = bufmgr_gem->exec2_objects[i].offset;
+ bo->offset = bufmgr_gem->exec2_objects[i].offset;
diff --git a/x11/libdrm/patches/patch-radeon_radeon__bo__gem.c b/x11/libdrm/patches/patch-radeon_radeon__bo__gem.c
new file mode 100644
index 00000000000..977864f3e03
--- /dev/null
+++ b/x11/libdrm/patches/patch-radeon_radeon__bo__gem.c
@@ -0,0 +1,27 @@
+$NetBSD: patch-radeon_radeon__bo__gem.c,v 1.1 2014/10/26 10:20:10 wiz Exp $
+
+--- radeon/radeon_bo_gem.c.orig 2014-09-28 16:19:54.000000000 +0000
++++ radeon/radeon_bo_gem.c
+@@ -178,8 +178,8 @@ static int bo_map(struct radeon_bo_int *
+ boi, boi->handle, r);
+ return r;
+ }
+- ptr = drm_mmap(0, args.size, PROT_READ|PROT_WRITE, MAP_SHARED, boi->bom->fd, args.addr_ptr);
+- if (ptr == MAP_FAILED)
++ r = drmMap(boi->bom->fd, args.addr_ptr, args.size, &ptr);
++ if (r)
+ return -errno;
+ bo_gem->priv_ptr = ptr;
+ wait:
+@@ -252,9 +252,10 @@ static int bo_set_tiling(struct radeon_b
+ static int bo_get_tiling(struct radeon_bo_int *boi, uint32_t *tiling_flags,
+ uint32_t *pitch)
+ {
+- struct drm_radeon_gem_set_tiling args = {};
++ struct drm_radeon_gem_set_tiling args;
+ int r;
+
++ memset(&args, 0, sizeof args);
+ args.handle = boi->handle;
+
+ r = drmCommandWriteRead(boi->bom->fd,
diff --git a/x11/libdrm/patches/patch-radeon_radeon__cs__gem.c b/x11/libdrm/patches/patch-radeon_radeon__cs__gem.c
new file mode 100644
index 00000000000..ebe3d7f3e07
--- /dev/null
+++ b/x11/libdrm/patches/patch-radeon_radeon__cs__gem.c
@@ -0,0 +1,16 @@
+$NetBSD: patch-radeon_radeon__cs__gem.c,v 1.1 2014/10/26 10:20:10 wiz Exp $
+
+--- radeon/radeon_cs_gem.c.orig 2014-09-28 16:19:54.000000000 +0000
++++ radeon/radeon_cs_gem.c
+@@ -525,9 +525,10 @@ static struct radeon_cs_funcs radeon_cs_
+
+ static int radeon_get_device_id(int fd, uint32_t *device_id)
+ {
+- struct drm_radeon_info info = {};
++ struct drm_radeon_info info;
+ int r;
+
++ memset(&info, 0, sizeof info);
+ *device_id = 0;
+ info.request = RADEON_INFO_DEVICE_ID;
+ info.value = (uintptr_t)device_id;
diff --git a/x11/libdrm/patches/patch-xf86drmMode.c b/x11/libdrm/patches/patch-xf86drmMode.c
new file mode 100644
index 00000000000..a58fe4a5fed
--- /dev/null
+++ b/x11/libdrm/patches/patch-xf86drmMode.c
@@ -0,0 +1,33 @@
+$NetBSD: patch-xf86drmMode.c,v 1.1 2014/10/26 10:20:10 wiz Exp $
+
+--- xf86drmMode.c.orig 2014-08-27 18:04:46.000000000 +0000
++++ xf86drmMode.c
+@@ -806,6 +806,19 @@ int drmCheckModesettingSupported(const c
+ return -EINVAL;
+ return (modesetting ? 0 : -ENOSYS);
+ }
++#elif defined(__NetBSD__)
++ int fd;
++ static const struct drm_mode_card_res zero_res;
++ struct drm_mode_card_res res = zero_res;
++ int ret;
++
++ fd = drmOpen(NULL, busid);
++ if (fd == -1)
++ return -EINVAL;
++ ret = drmIoctl(fd, DRM_IOCTL_MODE_GETRESOURCES, &res);
++ drmClose(fd);
++ if (ret == 0)
++ return 0;
+ #elif defined(__DragonFly__)
+ return 0;
+ #endif
+@@ -908,7 +921,7 @@ int drmModePageFlip(int fd, uint32_t crt
+
+ int drmModeSetPlane(int fd, uint32_t plane_id, uint32_t crtc_id,
+ uint32_t fb_id, uint32_t flags,
+- int32_t crtc_x, int32_t crtc_y,
++ uint32_t crtc_x, uint32_t crtc_y,
+ uint32_t crtc_w, uint32_t crtc_h,
+ uint32_t src_x, uint32_t src_y,
+ uint32_t src_w, uint32_t src_h)
diff --git a/x11/libdrm/patches/patch-xf86drmMode.h b/x11/libdrm/patches/patch-xf86drmMode.h
new file mode 100644
index 00000000000..8a20d90dc25
--- /dev/null
+++ b/x11/libdrm/patches/patch-xf86drmMode.h
@@ -0,0 +1,13 @@
+$NetBSD: patch-xf86drmMode.h,v 1.1 2014/10/26 10:20:10 wiz Exp $
+
+--- xf86drmMode.h.orig 2014-06-14 12:33:26.000000000 +0000
++++ xf86drmMode.h
+@@ -449,7 +449,7 @@ extern drmModePlaneResPtr drmModeGetPlan
+ extern drmModePlanePtr drmModeGetPlane(int fd, uint32_t plane_id);
+ extern int drmModeSetPlane(int fd, uint32_t plane_id, uint32_t crtc_id,
+ uint32_t fb_id, uint32_t flags,
+- int32_t crtc_x, int32_t crtc_y,
++ uint32_t crtc_x, uint32_t crtc_y,
+ uint32_t crtc_w, uint32_t crtc_h,
+ uint32_t src_x, uint32_t src_y,
+ uint32_t src_w, uint32_t src_h);