summaryrefslogtreecommitdiff
path: root/usr/src/common/libdrm/patches
diff options
context:
space:
mode:
Diffstat (limited to 'usr/src/common/libdrm/patches')
-rw-r--r--usr/src/common/libdrm/patches/incl-drm-drm-h.patch (renamed from usr/src/common/libdrm/patches/solaris-drm-port.patch)161
-rw-r--r--usr/src/common/libdrm/patches/incl-drm-i915-drm-h.patch116
-rw-r--r--usr/src/common/libdrm/patches/libdrm-lists-h.patch28
-rw-r--r--usr/src/common/libdrm/patches/util-double-list-h.patch12
-rw-r--r--usr/src/common/libdrm/patches/util-math-h.patch11
-rw-r--r--usr/src/common/libdrm/patches/xf86drm-c.patch12
-rw-r--r--usr/src/common/libdrm/patches/xf86drm-h.patch49
-rw-r--r--usr/src/common/libdrm/patches/xf86drmMode-c.patch15
8 files changed, 243 insertions, 161 deletions
diff --git a/usr/src/common/libdrm/patches/solaris-drm-port.patch b/usr/src/common/libdrm/patches/incl-drm-drm-h.patch
index 5a0a973..152523a 100644
--- a/usr/src/common/libdrm/patches/solaris-drm-port.patch
+++ b/usr/src/common/libdrm/patches/incl-drm-drm-h.patch
@@ -25,17 +25,6 @@
# or other dealings in this Software without prior written authorization
# of the copyright holder.
-diff ... libdrm-2.4.64/amdgpu/amdgpu_cs.c
---- libdrm-2.4.64/amdgpu/amdgpu_cs.c.~1~ 2015-09-14 10:42:37.518409301 +0300
-+++ libdrm-2.4.64/amdgpu/amdgpu_cs.c 2015-09-14 10:42:52.951974725 +0300
-@@ -25,6 +25,7 @@
- #include "config.h"
- #endif
-
-+#include <alloca.h>
- #include <stdlib.h>
- #include <stdio.h>
- #include <string.h>
diff --git a/include/drm/drm.h b/include/drm/drm.h
index 8adb9d5..f9bedd0 100644
--- a/include/drm/drm.h 2016-04-28 03:44:16.000000000 +0300
@@ -142,153 +131,3 @@ index 8adb9d5..f9bedd0 100644
};
/**
-diff ... b/include/drm/i915_drm.h
---- a/include/drm/i915_drm.h
-+++ b/include/drm/i915_drm.h
-@@ -100,6 +100,7 @@
- int pf_current_page; /* which buffer is being displayed? */
- int perf_boxes; /* performance boxes to be displayed */
- int width, height; /* screen size in pixels */
-+ int pad0;
-
- drm_handle_t front_handle;
- int front_offset;
-@@ -139,6 +140,8 @@
- int pipeB_w;
- int pipeB_h;
-
-+ int pad1;
-+
- /* fill out some space for old userspace triple buffer */
- drm_handle_t unused_handle;
- __u32 unused1, unused2, unused3;
-@@ -296,6 +299,15 @@
- struct drm_clip_rect *cliprects; /* pointer to userspace cliprects */
- } drm_i915_batchbuffer_t;
-
-+typedef struct drm_i915_batchbuffer32 {
-+ int start; /* agp offset */
-+ int used; /* nr bytes in use */
-+ int DR1; /* hw flags for GFX_OP_DRAWRECT_INFO */
-+ int DR4; /* window origin for GFX_OP_DRAWRECT_INFO */
-+ int num_cliprects; /* mulitpass with multiple cliprects? */
-+ caddr32_t cliprects; /* pointer to userspace cliprects */
-+} drm_i915_batchbuffer32_t;
-+
- /* As above, but pass a pointer to userspace buffer which can be
- * validated by the kernel prior to sending to hardware.
- */
-@@ -308,6 +320,15 @@
- struct drm_clip_rect *cliprects; /* pointer to userspace cliprects */
- } drm_i915_cmdbuffer_t;
-
-+typedef struct drm_i915_cmdbuffer32 {
-+ caddr32_t buf; /* pointer to userspace command buffer */
-+ int sz; /* nr bytes in buf */
-+ int DR1; /* hw flags for GFX_OP_DRAWRECT_INFO */
-+ int DR4; /* window origin for GFX_OP_DRAWRECT_INFO */
-+ int num_cliprects; /* mulitpass with multiple cliprects? */
-+ caddr32_t cliprects; /* pointer to userspace cliprects */
-+} drm_i915_cmdbuffer32_t;
-+
- /* Userspace can request & wait on irq's:
- */
- typedef struct drm_i915_irq_emit {
-@@ -314,6 +335,10 @@
- int *irq_seq;
- } drm_i915_irq_emit_t;
-
-+typedef struct drm_i915_irq_emit32 {
-+ caddr32_t irq_seq;
-+} drm_i915_irq_emit32_t;
-+
- typedef struct drm_i915_irq_wait {
- int irq_seq;
- } drm_i915_irq_wait_t;
-@@ -369,6 +394,11 @@
- int *value;
- } drm_i915_getparam_t;
-
-+typedef struct drm_i915_getparam32 {
-+ int param;
-+ caddr32_t value;
-+} drm_i915_getparam32_t;
-+
- /* Ioctl to set kernel params:
- */
- #define I915_SETPARAM_USE_MI_BATCHBUFFER_START 1
-@@ -392,6 +422,13 @@
- int *region_offset; /* offset from start of fb or agp */
- } drm_i915_mem_alloc_t;
-
-+typedef struct drm_i915_mem_alloc32 {
-+ int region;
-+ int alignment;
-+ int size;
-+ caddr32_t region_offset; /* offset from start of fb or agp */
-+} drm_i915_mem_alloc32_t;
-+
- typedef struct drm_i915_mem_free {
- int region;
- int region_offset;
-diff --git a/libkms/linux.c b/libkms/linux.c
-index fc4f205..5d66fc7 100644
---- libdrm-2.4.64/libkms/linux.c.~1~ 2015-09-14 10:39:04.176885400 +0300
-+++ libdrm-2.4.64/libkms/linux.c 2015-09-14 10:40:12.713465696 +0300
-@@ -40,6 +40,7 @@
- #include <string.h>
- #include <unistd.h>
- #include <sys/stat.h>
-+#include <sys/sysmacros.h>
- #include <sys/types.h>
- #ifdef MAJOR_IN_MKDEV
- #include <sys/mkdev.h>
-diff ... b/xf86drm.c
---- a/xf86drm.c Fri Mar 20 07:05:48 2015
-+++ b/xf86drm.c Fri Mar 20 07:06:10 2015
-@@ -1108,7 +1108,7 @@
- drm_map_t map;
-
- memclear(map);
-- map.handle = (void *)(uintptr_t)handle;
-+ map.handle = (drm_handle_t)(uintptr_t)handle;
-
- if(drmIoctl(fd, DRM_IOCTL_RM_MAP, &map))
- return -errno;
-diff --git a/xf86drm.h b/xf86drm.h
-index 76eb94e..6a14120 100644
---- a/xf86drm.h
-+++ b/xf86drm.h
-@@ -472,6 +472,17 @@
- #endif /* architecture */
- #endif /* __GNUC__ >= 2 */
-
-+#if defined(__SUNPRO_C)
-+#include <atomic.h>
-+#define atomic_cmpset_int(p, c, n) ((c == atomic_cas_uint(p, c, n)) ? 1 : 0)
-+#define DRM_CAS(lock,old,new,__ret) \
-+ do { \
-+ unsigned int __result, __old = (old);\
-+ __result = !atomic_cmpset_int(lock,__old,new);\
-+ __ret = __result; \
-+ } while(0)
-+#endif
-+
- #ifndef DRM_CAS
- #define DRM_CAS(lock,old,new,ret) do { ret=1; } while (0) /* FAST LOCK FAILS */
- #endif
-diff --git a/xf86drmMode.c b/xf86drmMode.c
-index c809c44..715f23a 100644
---- libdrm-2.4.64/xf86drmMode.c.~1~ 2015-09-14 10:33:51.340507095 +0300
-+++ libdrm-2.4.64/xf86drmMode.c 2015-09-14 10:36:09.881744836 +0300
-@@ -850,7 +850,9 @@
- drmClose(fd);
- return 0;
- #endif
-- return -ENOSYS;
-+
-+/* for now return 0 on solaris */
-+ return 0;
- }
-
- int drmModeCrtcGetGamma(int fd, uint32_t crtc_id, uint32_t size,
diff --git a/usr/src/common/libdrm/patches/incl-drm-i915-drm-h.patch b/usr/src/common/libdrm/patches/incl-drm-i915-drm-h.patch
new file mode 100644
index 0000000..ac49639
--- /dev/null
+++ b/usr/src/common/libdrm/patches/incl-drm-i915-drm-h.patch
@@ -0,0 +1,116 @@
+# Copyright (c) 2006, 2015, Oracle and/or its affiliates. All rights reserved.
+#
+# 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, and/or sell copies of the Software, and to permit persons
+# to whom the Software is furnished to do so, provided that the above
+# copyright notice(s) and this permission notice appear in all copies of
+# the Software and that both the above copyright notice(s) and this
+# permission notice appear in supporting documentation.
+#
+# 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 NONINFRINGEMENT
+# OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
+# HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
+# INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
+# FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+# WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+#
+# Except as contained in this notice, the name of a copyright holder
+# shall not be used in advertising or otherwise to promote the sale, use
+# or other dealings in this Software without prior written authorization
+# of the copyright holder.
+
+diff ... b/include/drm/i915_drm.h
+--- a/include/drm/i915_drm.h
++++ b/include/drm/i915_drm.h
+@@ -100,6 +100,7 @@
+ int pf_current_page; /* which buffer is being displayed? */
+ int perf_boxes; /* performance boxes to be displayed */
+ int width, height; /* screen size in pixels */
++ int pad0;
+
+ drm_handle_t front_handle;
+ int front_offset;
+@@ -139,6 +140,8 @@
+ int pipeB_w;
+ int pipeB_h;
+
++ int pad1;
++
+ /* fill out some space for old userspace triple buffer */
+ drm_handle_t unused_handle;
+ __u32 unused1, unused2, unused3;
+@@ -296,6 +299,15 @@
+ struct drm_clip_rect *cliprects; /* pointer to userspace cliprects */
+ } drm_i915_batchbuffer_t;
+
++typedef struct drm_i915_batchbuffer32 {
++ int start; /* agp offset */
++ int used; /* nr bytes in use */
++ int DR1; /* hw flags for GFX_OP_DRAWRECT_INFO */
++ int DR4; /* window origin for GFX_OP_DRAWRECT_INFO */
++ int num_cliprects; /* mulitpass with multiple cliprects? */
++ caddr32_t cliprects; /* pointer to userspace cliprects */
++} drm_i915_batchbuffer32_t;
++
+ /* As above, but pass a pointer to userspace buffer which can be
+ * validated by the kernel prior to sending to hardware.
+ */
+@@ -308,6 +320,15 @@
+ struct drm_clip_rect *cliprects; /* pointer to userspace cliprects */
+ } drm_i915_cmdbuffer_t;
+
++typedef struct drm_i915_cmdbuffer32 {
++ caddr32_t buf; /* pointer to userspace command buffer */
++ int sz; /* nr bytes in buf */
++ int DR1; /* hw flags for GFX_OP_DRAWRECT_INFO */
++ int DR4; /* window origin for GFX_OP_DRAWRECT_INFO */
++ int num_cliprects; /* mulitpass with multiple cliprects? */
++ caddr32_t cliprects; /* pointer to userspace cliprects */
++} drm_i915_cmdbuffer32_t;
++
+ /* Userspace can request & wait on irq's:
+ */
+ typedef struct drm_i915_irq_emit {
+@@ -314,6 +335,10 @@
+ int *irq_seq;
+ } drm_i915_irq_emit_t;
+
++typedef struct drm_i915_irq_emit32 {
++ caddr32_t irq_seq;
++} drm_i915_irq_emit32_t;
++
+ typedef struct drm_i915_irq_wait {
+ int irq_seq;
+ } drm_i915_irq_wait_t;
+@@ -369,6 +394,11 @@
+ int *value;
+ } drm_i915_getparam_t;
+
++typedef struct drm_i915_getparam32 {
++ int param;
++ caddr32_t value;
++} drm_i915_getparam32_t;
++
+ /* Ioctl to set kernel params:
+ */
+ #define I915_SETPARAM_USE_MI_BATCHBUFFER_START 1
+@@ -392,6 +422,13 @@
+ int *region_offset; /* offset from start of fb or agp */
+ } drm_i915_mem_alloc_t;
+
++typedef struct drm_i915_mem_alloc32 {
++ int region;
++ int alignment;
++ int size;
++ caddr32_t region_offset; /* offset from start of fb or agp */
++} drm_i915_mem_alloc32_t;
++
+ typedef struct drm_i915_mem_free {
+ int region;
+ int region_offset;
diff --git a/usr/src/common/libdrm/patches/libdrm-lists-h.patch b/usr/src/common/libdrm/patches/libdrm-lists-h.patch
new file mode 100644
index 0000000..a1d2691
--- /dev/null
+++ b/usr/src/common/libdrm/patches/libdrm-lists-h.patch
@@ -0,0 +1,28 @@
+diff ... libdrm-2.4.67/libdrm_lists.h
+--- libdrm-2.4.67/libdrm_lists.h.~1~ Thu Feb 14 10:14:08 2013
++++ libdrm-2.4.67/libdrm_lists.h Sat Oct 29 18:53:40 2016
+@@ -96,18 +96,18 @@
+ (__item) = (__temp), (__temp) = (__item)->prev)
+
+ #define DRMLISTFOREACHENTRY(__item, __list, __head) \
+- for ((__item) = DRMLISTENTRY(typeof(*__item), (__list)->next, __head); \
++ for ((__item) = DRMLISTENTRY(__typeof(*__item), (__list)->next, __head); \
+ &(__item)->__head != (__list); \
+- (__item) = DRMLISTENTRY(typeof(*__item), \
++ (__item) = DRMLISTENTRY(__typeof(*__item), \
+ (__item)->__head.next, __head))
+
+ #define DRMLISTFOREACHENTRYSAFE(__item, __temp, __list, __head) \
+- for ((__item) = DRMLISTENTRY(typeof(*__item), (__list)->next, __head), \
+- (__temp) = DRMLISTENTRY(typeof(*__item), \
++ for ((__item) = DRMLISTENTRY(__typeof(*__item), (__list)->next, __head), \
++ (__temp) = DRMLISTENTRY(__typeof(*__item), \
+ (__item)->__head.next, __head); \
+ &(__item)->__head != (__list); \
+ (__item) = (__temp), \
+- (__temp) = DRMLISTENTRY(typeof(*__item), \
++ (__temp) = DRMLISTENTRY(__typeof(*__item), \
+ (__temp)->__head.next, __head))
+
+ #define DRMLISTJOIN(__list, __join) if (!DRMLISTEMPTY(__list)) { \
+
diff --git a/usr/src/common/libdrm/patches/util-double-list-h.patch b/usr/src/common/libdrm/patches/util-double-list-h.patch
new file mode 100644
index 0000000..91677ad
--- /dev/null
+++ b/usr/src/common/libdrm/patches/util-double-list-h.patch
@@ -0,0 +1,12 @@
+diff ... libdrm-2.4.71/util_double_list.h
+--- libdrm-2.4.71/util_double_list.h.~1~ Tue Aug 2 16:22:45 2016
++++ libdrm-2.4.71/util_double_list.h Sat Nov 19 10:37:40 2016
+@@ -110,7 +110,7 @@
+ #ifndef container_of
+ #define container_of(ptr, sample, member) \
+ (void *)((char *)(ptr) \
+- - ((char *)&((typeof(sample))0)->member))
++ - ((char *)&((__typeof(sample))0)->member))
+ #endif
+
+ #define LIST_FOR_EACH_ENTRY(pos, head, member) \
diff --git a/usr/src/common/libdrm/patches/util-math-h.patch b/usr/src/common/libdrm/patches/util-math-h.patch
new file mode 100644
index 0000000..69f51f2
--- /dev/null
+++ b/usr/src/common/libdrm/patches/util-math-h.patch
@@ -0,0 +1,11 @@
+diff ... libdrm-2.4.67/util_math.h
+--- libdrm-2.4.67/util_math.h.~1~ Fri Oct 23 13:58:02 2015
++++ libdrm-2.4.67/util_math.h Sat Oct 29 20:59:51 2016
+@@ -29,6 +29,6 @@
+ #define MAX3( A, B, C ) ((A) > (B) ? MAX2(A, C) : MAX2(B, C))
+
+ #define __align_mask(value, mask) (((value) + (mask)) & ~(mask))
+-#define ALIGN(value, alignment) __align_mask(value, (typeof(value))((alignment) - 1))
++#define ALIGN(value, alignment) __align_mask(value, (__typeof(value))((alignment) - 1))
+
+ #endif /*_UTIL_MATH_H_*/
diff --git a/usr/src/common/libdrm/patches/xf86drm-c.patch b/usr/src/common/libdrm/patches/xf86drm-c.patch
new file mode 100644
index 0000000..7c6064b
--- /dev/null
+++ b/usr/src/common/libdrm/patches/xf86drm-c.patch
@@ -0,0 +1,12 @@
+diff ... b/xf86drm.c
+--- a/xf86drm.c Fri Mar 20 07:05:48 2015
++++ b/xf86drm.c Fri Mar 20 07:06:10 2015
+@@ -1108,7 +1108,7 @@
+ drm_map_t map;
+
+ memclear(map);
+- map.handle = (void *)(uintptr_t)handle;
++ map.handle = (drm_handle_t)(uintptr_t)handle;
+
+ if(drmIoctl(fd, DRM_IOCTL_RM_MAP, &map))
+ return -errno;
diff --git a/usr/src/common/libdrm/patches/xf86drm-h.patch b/usr/src/common/libdrm/patches/xf86drm-h.patch
new file mode 100644
index 0000000..6b00073
--- /dev/null
+++ b/usr/src/common/libdrm/patches/xf86drm-h.patch
@@ -0,0 +1,49 @@
+# Copyright (c) 2006, 2015, Oracle and/or its affiliates. All rights reserved.
+#
+# 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, and/or sell copies of the Software, and to permit persons
+# to whom the Software is furnished to do so, provided that the above
+# copyright notice(s) and this permission notice appear in all copies of
+# the Software and that both the above copyright notice(s) and this
+# permission notice appear in supporting documentation.
+#
+# 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 NONINFRINGEMENT
+# OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
+# HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
+# INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
+# FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+# WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+#
+# Except as contained in this notice, the name of a copyright holder
+# shall not be used in advertising or otherwise to promote the sale, use
+# or other dealings in this Software without prior written authorization
+# of the copyright holder.
+
+diff --git a/xf86drm.h b/xf86drm.h
+index 76eb94e..6a14120 100644
+--- a/xf86drm.h
++++ b/xf86drm.h
+@@ -472,6 +472,17 @@
+ #endif /* architecture */
+ #endif /* __GNUC__ >= 2 */
+
++#if defined(__SUNPRO_C)
++#include <atomic.h>
++#define atomic_cmpset_int(p, c, n) ((c == atomic_cas_uint(p, c, n)) ? 1 : 0)
++#define DRM_CAS(lock,old,new,__ret) \
++ do { \
++ unsigned int __result, __old = (old);\
++ __result = !atomic_cmpset_int(lock,__old,new);\
++ __ret = __result; \
++ } while(0)
++#endif
++
+ #ifndef DRM_CAS
+ #define DRM_CAS(lock,old,new,ret) do { ret=1; } while (0) /* FAST LOCK FAILS */
+ #endif
diff --git a/usr/src/common/libdrm/patches/xf86drmMode-c.patch b/usr/src/common/libdrm/patches/xf86drmMode-c.patch
new file mode 100644
index 0000000..7d34058
--- /dev/null
+++ b/usr/src/common/libdrm/patches/xf86drmMode-c.patch
@@ -0,0 +1,15 @@
+diff --git a/xf86drmMode.c b/xf86drmMode.c
+index c809c44..715f23a 100644
+--- libdrm-2.4.64/xf86drmMode.c.~1~ 2015-09-14 10:33:51.340507095 +0300
++++ libdrm-2.4.64/xf86drmMode.c 2015-09-14 10:36:09.881744836 +0300
+@@ -850,7 +850,9 @@
+ drmClose(fd);
+ return 0;
+ #endif
+- return -ENOSYS;
++
++/* for now return 0 on solaris */
++ return 0;
+ }
+
+ int drmModeCrtcGetGamma(int fd, uint32_t crtc_id, uint32_t size,