summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libdrm/xf86drm.c17
-rw-r--r--linux-core/drm_bufs.c16
-rw-r--r--linux-core/radeon_drv.c4
-rw-r--r--linux/drm_bufs.h16
-rw-r--r--linux/radeon_drv.c4
5 files changed, 40 insertions, 17 deletions
diff --git a/libdrm/xf86drm.c b/libdrm/xf86drm.c
index 404840cd..bb719edb 100644
--- a/libdrm/xf86drm.c
+++ b/libdrm/xf86drm.c
@@ -35,11 +35,9 @@
# include "xf86.h"
# include "xf86_OSproc.h"
# include "xf86_ansic.h"
-# include "xf86Priv.h"
# define _DRM_MALLOC xalloc
# define _DRM_FREE xfree
# ifndef XFree86LOADER
-# include <sys/stat.h>
# include <sys/mman.h>
# endif
#else
@@ -53,6 +51,7 @@
# include <signal.h>
# include <sys/types.h>
# include <sys/stat.h>
+# define stat_t struct stat
# include <sys/ioctl.h>
# include <sys/mman.h>
# include <sys/time.h>
@@ -136,11 +135,7 @@ static char *drmStrdup(const char *s)
static unsigned long drmGetKeyFromFd(int fd)
{
-#ifdef XFree86LOADER
- struct xf86stat st;
-#else
- struct stat st;
-#endif
+ stat_t st;
st.st_rdev = 0;
fstat(fd, &st);
@@ -169,11 +164,7 @@ static drmHashEntry *drmGetEntry(int fd)
static int drmOpenDevice(long dev, int minor)
{
-#ifdef XFree86LOADER
- struct xf86stat st;
-#else
- struct stat st;
-#endif
+ stat_t st;
char buf[64];
int fd;
mode_t dirmode = DRM_DEV_DIRMODE;
@@ -220,7 +211,7 @@ static int drmOpenDevice(long dev, int minor)
return -errno;
}
-int drmOpenMinor(int minor, int create)
+static int drmOpenMinor(int minor, int create)
{
int fd;
char buf[64];
diff --git a/linux-core/drm_bufs.c b/linux-core/drm_bufs.c
index b82d1a26..16af7bd5 100644
--- a/linux-core/drm_bufs.c
+++ b/linux-core/drm_bufs.c
@@ -946,18 +946,34 @@ int DRM(mapbufs)( struct inode *inode, struct file *filp,
goto done;
}
+#if LINUX_VERSION_CODE <= 0x020402
down( &current->mm->mmap_sem );
+#else
+ down_write( &current->mm->mmap_sem );
+#endif
virtual = do_mmap( filp, 0, map->size,
PROT_READ | PROT_WRITE,
MAP_SHARED,
(unsigned long)map->offset );
+#if LINUX_VERSION_CODE <= 0x020402
up( &current->mm->mmap_sem );
+#else
+ up_write( &current->mm->mmap_sem );
+#endif
} else {
+#if LINUX_VERSION_CODE <= 0x020402
down( &current->mm->mmap_sem );
+#else
+ down_write( &current->mm->mmap_sem );
+#endif
virtual = do_mmap( filp, 0, dma->byte_count,
PROT_READ | PROT_WRITE,
MAP_SHARED, 0 );
+#if LINUX_VERSION_CODE <= 0x020402
up( &current->mm->mmap_sem );
+#else
+ up_write( &current->mm->mmap_sem );
+#endif
}
if ( virtual > -1024UL ) {
/* Real error */
diff --git a/linux-core/radeon_drv.c b/linux-core/radeon_drv.c
index 59497aca..d7632667 100644
--- a/linux-core/radeon_drv.c
+++ b/linux-core/radeon_drv.c
@@ -40,8 +40,8 @@
#define DRIVER_DATE "20010405"
#define DRIVER_MAJOR 1
-#define DRIVER_MINOR 0
-#define DRIVER_PATCHLEVEL 2
+#define DRIVER_MINOR 1
+#define DRIVER_PATCHLEVEL 1
#define DRIVER_IOCTLS \
[DRM_IOCTL_NR(DRM_IOCTL_DMA)] = { radeon_cp_buffers, 1, 0 }, \
diff --git a/linux/drm_bufs.h b/linux/drm_bufs.h
index b82d1a26..16af7bd5 100644
--- a/linux/drm_bufs.h
+++ b/linux/drm_bufs.h
@@ -946,18 +946,34 @@ int DRM(mapbufs)( struct inode *inode, struct file *filp,
goto done;
}
+#if LINUX_VERSION_CODE <= 0x020402
down( &current->mm->mmap_sem );
+#else
+ down_write( &current->mm->mmap_sem );
+#endif
virtual = do_mmap( filp, 0, map->size,
PROT_READ | PROT_WRITE,
MAP_SHARED,
(unsigned long)map->offset );
+#if LINUX_VERSION_CODE <= 0x020402
up( &current->mm->mmap_sem );
+#else
+ up_write( &current->mm->mmap_sem );
+#endif
} else {
+#if LINUX_VERSION_CODE <= 0x020402
down( &current->mm->mmap_sem );
+#else
+ down_write( &current->mm->mmap_sem );
+#endif
virtual = do_mmap( filp, 0, dma->byte_count,
PROT_READ | PROT_WRITE,
MAP_SHARED, 0 );
+#if LINUX_VERSION_CODE <= 0x020402
up( &current->mm->mmap_sem );
+#else
+ up_write( &current->mm->mmap_sem );
+#endif
}
if ( virtual > -1024UL ) {
/* Real error */
diff --git a/linux/radeon_drv.c b/linux/radeon_drv.c
index 59497aca..d7632667 100644
--- a/linux/radeon_drv.c
+++ b/linux/radeon_drv.c
@@ -40,8 +40,8 @@
#define DRIVER_DATE "20010405"
#define DRIVER_MAJOR 1
-#define DRIVER_MINOR 0
-#define DRIVER_PATCHLEVEL 2
+#define DRIVER_MINOR 1
+#define DRIVER_PATCHLEVEL 1
#define DRIVER_IOCTLS \
[DRM_IOCTL_NR(DRM_IOCTL_DMA)] = { radeon_cp_buffers, 1, 0 }, \