summaryrefslogtreecommitdiff
path: root/linux
diff options
context:
space:
mode:
authorDavid Dawes <dawes@xfree86.org>2002-01-27 20:05:42 +0000
committerDavid Dawes <dawes@xfree86.org>2002-01-27 20:05:42 +0000
commit44aa4d6297874022a4f5a49ea24f2d052584d3dc (patch)
treea3b8646dd51527d2fb246dbc11a124f4fd60968a /linux
parent14945ada16218e9f918c24e0d702979fae9b07f6 (diff)
First pass merge of XFree86 4.2.0 import.
Diffstat (limited to 'linux')
-rw-r--r--linux/Makefile.kernel7
-rw-r--r--linux/Makefile.linux36
-rw-r--r--linux/drm.h22
-rw-r--r--linux/drm_context.h11
-rw-r--r--linux/drm_fops.h12
-rw-r--r--linux/i810_dma.c157
-rw-r--r--linux/i810_drm.h16
-rw-r--r--linux/i810_drv.c11
-rw-r--r--linux/i810_drv.h14
-rw-r--r--linux/picker.c5
-rw-r--r--linux/radeon_state.c2
-rw-r--r--linux/sis.h8
-rw-r--r--linux/sis_drv.c10
-rw-r--r--linux/sis_ds.c2
-rw-r--r--linux/sis_mm.c8
15 files changed, 269 insertions, 52 deletions
diff --git a/linux/Makefile.kernel b/linux/Makefile.kernel
index e2630989..1060d4cb 100644
--- a/linux/Makefile.kernel
+++ b/linux/Makefile.kernel
@@ -3,13 +3,14 @@
# Direct Rendering Infrastructure (DRI) in XFree86 4.1.0 and higher.
O_TARGET := drm.o
-list-multi := gamma.o tdfx.o r128.o mga.o i810.o ffb.o radeon.o
+list-multi := gamma.o tdfx.o r128.o mga.o i810.o i830.o ffb.o radeon.o
gamma-objs := gamma_drv.o gamma_dma.o
tdfx-objs := tdfx_drv.o
r128-objs := r128_drv.o r128_cce.o r128_state.o
mga-objs := mga_drv.o mga_dma.o mga_state.o mga_warp.o
i810-objs := i810_drv.o i810_dma.o
+i830-objs := i830_drv.o i830_dma.o
radeon-objs := radeon_drv.o radeon_cp.o radeon_state.o
ffb-objs := ffb_drv.o ffb_context.o
@@ -19,6 +20,7 @@ obj-$(CONFIG_DRM_R128) += r128.o
obj-$(CONFIG_DRM_RADEON)+= radeon.o
obj-$(CONFIG_DRM_MGA) += mga.o
obj-$(CONFIG_DRM_I810) += i810.o
+obj-$(CONFIG_DRM_I830) += i830.o
obj-$(CONFIG_DRM_FFB) += ffb.o
include $(TOPDIR)/Rules.make
@@ -35,6 +37,9 @@ mga.o: $(mga-objs) $(lib)
i810.o: $(i810-objs) $(lib)
$(LD) -r -o $@ $(i810-objs) $(lib)
+i830.o: $(i830-objs) $(lib)
+ $(LD) -r -o $@ $(i830-objs) $(lib)
+
r128.o: $(r128-objs) $(lib)
$(LD) -r -o $@ $(r128-objs) $(lib)
diff --git a/linux/Makefile.linux b/linux/Makefile.linux
index d68057c1..893d4985 100644
--- a/linux/Makefile.linux
+++ b/linux/Makefile.linux
@@ -31,15 +31,6 @@
# like this:
# make TREE=/usr/my-kernel-tree/include
#
-#
-# ***** NOTE NOTE NOTE NOTE NOTE *****
-# Because some distributions patch 2.2.x kernels to make kill_fasync have
-# three parameters, this script tries to determine, via the examination of
-# header files, if your kernel has been patched. If this detection is
-# incorrect, you can override the value on the command line, like this:
-# make PARAMS=2
-# or
-# make PARAMS=3
.SUFFIXES:
@@ -132,10 +123,6 @@ 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 2>/dev/null \
- | egrep -q '(band|int, int)'; then echo 3; else echo 2; fi)
MACHINE := $(shell echo `uname -m`)
ifeq ($(AGP),0)
AGP := $(shell gcc -E -nostdinc -I$(TREE) picker.c 2>/dev/null \
@@ -148,9 +135,11 @@ DRMTEMPLATES += drm_agpsupport.h
MODS += mga.o
ifeq ($(MACHINE),i386)
MODS += i810.o
+MODS += i830.o
endif
ifeq ($(MACHINE),i686)
MODS += i810.o
+MODS += i830.o
endif
MGAOBJS = mga_drv.o mga_dma.o mga_state.o mga_warp.o
@@ -159,29 +148,23 @@ MGAHEADERS = mga.h mga_drv.h mga_drm.h $(DRMHEADERS) $(DRMTEMPLATES)
I810OBJS = i810_drv.o i810_dma.o
I810HEADERS = i810.h i810_drv.h i810_drm.h $(DRMHEADERS) $(DRMTEMPLATES)
+I830OBJS = i830_drv.o i830_dma.o
+I830HEADERS = i830.h i830_drv.h i830_drm.h $(DRMHEADERS) $(DRMTEMPLATES)
+
endif
ifeq ($(MACHINE),alpha)
MODCFLAGS+= -ffixed-8 -mno-fp-regs -mcpu=ev56 -Wa,-mev6
endif
-ifeq ($(SIS),1)
-# It appears that the SiS driver makes calls to sis_malloc and sis_free, and
-# that these calls are only defined if CONFIG_FB_SIS is selected. So, key
-# off that to determine if we should attempt to build the SiS driver.
-#
-# A better way would be to detect the appropriate definitions in the header
-# file to see if we can, at least, compile the driver.
MODS += sis.o
SISOBJS= sis_drv.o sis_mm.o sis_ds.o
SISHEADERS= sis_drv.h sis_drm.h $(DRMHEADERS)
MODCFLAGS += -DCONFIG_DRM_SIS
-endif
all::;@echo === KERNEL HEADERS IN $(TREE)
all::;@echo === SMP=${SMP} MODULES=${MODULES} MODVERSIONS=${MODVERSIONS} AGP=${AGP}
-all::;@echo === kill_fasync has $(PARAMS) parameters
all::;@echo === Compiling for machine $(MACHINE)
all::;@echo === WARNING
all::;@echo === WARNING Use 2.4.x kernels ONLY !
@@ -206,9 +189,6 @@ endif
ifeq ($(MODVERSIONS),1)
MODCFLAGS += -DMODVERSIONS -include $(TREE)/linux/modversions.h
endif
-ifeq ($(PARAMS),3)
-MODCFLAGS += -DKILLFASYNCHASTHREEPARAMETERS
-endif
# **** End of configuration
@@ -252,6 +232,11 @@ i810_drv.o: i810_drv.c
i810.o: $(I810OBJS) $(LIBS)
$(LD) -r $^ -o $@
+i830_drv.o: i830_drv.c
+ $(CC) $(MODCFLAGS) -DEXPORT_SYMTAB -I$(TREE) -c $< -o $@
+i830.o: $(I830OBJS) $(LIBS)
+ $(LD) -r $^ -o $@
+
endif
.PHONY: ChangeLog
@@ -272,6 +257,7 @@ $(TDFXOBJS): $(TDFXHEADERS)
ifeq ($(AGP),1)
$(MGAOBJS): $(MGAHEADERS)
$(I810OBJS): $(I810HEADERS)
+$(I830OBJS): $(I830HEADERS)
$(R128OBJS): $(R128HEADERS)
$(RADEONOBJS): $(RADEONHEADERS)
endif
diff --git a/linux/drm.h b/linux/drm.h
index ac9f407a..0db586fc 100644
--- a/linux/drm.h
+++ b/linux/drm.h
@@ -104,9 +104,8 @@ typedef struct drm_tex_region {
#include "i810_drm.h"
#include "r128_drm.h"
#include "radeon_drm.h"
-#ifdef CONFIG_DRM_SIS
#include "sis_drm.h"
-#endif
+#include "i830_drm.h"
typedef struct drm_version {
int version_major; /* Major version */
@@ -449,6 +448,12 @@ typedef struct drm_scatter_gather {
#define DRM_IOCTL_I810_SWAP DRM_IO( 0x46)
#define DRM_IOCTL_I810_COPY DRM_IOW( 0x47, drm_i810_copy_t)
#define DRM_IOCTL_I810_DOCOPY DRM_IO( 0x48)
+#define DRM_IOCTL_I810_OV0INFO DRM_IOR( 0x49, drm_i810_overlay_t)
+#define DRM_IOCTL_I810_FSTATUS DRM_IO ( 0x4a)
+#define DRM_IOCTL_I810_OV0FLIP DRM_IO ( 0x4b)
+#define DRM_IOCTL_I810_MC DRM_IOW( 0x4c, drm_i810_mc_t)
+#define DRM_IOCTL_I810_RSTATUS DRM_IO ( 0x4d )
+
/* Rage 128 specific ioctls */
#define DRM_IOCTL_R128_INIT DRM_IOW( 0x40, drm_r128_init_t)
@@ -483,7 +488,6 @@ typedef struct drm_scatter_gather {
#define DRM_IOCTL_RADEON_INDIRECT DRM_IOWR(0x4d, drm_radeon_indirect_t)
#define DRM_IOCTL_RADEON_TEXTURE DRM_IOWR(0x4e, drm_radeon_texture_t)
-#ifdef CONFIG_DRM_SIS
/* 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)
@@ -493,6 +497,16 @@ typedef struct drm_scatter_gather {
#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
+
+/* I830 specific ioctls */
+#define DRM_IOCTL_I830_INIT DRM_IOW( 0x40, drm_i830_init_t)
+#define DRM_IOCTL_I830_VERTEX DRM_IOW( 0x41, drm_i830_vertex_t)
+#define DRM_IOCTL_I830_CLEAR DRM_IOW( 0x42, drm_i830_clear_t)
+#define DRM_IOCTL_I830_FLUSH DRM_IO ( 0x43)
+#define DRM_IOCTL_I830_GETAGE DRM_IO ( 0x44)
+#define DRM_IOCTL_I830_GETBUF DRM_IOWR(0x45, drm_i830_dma_t)
+#define DRM_IOCTL_I830_SWAP DRM_IO ( 0x46)
+#define DRM_IOCTL_I830_COPY DRM_IOW( 0x47, drm_i830_copy_t)
+#define DRM_IOCTL_I830_DOCOPY DRM_IO ( 0x48)
#endif
diff --git a/linux/drm_context.h b/linux/drm_context.h
index 33d6112e..e155946d 100644
--- a/linux/drm_context.h
+++ b/linux/drm_context.h
@@ -27,6 +27,10 @@
* Authors:
* Rickard E. (Rik) Faith <faith@valinux.com>
* Gareth Hughes <gareth@valinux.com>
+ * ChangeLog:
+ * 2001-11-16 Torsten Duwe <duwe@caldera.de>
+ * added context constructor/destructor hooks,
+ * needed by SiS driver's memory management.
*/
#define __NO_VERSION__
@@ -316,6 +320,10 @@ int DRM(addctx)( struct inode *inode, struct file *filp,
/* Should this return -EBUSY instead? */
return -ENOMEM;
}
+#ifdef DRIVER_CTX_CTOR
+ if ( ctx.handle != DRM_KERNEL_CONTEXT )
+ DRIVER_CTX_CTOR(ctx.handle); /* XXX: also pass dev ? */
+#endif
if ( copy_to_user( (drm_ctx_t *)arg, &ctx, sizeof(ctx) ) )
return -EFAULT;
@@ -390,6 +398,9 @@ int DRM(rmctx)( struct inode *inode, struct file *filp,
priv->remove_auth_on_close = 1;
}
if ( ctx.handle != DRM_KERNEL_CONTEXT ) {
+#ifdef DRIVER_CTX_DTOR
+ DRIVER_CTX_DTOR(ctx.handle); /* XXX: also pass dev ? */
+#endif
DRM(ctxbitmap_free)( dev, ctx.handle );
}
diff --git a/linux/drm_fops.h b/linux/drm_fops.h
index d8e9112f..9c2135fe 100644
--- a/linux/drm_fops.h
+++ b/linux/drm_fops.h
@@ -125,21 +125,31 @@ ssize_t DRM(read)(struct file *filp, char *buf, size_t count, loff_t *off)
int avail;
int send;
int cur;
+ DECLARE_WAITQUEUE(wait, current);
DRM_DEBUG("%p, %p\n", dev->buf_rp, dev->buf_wp);
+ add_wait_queue(&dev->buf_readers, &wait);
+ set_current_state(TASK_INTERRUPTIBLE);
while (dev->buf_rp == dev->buf_wp) {
DRM_DEBUG(" sleeping\n");
if (filp->f_flags & O_NONBLOCK) {
+ remove_wait_queue(&dev->buf_readers, &wait);
+ set_current_state(TASK_RUNNING);
return -EAGAIN;
}
- interruptible_sleep_on(&dev->buf_readers);
+ schedule(); /* wait for dev->buf_readers */
if (signal_pending(current)) {
DRM_DEBUG(" interrupted\n");
+ remove_wait_queue(&dev->buf_readers, &wait);
+ set_current_state(TASK_RUNNING);
return -ERESTARTSYS;
}
DRM_DEBUG(" awake\n");
+ set_current_state(TASK_INTERRUPTIBLE);
}
+ remove_wait_queue(&dev->buf_readers, &wait);
+ set_current_state(TASK_RUNNING);
left = (dev->buf_rp + DRM_BSZ - dev->buf_wp) % DRM_BSZ;
avail = DRM_BSZ - left;
diff --git a/linux/i810_dma.c b/linux/i810_dma.c
index e9b0e807..ae0a3616 100644
--- a/linux/i810_dma.c
+++ b/linux/i810_dma.c
@@ -86,6 +86,7 @@ static inline void i810_print_status_page(drm_device_t *dev)
DRM_DEBUG( "hw_status: LpRing Head ptr : %x\n", temp[1]);
DRM_DEBUG( "hw_status: IRing Head ptr : %x\n", temp[2]);
DRM_DEBUG( "hw_status: Reserved : %x\n", temp[3]);
+ DRM_DEBUG( "hw_status: Last Render: %x\n", temp[4]);
DRM_DEBUG( "hw_status: Driver Counter : %d\n", temp[5]);
for(i = 6; i < dma->buf_count + 6; i++) {
DRM_DEBUG( "buffer status idx : %d used: %d\n", i - 6, temp[i]);
@@ -471,6 +472,9 @@ static int i810_dma_initialize(drm_device_t *dev,
dev_priv->back_offset = init->back_offset;
dev_priv->depth_offset = init->depth_offset;
+ dev_priv->overlay_offset = init->overlay_offset;
+ dev_priv->overlay_physical = init->overlay_physical;
+
dev_priv->front_di1 = init->front_offset | init->pitch_bits;
dev_priv->back_di1 = init->back_offset | init->pitch_bits;
dev_priv->zi1 = init->depth_offset | init->pitch_bits;
@@ -1259,3 +1263,156 @@ int i810_docopy(struct inode *inode, struct file *filp, unsigned int cmd,
if(VM_DONTCOPY == 0) return 1;
return 0;
}
+
+static void i810_dma_dispatch_mc(drm_device_t *dev, drm_buf_t *buf, int used,
+ unsigned int last_render)
+{
+ drm_i810_private_t *dev_priv = dev->dev_private;
+ drm_i810_buf_priv_t *buf_priv = buf->dev_private;
+ drm_i810_sarea_t *sarea_priv = dev_priv->sarea_priv;
+ unsigned long address = (unsigned long)buf->bus_address;
+ unsigned long start = address - dev->agp->base;
+ int u;
+ RING_LOCALS;
+
+ i810_kernel_lost_context(dev);
+
+ u = cmpxchg(buf_priv->in_use, I810_BUF_CLIENT,
+ I810_BUF_HARDWARE);
+ if(u != I810_BUF_CLIENT) {
+ DRM_DEBUG("MC found buffer that isn't mine!\n");
+ }
+
+ if (used > 4*1024)
+ used = 0;
+
+ sarea_priv->dirty = 0x7f;
+
+ DRM_DEBUG("dispatch mc addr 0x%lx, used 0x%x\n",
+ address, used);
+
+ dev_priv->counter++;
+ DRM_DEBUG("dispatch counter : %ld\n", dev_priv->counter);
+ DRM_DEBUG("i810_dma_dispatch_mc\n");
+ DRM_DEBUG("start : %lx\n", start);
+ DRM_DEBUG("used : %d\n", used);
+ DRM_DEBUG("start + used - 4 : %ld\n", start + used - 4);
+
+ if (buf_priv->currently_mapped == I810_BUF_MAPPED) {
+ if (used & 4) {
+ *(u32 *)((u32)buf_priv->virtual + used) = 0;
+ used += 4;
+ }
+
+ i810_unmap_buffer(buf);
+ }
+ BEGIN_LP_RING(4);
+ OUT_RING( CMD_OP_BATCH_BUFFER );
+ OUT_RING( start | BB1_PROTECTED );
+ OUT_RING( start + used - 4 );
+ OUT_RING( 0 );
+ ADVANCE_LP_RING();
+
+
+ BEGIN_LP_RING(8);
+ OUT_RING( CMD_STORE_DWORD_IDX );
+ OUT_RING( buf_priv->my_use_idx );
+ OUT_RING( I810_BUF_FREE );
+ OUT_RING( 0 );
+
+ OUT_RING( CMD_STORE_DWORD_IDX );
+ OUT_RING( 16 );
+ OUT_RING( last_render );
+ OUT_RING( 0 );
+ ADVANCE_LP_RING();
+}
+
+int i810_dma_mc(struct inode *inode, struct file *filp,
+ unsigned int cmd, unsigned long arg)
+{
+ drm_file_t *priv = filp->private_data;
+ drm_device_t *dev = priv->dev;
+ drm_device_dma_t *dma = dev->dma;
+ drm_i810_private_t *dev_priv = (drm_i810_private_t *)dev->dev_private;
+ u32 *hw_status = (u32 *)dev_priv->hw_status_page;
+ drm_i810_sarea_t *sarea_priv = (drm_i810_sarea_t *)
+ dev_priv->sarea_priv;
+ drm_i810_mc_t mc;
+
+ if (copy_from_user(&mc, (drm_i810_mc_t *)arg, sizeof(mc)))
+ return -EFAULT;
+
+
+ if(!_DRM_LOCK_IS_HELD(dev->lock.hw_lock->lock)) {
+ DRM_ERROR("i810_dma_mc called without lock held\n");
+ return -EINVAL;
+ }
+
+ i810_dma_dispatch_mc(dev, dma->buflist[mc.idx], mc.used,
+ mc.last_render );
+
+ atomic_add(mc.used, &dev->counts[_DRM_STAT_SECONDARY]);
+ atomic_inc(&dev->counts[_DRM_STAT_DMA]);
+ sarea_priv->last_enqueue = dev_priv->counter-1;
+ sarea_priv->last_dispatch = (int) hw_status[5];
+
+ return 0;
+}
+
+int i810_rstatus(struct inode *inode, struct file *filp,
+ unsigned int cmd, unsigned long arg)
+{
+ drm_file_t *priv = filp->private_data;
+ drm_device_t *dev = priv->dev;
+ drm_i810_private_t *dev_priv = (drm_i810_private_t *)dev->dev_private;
+
+ return (int)(((u32 *)(dev_priv->hw_status_page))[4]);
+}
+
+int i810_ov0_info(struct inode *inode, struct file *filp,
+ unsigned int cmd, unsigned long arg)
+{
+ drm_file_t *priv = filp->private_data;
+ drm_device_t *dev = priv->dev;
+ drm_i810_private_t *dev_priv = (drm_i810_private_t *)dev->dev_private;
+ drm_i810_overlay_t data;
+
+ data.offset = dev_priv->overlay_offset;
+ data.physical = dev_priv->overlay_physical;
+ copy_to_user((drm_i810_overlay_t *)arg,&data,sizeof(data));
+ return 0;
+}
+
+int i810_fstatus(struct inode *inode, struct file *filp,
+ unsigned int cmd, unsigned long arg)
+{
+ drm_file_t *priv = filp->private_data;
+ drm_device_t *dev = priv->dev;
+ drm_i810_private_t *dev_priv = (drm_i810_private_t *)dev->dev_private;
+
+ if(!_DRM_LOCK_IS_HELD(dev->lock.hw_lock->lock)) {
+ DRM_ERROR("i810_fstatus called without lock held\n");
+ return -EINVAL;
+ }
+ return I810_READ(0x30008);
+}
+
+int i810_ov0_flip(struct inode *inode, struct file *filp,
+ unsigned int cmd, unsigned long arg)
+{
+ drm_file_t *priv = filp->private_data;
+ drm_device_t *dev = priv->dev;
+ drm_i810_private_t *dev_priv = (drm_i810_private_t *)dev->dev_private;
+
+ if(!_DRM_LOCK_IS_HELD(dev->lock.hw_lock->lock)) {
+ DRM_ERROR("i810_ov0_flip called without lock held\n");
+ return -EINVAL;
+ }
+
+ //Tell the overlay to update
+ I810_WRITE(0x30000,dev_priv->overlay_physical | 0x80000000);
+
+ return 0;
+}
+
+
diff --git a/linux/i810_drm.h b/linux/i810_drm.h
index 5d47adda..8413293b 100644
--- a/linux/i810_drm.h
+++ b/linux/i810_drm.h
@@ -112,6 +112,8 @@ typedef struct _drm_i810_init {
unsigned int front_offset;
unsigned int back_offset;
unsigned int depth_offset;
+ unsigned int overlay_offset;
+ unsigned int overlay_physical;
unsigned int w;
unsigned int h;
unsigned int pitch;
@@ -196,4 +198,18 @@ typedef struct drm_i810_dma {
int granted;
} drm_i810_dma_t;
+typedef struct _drm_i810_overlay_t {
+ unsigned int offset; /* Address of the Overlay Regs */
+ unsigned int physical;
+} drm_i810_overlay_t;
+
+typedef struct _drm_i810_mc {
+ int idx; /* buffer index */
+ int used; /* nr bytes in use */
+ int num_blocks; /* number of GFXBlocks */
+ int *length; /* List of lengths for GFXBlocks (FUTURE)*/
+ unsigned int last_render; /* Last Render Request */
+} drm_i810_mc_t;
+
+
#endif /* _I810_DRM_H_ */
diff --git a/linux/i810_drv.c b/linux/i810_drv.c
index 1a200e0c..559b2617 100644
--- a/linux/i810_drv.c
+++ b/linux/i810_drv.c
@@ -39,10 +39,10 @@
#define DRIVER_NAME "i810"
#define DRIVER_DESC "Intel i810"
-#define DRIVER_DATE "20010917"
+#define DRIVER_DATE "20010920"
#define DRIVER_MAJOR 1
-#define DRIVER_MINOR 1
+#define DRIVER_MINOR 2
#define DRIVER_PATCHLEVEL 0
#define DRIVER_IOCTLS \
@@ -54,7 +54,12 @@
[DRM_IOCTL_NR(DRM_IOCTL_I810_GETBUF)] = { i810_getbuf, 1, 0 }, \
[DRM_IOCTL_NR(DRM_IOCTL_I810_SWAP)] = { i810_swap_bufs, 1, 0 }, \
[DRM_IOCTL_NR(DRM_IOCTL_I810_COPY)] = { i810_copybuf, 1, 0 }, \
- [DRM_IOCTL_NR(DRM_IOCTL_I810_DOCOPY)] = { i810_docopy, 1, 0 },
+ [DRM_IOCTL_NR(DRM_IOCTL_I810_DOCOPY)] = { i810_docopy, 1, 0 }, \
+ [DRM_IOCTL_NR(DRM_IOCTL_I810_OV0INFO)] = { i810_ov0_info, 1, 0 }, \
+ [DRM_IOCTL_NR(DRM_IOCTL_I810_FSTATUS)] = { i810_fstatus, 1, 0 }, \
+ [DRM_IOCTL_NR(DRM_IOCTL_I810_OV0FLIP)] = { i810_ov0_flip, 1, 0 }, \
+ [DRM_IOCTL_NR(DRM_IOCTL_I810_MC)] = { i810_dma_mc, 1, 1 }, \
+ [DRM_IOCTL_NR(DRM_IOCTL_I810_RSTATUS)] = { i810_rstatus, 1, 0 }
#define __HAVE_COUNTERS 4
diff --git a/linux/i810_drv.h b/linux/i810_drv.h
index e1b17148..a27384d4 100644
--- a/linux/i810_drv.h
+++ b/linux/i810_drv.h
@@ -73,6 +73,8 @@ typedef struct drm_i810_private {
int back_offset;
int depth_offset;
+ int overlay_offset;
+ int overlay_physical;
int w, h;
int pitch;
} drm_i810_private_t;
@@ -94,6 +96,18 @@ extern int i810_copybuf(struct inode *inode, struct file *filp,
extern int i810_docopy(struct inode *inode, struct file *filp,
unsigned int cmd, unsigned long arg);
+extern int i810_rstatus(struct inode *inode, struct file *filp,
+ unsigned int cmd, unsigned long arg);
+extern int i810_ov0_info(struct inode *inode, struct file *filp,
+ unsigned int cmd, unsigned long arg);
+extern int i810_fstatus(struct inode *inode, struct file *filp,
+ unsigned int cmd, unsigned long arg);
+extern int i810_ov0_flip(struct inode *inode, struct file *filp,
+ unsigned int cmd, unsigned long arg);
+extern int i810_dma_mc(struct inode *inode, struct file *filp,
+ unsigned int cmd, unsigned long arg);
+
+
extern void i810_dma_quiescent(drm_device_t *dev);
#define I810_VERBOSE 0
diff --git a/linux/picker.c b/linux/picker.c
index 4b4fbe90..6c228dfc 100644
--- a/linux/picker.c
+++ b/linux/picker.c
@@ -22,14 +22,9 @@
#define CONFIG_AGP 0
#endif
-#ifndef CONFIG_FB_SIS
-#define CONFIG_FB_SIS 0
-#endif
-
SMP = CONFIG_SMP
MODULES = CONFIG_MODULES
MODVERSIONS = CONFIG_MODVERSIONS
AGP = CONFIG_AGP
AGP_MODULE = CONFIG_AGP_MODULE
RELEASE = UTS_RELEASE
-SIS = CONFIG_FB_SIS
diff --git a/linux/radeon_state.c b/linux/radeon_state.c
index 0a209245..9322292a 100644
--- a/linux/radeon_state.c
+++ b/linux/radeon_state.c
@@ -1058,7 +1058,7 @@ static int radeon_cp_dispatch_texture( drm_device_t *dev,
DRM_ERROR( "EFAULT on tex->image\n" );
return -EFAULT;
}
- } else if ( size < 4 ) {
+ } else if ( size < 4 && size > 0 ) {
size = 4;
}
diff --git a/linux/sis.h b/linux/sis.h
index 2e5f7bb3..02f03086 100644
--- a/linux/sis.h
+++ b/linux/sis.h
@@ -24,7 +24,7 @@
* DEALINGS IN THE SOFTWARE.
*
*/
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/sis.h,v 1.1 2001/05/19 18:29:22 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/sis.h,v 1.2 2001/12/19 21:25:59 dawes Exp $ */
#ifndef __SIS_H__
#define __SIS_H__
@@ -47,4 +47,10 @@
#define DRIVER_AGP_BUFFERS_MAP( dev ) \
((drm_sis_private_t *)((dev)->dev_private))->buffers
+extern int sis_init_context(int context);
+extern int sis_final_context(int context);
+
+#define DRIVER_CTX_CTOR sis_init_context
+#define DRIVER_CTX_DTOR sis_final_context
+
#endif
diff --git a/linux/sis_drv.c b/linux/sis_drv.c
index 3dd83fd7..2d9612f5 100644
--- a/linux/sis_drv.c
+++ b/linux/sis_drv.c
@@ -40,12 +40,12 @@
#define DRIVER_PATCHLEVEL 0
#define DRIVER_IOCTLS \
- [DRM_IOCTL_NR(SIS_IOCTL_FB_ALLOC)] = { sis_fb_alloc, 1, 1 }, \
- [DRM_IOCTL_NR(SIS_IOCTL_FB_FREE)] = { sis_fb_free, 1, 1 }, \
+ [DRM_IOCTL_NR(SIS_IOCTL_FB_ALLOC)] = { sis_fb_alloc, 1, 0 }, \
+ [DRM_IOCTL_NR(SIS_IOCTL_FB_FREE)] = { sis_fb_free, 1, 0 }, \
/* AGP Memory Management */ \
- [DRM_IOCTL_NR(SIS_IOCTL_AGP_INIT)] = { sisp_agp_init, 1, 1 }, \
- [DRM_IOCTL_NR(SIS_IOCTL_AGP_ALLOC)] = { sisp_agp_alloc, 1, 1 }, \
- [DRM_IOCTL_NR(SIS_IOCTL_AGP_FREE)] = { sisp_agp_free, 1, 1 }
+ [DRM_IOCTL_NR(SIS_IOCTL_AGP_INIT)] = { sisp_agp_init, 1, 0 }, \
+ [DRM_IOCTL_NR(SIS_IOCTL_AGP_ALLOC)] = { sisp_agp_alloc, 1, 0 }, \
+ [DRM_IOCTL_NR(SIS_IOCTL_AGP_FREE)] = { sisp_agp_free, 1, 0 }
#if 0 /* these don't appear to be defined */
/* SIS Stereo */
[DRM_IOCTL_NR(DRM_IOCTL_CONTROL)] = { sis_control, 1, 1 },
diff --git a/linux/sis_ds.c b/linux/sis_ds.c
index 6143ad83..95880a48 100644
--- a/linux/sis_ds.c
+++ b/linux/sis_ds.c
@@ -33,7 +33,7 @@
#include <linux/delay.h>
#include <linux/errno.h>
#include <linux/kernel.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
#include <linux/poll.h>
#include <asm/io.h>
#include <linux/pci.h>
diff --git a/linux/sis_mm.c b/linux/sis_mm.c
index 2c2e0d95..81832769 100644
--- a/linux/sis_mm.c
+++ b/linux/sis_mm.c
@@ -72,7 +72,7 @@ static int del_alloc_set(int context, int type, unsigned int val)
}
/* fb management via fb device */
-#if 0
+#if 1
int sis_fb_alloc(struct inode *inode, struct file *filp, unsigned int cmd,
unsigned long arg)
{
@@ -90,7 +90,7 @@ int sis_fb_alloc(struct inode *inode, struct file *filp, unsigned int cmd,
fb.offset = req.offset;
fb.free = req.offset;
if(!add_alloc_set(fb.context, VIDEO_TYPE, fb.free)){
- DRM_DEBUG("adding to allocation set fails");
+ DRM_DEBUG("adding to allocation set fails\n");
sis_free(req.offset);
retval = -1;
}
@@ -185,7 +185,7 @@ int sisp_agp_alloc(struct inode *inode, struct file *filp, unsigned int cmd,
agp.offset = block->ofs;
agp.free = (unsigned int)block;
if(!add_alloc_set(agp.context, AGP_TYPE, agp.free)){
- DRM_DEBUG("adding to allocation set fails");
+ DRM_DEBUG("adding to allocation set fails\n");
mmFreeMem((PMemBlock)agp.free);
retval = -1;
}
@@ -279,9 +279,7 @@ int sis_final_context(int context)
retval = setFirst(set, &item);
while(retval){
DRM_DEBUG("free video memory 0x%x\n", item);
-#if 0
sis_free(item);
-#endif
retval = setNext(set, &item);
}
setDestroy(set);