summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Dawes <dawes@xfree86.org>2000-11-08 00:07:17 +0000
committerDavid Dawes <dawes@xfree86.org>2000-11-08 00:07:17 +0000
commit94071289a4c61a1083a3d6b3546b06cafeaeac44 (patch)
treeac34ab78e6e4b842fa14d61d944f26ab1376aa2d
parent5745cb7fa70cf312d371aac44de3beae2a8d6e47 (diff)
-rw-r--r--bsd/Imakefile4
-rw-r--r--libdrm/xf86drm.c2
-rw-r--r--linux-core/drmP.h9
-rw-r--r--linux/Makefile.linux6
-rw-r--r--linux/drm.h11
-rw-r--r--linux/drmP.h9
-rw-r--r--linux/mga_bufs.c1
-rw-r--r--linux/picker.c1
-rw-r--r--linux/r128_drv.h2
-rw-r--r--linux/sis_mm.c5
-rw-r--r--shared-core/drm.h11
-rw-r--r--shared/drm.h11
12 files changed, 60 insertions, 12 deletions
diff --git a/bsd/Imakefile b/bsd/Imakefile
index 81445a7d..47dff5bf 100644
--- a/bsd/Imakefile
+++ b/bsd/Imakefile
@@ -1,4 +1,4 @@
-XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bsd/drm/kernel/Imakefile,v 1.2 2000/08/16 01:45:31 dawes Exp $
+XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bsd/drm/kernel/Imakefile,v 1.3 2000/10/27 16:59:40 dawes Exp $
#include <Server.tmpl>
@@ -18,7 +18,7 @@ LinkSourceFile(drm.h,$(XF86OSSRC)/linux/drm/kernel)
LinkSourceFile(i810_drm.h,$(XF86OSSRC)/linux/drm/kernel)
LinkSourceFile(mga_drm.h,$(XF86OSSRC)/linux/drm/kernel)
LinkSourceFile(r128_drm.h,$(XF86OSSRC)/linux/drm/kernel)
-LinkSourceFile(sis_drm_public.h,$(XF86OSSRC)/linux/drm/kernel)
+LinkSourceFile(sis_drm.h,$(XF86OSSRC)/linux/drm/kernel)
XCOMM This is a kludge until we determine how best to build the
diff --git a/libdrm/xf86drm.c b/libdrm/xf86drm.c
index c933f593..5c2c08c3 100644
--- a/libdrm/xf86drm.c
+++ b/libdrm/xf86drm.c
@@ -27,7 +27,7 @@
* Authors: Rickard E. (Rik) Faith <faith@valinux.com>
* Kevin E. Martin <martin@valinux.com>
*
- * $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/xf86drm.c,v 1.16 2000/08/28 16:55:52 dawes Exp $
+ * $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/xf86drm.c,v 1.17 2000/09/24 13:51:32 alanh Exp $
*
*/
diff --git a/linux-core/drmP.h b/linux-core/drmP.h
index 6be90c51..46e08e05 100644
--- a/linux-core/drmP.h
+++ b/linux-core/drmP.h
@@ -59,6 +59,15 @@
#include <asm/io.h>
#include <asm/mman.h>
#include <asm/uaccess.h>
+
+#ifndef copy_to_user_ret
+#define copy_to_user_ret(to,from,n,retval) ({ if (copy_to_user(to,from,n)) return retval; })
+#endif
+
+#ifndef copy_from_user_ret
+#define copy_from_user_ret(to,from,n,retval) ({ if (copy_from_user(to,from,n)) return retval; })
+#endif
+
#ifdef CONFIG_MTRR
#include <asm/mtrr.h>
#endif
diff --git a/linux/Makefile.linux b/linux/Makefile.linux
index b76cbeaf..adf19005 100644
--- a/linux/Makefile.linux
+++ b/linux/Makefile.linux
@@ -113,15 +113,15 @@ all:; @echo Error: Could not locate kernel tree in $A $B $C
else
SMP := $(shell gcc -E -nostdinc -I$(TREE) picker.c 2>/dev/null \
| grep -s 'SMP = ' | cut -d' ' -f3)
-MODULES := $(shell gcc -E -nostdinc -I $(TREE) picker.c 2>/dev/null \
+MODULES := $(shell gcc -E -nostdinc -I$(TREE) picker.c 2>/dev/null \
| grep -s 'MODULES = ' | cut -d' ' -f3)
-MODVERSIONS := $(shell gcc -E -nostdinc -I $(TREE) picker.c 2>/dev/null \
+MODVERSIONS := $(shell gcc -E -nostdinc -I$(TREE) picker.c 2>/dev/null \
| grep -s 'MODVERSIONS = ' | cut -d' ' -f3)
AGP := $(shell gcc -E -nostdinc -I$(TREE) picker.c 2>/dev/null \
| grep -s 'AGP = ' | cut -d' ' -f3)
SIS := $(shell gcc -E -nostdinc -I$(TREE) picker.c 2>/dev/null \
| grep -s 'SIS = ' | cut -d' ' -f3)
-PARAMS := $(shell if fgrep kill_fasync $(TREE)/linux/fs.h \
+PARAMS := $(shell if fgrep kill_fasync $(TREE)/linux/fs.h 2>/dev/null \
| egrep -q '(band|int, int)'; then echo 3; else echo 2; fi)
MACHINE := $(shell echo `uname -m`)
ifeq ($(AGP),0)
diff --git a/linux/drm.h b/linux/drm.h
index b182f2c9..57032d6e 100644
--- a/linux/drm.h
+++ b/linux/drm.h
@@ -82,6 +82,7 @@ typedef struct drm_clip_rect {
#include "mga_drm.h"
#include "i810_drm.h"
#include "r128_drm.h"
+#include "sis_drm.h"
typedef struct drm_version {
int version_major; /* Major version */
@@ -369,4 +370,14 @@ typedef struct drm_agp_info {
#define DRM_IOCTL_R128_PACKET DRM_IOW( 0x44, drm_r128_packet_t)
#define DRM_IOCTL_R128_VERTEX DRM_IOW( 0x45, drm_r128_vertex_t)
+/* SiS specific ioctls */
+#define SIS_IOCTL_FB_ALLOC DRM_IOWR( 0x44, drm_sis_mem_t)
+#define SIS_IOCTL_FB_FREE DRM_IOW( 0x45, drm_sis_mem_t)
+#define SIS_IOCTL_AGP_INIT DRM_IOWR( 0x53, drm_sis_agp_t)
+#define SIS_IOCTL_AGP_ALLOC DRM_IOWR( 0x54, drm_sis_mem_t)
+#define SIS_IOCTL_AGP_FREE DRM_IOW( 0x55, drm_sis_mem_t)
+#define SIS_IOCTL_FLIP DRM_IOW( 0x48, drm_sis_flip_t)
+#define SIS_IOCTL_FLIP_INIT DRM_IO( 0x49)
+#define SIS_IOCTL_FLIP_FINAL DRM_IO( 0x50)
+
#endif
diff --git a/linux/drmP.h b/linux/drmP.h
index 6be90c51..46e08e05 100644
--- a/linux/drmP.h
+++ b/linux/drmP.h
@@ -59,6 +59,15 @@
#include <asm/io.h>
#include <asm/mman.h>
#include <asm/uaccess.h>
+
+#ifndef copy_to_user_ret
+#define copy_to_user_ret(to,from,n,retval) ({ if (copy_to_user(to,from,n)) return retval; })
+#endif
+
+#ifndef copy_from_user_ret
+#define copy_from_user_ret(to,from,n,retval) ({ if (copy_from_user(to,from,n)) return retval; })
+#endif
+
#ifdef CONFIG_MTRR
#include <asm/mtrr.h>
#endif
diff --git a/linux/mga_bufs.c b/linux/mga_bufs.c
index 05d941b4..00c0ea7f 100644
--- a/linux/mga_bufs.c
+++ b/linux/mga_bufs.c
@@ -420,6 +420,7 @@ int mga_infobufs(struct inode *inode, struct file *filp, unsigned int cmd,
sizeof(dma->bufs[0]
.freelist.high_mark)))
return -EFAULT;
+
++count;
}
}
diff --git a/linux/picker.c b/linux/picker.c
index 77519a56..4b4fbe90 100644
--- a/linux/picker.c
+++ b/linux/picker.c
@@ -1,4 +1,3 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/picker.c,v 1.3 2000/09/01 02:31:40 tsi Exp $ */
#include <linux/config.h>
#include <linux/version.h>
diff --git a/linux/r128_drv.h b/linux/r128_drv.h
index 63b98c72..da2f676d 100644
--- a/linux/r128_drv.h
+++ b/linux/r128_drv.h
@@ -197,7 +197,7 @@ extern int r128_context_switch_complete(drm_device_t *dev, int new);
#define R128_MAX_USEC_TIMEOUT 100000 /* 100 ms */
-#define R128_BASE(reg) ((u32)(dev_priv->mmio->handle))
+#define R128_BASE(reg) ((unsigned long)(dev_priv->mmio->handle))
#define R128_ADDR(reg) (R128_BASE(reg) + reg)
#define R128_DEREF(reg) *(__volatile__ int *)R128_ADDR(reg)
diff --git a/linux/sis_mm.c b/linux/sis_mm.c
index e6e8ed7d..9a8f83ea 100644
--- a/linux/sis_mm.c
+++ b/linux/sis_mm.c
@@ -33,9 +33,6 @@
#include "sis_drm.h"
#include "sis_ds.h"
#include "sis_drv.h"
-#include <linux/fb.h>
-#include <linux/sisfb.h>
-#include <linux/interrupt.h>
#define MAX_CONTEXT 100
#define VIDEO_TYPE 0
@@ -73,7 +70,7 @@ static int del_alloc_set(int context, int type, unsigned int val)
}
/* fb management via fb device */
-#if 1
+#if 0
int sis_fb_alloc(struct inode *inode, struct file *filp, unsigned int cmd,
unsigned long arg)
{
diff --git a/shared-core/drm.h b/shared-core/drm.h
index b182f2c9..57032d6e 100644
--- a/shared-core/drm.h
+++ b/shared-core/drm.h
@@ -82,6 +82,7 @@ typedef struct drm_clip_rect {
#include "mga_drm.h"
#include "i810_drm.h"
#include "r128_drm.h"
+#include "sis_drm.h"
typedef struct drm_version {
int version_major; /* Major version */
@@ -369,4 +370,14 @@ typedef struct drm_agp_info {
#define DRM_IOCTL_R128_PACKET DRM_IOW( 0x44, drm_r128_packet_t)
#define DRM_IOCTL_R128_VERTEX DRM_IOW( 0x45, drm_r128_vertex_t)
+/* SiS specific ioctls */
+#define SIS_IOCTL_FB_ALLOC DRM_IOWR( 0x44, drm_sis_mem_t)
+#define SIS_IOCTL_FB_FREE DRM_IOW( 0x45, drm_sis_mem_t)
+#define SIS_IOCTL_AGP_INIT DRM_IOWR( 0x53, drm_sis_agp_t)
+#define SIS_IOCTL_AGP_ALLOC DRM_IOWR( 0x54, drm_sis_mem_t)
+#define SIS_IOCTL_AGP_FREE DRM_IOW( 0x55, drm_sis_mem_t)
+#define SIS_IOCTL_FLIP DRM_IOW( 0x48, drm_sis_flip_t)
+#define SIS_IOCTL_FLIP_INIT DRM_IO( 0x49)
+#define SIS_IOCTL_FLIP_FINAL DRM_IO( 0x50)
+
#endif
diff --git a/shared/drm.h b/shared/drm.h
index b182f2c9..57032d6e 100644
--- a/shared/drm.h
+++ b/shared/drm.h
@@ -82,6 +82,7 @@ typedef struct drm_clip_rect {
#include "mga_drm.h"
#include "i810_drm.h"
#include "r128_drm.h"
+#include "sis_drm.h"
typedef struct drm_version {
int version_major; /* Major version */
@@ -369,4 +370,14 @@ typedef struct drm_agp_info {
#define DRM_IOCTL_R128_PACKET DRM_IOW( 0x44, drm_r128_packet_t)
#define DRM_IOCTL_R128_VERTEX DRM_IOW( 0x45, drm_r128_vertex_t)
+/* SiS specific ioctls */
+#define SIS_IOCTL_FB_ALLOC DRM_IOWR( 0x44, drm_sis_mem_t)
+#define SIS_IOCTL_FB_FREE DRM_IOW( 0x45, drm_sis_mem_t)
+#define SIS_IOCTL_AGP_INIT DRM_IOWR( 0x53, drm_sis_agp_t)
+#define SIS_IOCTL_AGP_ALLOC DRM_IOWR( 0x54, drm_sis_mem_t)
+#define SIS_IOCTL_AGP_FREE DRM_IOW( 0x55, drm_sis_mem_t)
+#define SIS_IOCTL_FLIP DRM_IOW( 0x48, drm_sis_flip_t)
+#define SIS_IOCTL_FLIP_INIT DRM_IO( 0x49)
+#define SIS_IOCTL_FLIP_FINAL DRM_IO( 0x50)
+
#endif