1265N/A# Copyright (c) 2006, 2012, Oracle
and/or its affiliates. All rights reserved.
98N/A# Permission is hereby granted, free of charge, to any person obtaining a
1089N/A# copy of this software and associated documentation files (the
1089N/A# "Software"), to deal in the Software without restriction, including
1089N/A# without limitation the rights to use, copy, modify, merge, publish,
1089N/A# distribute,
and/or sell copies of the Software, and to permit persons
1089N/A# to whom the Software is furnished to do so, provided that the above
1089N/A# copyright notice(s) and this permission notice appear in all copies of
1089N/A# the Software and that both the above copyright notice(s) and this
1089N/A# permission notice appear in supporting documentation.
1089N/A# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
1089N/A# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
1089N/A# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
1089N/A# OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
1089N/A# HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
1089N/A# INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
1089N/A# FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
1089N/A# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
1089N/A# WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
1089N/A# Except as contained in this notice, the name of a copyright holder
1089N/A# shall not be used in advertising or otherwise to promote the sale, use
1089N/A# or other dealings in this Software without prior written authorization
1089N/A@@ -54,10 +54,39 @@ typedef int32_t __s32;
1089N/A+#if defined(__SOLARIS__) || defined(__sun)
1089N/A+typedef unsigned long long drm_handle_t;
1089N/A typedef unsigned long drm_handle_t;
1089N/A+#if defined(__SOLARIS__) || defined(__sun)
1089N/A+#define _IOC_TYPESHIFT (_IOC_NRSHIFT + _IOC_NRBITS)
1089N/A+#define _IOC_SIZESHIFT (_IOC_TYPESHIFT + _IOC_TYPEBITS)
1089N/A+#define _IOC_DIRSHIFT (_IOC_SIZESHIFT + _IOC_SIZEBITS)
1089N/A+#define _IOC(dir, type, nr, size) \
1089N/A+ (((dir) /* already shifted */) | \
1089N/A+ ((type) << _IOC_TYPESHIFT) | \
1089N/A+ ((nr) << _IOC_NRSHIFT) | \
1089N/A+ ((size) << _IOC_SIZESHIFT))
1089N/A+#endif /* __Solaris__ or __sun */
1089N/A #define DRM_NAME "drm" /**< Name in kernel, /dev, and /proc */
1089N/A #define DRM_MIN_ORDER 5 /**< At least 2^5 bytes = 32 bytes */
1089N/A #define DRM_MAX_ORDER 22 /**< Up to 2^22 bytes = 4MB */
1089N/A@@ -210,12 +239,13 @@ struct drm_ctx_priv_map {
1089N/A- unsigned long offset; /**< Requested physical address (0 for SAREA)*/
1089N/A+ unsigned long long offset; /**< Requested physical address (0 for SAREA)*/
1089N/A+ unsigned long long handle;
1089N/A+ /**< User-space: "Handle" to pass to mmap() */
1089N/A+ /**< Kernel-space: kernel-virtual address */
1089N/A unsigned long size; /**< Requested physical size (bytes) */
1089N/A enum drm_map_type type; /**< Type of memory to map */
1089N/A enum drm_map_flags flags; /**< Flags */
1089N/A- void *handle; /**< User-space: "Handle" to pass to mmap() */
1089N/A- /**< Kernel-space: kernel-virtual address */
1089N/A int mtrr; /**< MTRR slot used */
1089N/A@@ -322,18 +352,22 @@ enum drm_dma_flags {
1089N/A+ _DRM_PAGE_ALIGN = 0x01, /**< Align on page boundaries for DMA */
1089N/A+ _DRM_AGP_BUFFER = 0x02, /**< Buffer is in AGP space */
1089N/A+ _DRM_FB_BUFFER = 0x08, /**< Buffer is in frame buffer */
1089N/A+ _DRM_PCI_BUFFER_RO = 0x10 /**< Map PCI DMA buffer read-only */
1089N/A int count; /**< Number of buffers of this size */
1089N/A int size; /**< Size in bytes */
1089N/A int low_mark; /**< Low water mark */
1089N/A int high_mark; /**< High water mark */
1089N/A- _DRM_PAGE_ALIGN = 0x01, /**< Align on page boundaries for DMA */
1089N/A- _DRM_AGP_BUFFER = 0x02, /**< Buffer is in AGP space */
1089N/A- _DRM_FB_BUFFER = 0x08, /**< Buffer is in frame buffer */
1089N/A- _DRM_PCI_BUFFER_RO = 0x10 /**< Map PCI DMA buffer read-only */
1089N/A unsigned long agp_start; /**<
1089N/A * Start address of where the AGP buffers are
1296N/A@@ -379,6 +413,7 @@ struct drm_buf_map {
1089N/A void *virtual; /**< Mmap'd area in user-virtual */
1089N/A struct drm_buf_pub *list; /**< Buffer information */
1296N/Aindex af3ce17..96d391d 100644
1089N/A@@ -75,6 +75,7 @@ typedef struct _drm_i915_sarea {
1089N/A int pf_current_page; /* which buffer is being displayed? */
1089N/A int perf_boxes; /* performance boxes to be displayed */
1089N/A int width, height; /* screen size in pixels */
1089N/A@@ -114,6 +115,8 @@ typedef struct _drm_i915_sarea {
1089N/A /* fill out some space for old userspace triple buffer */
1089N/A drm_handle_t unused_handle;
1089N/A __u32 unused1, unused2, unused3;
1296N/Aindex fc4f205..5d66fc7 100644
1296N/Aindex 6ea068f..67e29a0 100644
1296N/A@@ -984,7 +984,7 @@ int drmRmMap(int fd, drm_handle_t handle)
1296N/A if(drmIoctl(fd, DRM_IOCTL_RM_MAP, &map))
1296N/Aindex 76eb94e..6a14120 100644
1296N/A@@ -458,6 +458,17 @@ do { register unsigned int __old __asm("o0"); \
98N/A #endif /* architecture */
98N/A #endif /* __GNUC__ >= 2 */
98N/A+#if defined(__SUNPRO_C)
606N/A+#define atomic_cmpset_int(p, c, n) ((c == atomic_cas_uint(p, c, n)) ? 1 : 0)
606N/A+#define DRM_CAS(lock,old,new,__ret) \
606N/A+ unsigned int __result, __old = (old);\
606N/A+ __result = !atomic_cmpset_int(lock,__old,new);\
98N/A #define DRM_CAS(lock,old,new,ret) do { ret=1; } while (0) /* FAST LOCK FAILS */
1296N/Aindex c809c44..715f23a 100644
1296N/A@@ -737,7 +737,9 @@ int drmCheckModesettingSupported(const char *busid)
1089N/A+/* for now return 0 on solaris */