some changes for the other drivers on FreeBSD

This commit is contained in:
Alan Hourihane 2001-05-11 09:29:48 +00:00
parent f7f091f7b6
commit 47f91000df
4 changed files with 43 additions and 83 deletions

View file

@ -79,35 +79,22 @@ typedef struct drm_i810_private {
/* i810_dma.c */
extern int i810_dma_schedule(drm_device_t *dev, int locked);
extern int i810_getbuf(struct inode *inode, struct file *filp,
unsigned int cmd, unsigned long arg);
extern int i810_dma_init(struct inode *inode, struct file *filp,
unsigned int cmd, unsigned long arg);
extern int i810_flush_ioctl(struct inode *inode, struct file *filp,
unsigned int cmd, unsigned long arg);
extern void i810_reclaim_buffers(drm_device_t *dev, pid_t pid);
extern int i810_getage(struct inode *inode, struct file *filp,
unsigned int cmd, unsigned long arg);
extern int i810_getbuf( DRM_OS_IOCTL );
extern int i810_dma_init( DRM_OS_IOCTL );
extern int i810_flush_ioctl( DRM_OS_IOCTL );
extern int i810_getage( DRM_OS_IOCTL );
extern int i810_mmap_buffers(struct file *filp, struct vm_area_struct *vma);
extern int i810_copybuf(struct inode *inode, struct file *filp,
unsigned int cmd, unsigned long arg);
extern int i810_docopy(struct inode *inode, struct file *filp,
unsigned int cmd, unsigned long arg);
extern int i810_copybuf( DRM_OS_IOCTL );
extern int i810_docopy( DRM_OS_IOCTL );
extern void i810_dma_quiescent(drm_device_t *dev);
#define I810_VERBOSE 0
int i810_dma_vertex(struct inode *inode, struct file *filp,
unsigned int cmd, unsigned long arg);
int i810_swap_bufs(struct inode *inode, struct file *filp,
unsigned int cmd, unsigned long arg);
int i810_clear_bufs(struct inode *inode, struct file *filp,
unsigned int cmd, unsigned long arg);
int i810_dma_vertex( DRM_OS_IOCTL );
int i810_swap_bufs( DRM_OS_IOCTL );
int i810_clear_bufs( DRM_OS_IOCTL );
#define I810_BASE(reg) ((unsigned long) \
dev_priv->mmio_map->handle)

View file

@ -79,35 +79,22 @@ typedef struct drm_i810_private {
/* i810_dma.c */
extern int i810_dma_schedule(drm_device_t *dev, int locked);
extern int i810_getbuf(struct inode *inode, struct file *filp,
unsigned int cmd, unsigned long arg);
extern int i810_dma_init(struct inode *inode, struct file *filp,
unsigned int cmd, unsigned long arg);
extern int i810_flush_ioctl(struct inode *inode, struct file *filp,
unsigned int cmd, unsigned long arg);
extern void i810_reclaim_buffers(drm_device_t *dev, pid_t pid);
extern int i810_getage(struct inode *inode, struct file *filp,
unsigned int cmd, unsigned long arg);
extern int i810_getbuf( DRM_OS_IOCTL );
extern int i810_dma_init( DRM_OS_IOCTL );
extern int i810_flush_ioctl( DRM_OS_IOCTL );
extern int i810_getage( DRM_OS_IOCTL );
extern int i810_mmap_buffers(struct file *filp, struct vm_area_struct *vma);
extern int i810_copybuf(struct inode *inode, struct file *filp,
unsigned int cmd, unsigned long arg);
extern int i810_docopy(struct inode *inode, struct file *filp,
unsigned int cmd, unsigned long arg);
extern int i810_copybuf( DRM_OS_IOCTL );
extern int i810_docopy( DRM_OS_IOCTL );
extern void i810_dma_quiescent(drm_device_t *dev);
#define I810_VERBOSE 0
int i810_dma_vertex(struct inode *inode, struct file *filp,
unsigned int cmd, unsigned long arg);
int i810_swap_bufs(struct inode *inode, struct file *filp,
unsigned int cmd, unsigned long arg);
int i810_clear_bufs(struct inode *inode, struct file *filp,
unsigned int cmd, unsigned long arg);
int i810_dma_vertex( DRM_OS_IOCTL );
int i810_swap_bufs( DRM_OS_IOCTL );
int i810_clear_bufs( DRM_OS_IOCTL );
#define I810_BASE(reg) ((unsigned long) \
dev_priv->mmio_map->handle)

View file

@ -33,8 +33,10 @@
#include "drmP.h"
#include "r128_drv.h"
#ifdef __linux__
#include <linux/interrupt.h> /* For task queue support */
#include <linux/delay.h>
#endif
#define R128_FIFO_DEBUG 0
@ -128,7 +130,7 @@ static int r128_do_pixcache_flush( drm_r128_private_t *dev_priv )
if ( !(R128_READ( R128_PC_NGUI_CTLSTAT ) & R128_PC_BUSY) ) {
return 0;
}
udelay( 1 );
DRM_OS_DELAY( 1 );
}
DRM_ERROR( "%s failed!\n", __FUNCTION__ );
@ -142,7 +144,7 @@ static int r128_do_wait_for_fifo( drm_r128_private_t *dev_priv, int entries )
for ( i = 0 ; i < dev_priv->usec_timeout ; i++ ) {
int slots = R128_READ( R128_GUI_STAT ) & R128_GUI_FIFOCNT_MASK;
if ( slots >= entries ) return 0;
udelay( 1 );
DRM_OS_DELAY( 1 );
}
DRM_ERROR( "%s failed!\n", __FUNCTION__ );
@ -161,7 +163,7 @@ int r128_do_wait_for_idle( drm_r128_private_t *dev_priv )
r128_do_pixcache_flush( dev_priv );
return 0;
}
udelay( 1 );
DRM_OS_DELAY( 1 );
}
DRM_ERROR( "%s failed!\n", __FUNCTION__ );
@ -219,7 +221,7 @@ int r128_do_cce_idle( drm_r128_private_t *dev_priv )
return r128_do_pixcache_flush( dev_priv );
}
}
udelay( 1 );
DRM_OS_DELAY( 1 );
}
#if R128_FIFO_DEBUG
@ -870,7 +872,7 @@ drm_buf_t *r128_freelist_get( drm_device_t *dev )
return buf;
}
}
udelay( 1 );
DRM_OS_DELAY( 1 );
}
DRM_ERROR( "returning NULL!\n" );
@ -903,7 +905,7 @@ int r128_wait_ring( drm_r128_private_t *dev_priv, int n )
r128_update_ring_snapshot( ring );
if ( ring->space >= n )
return 0;
udelay( 1 );
DRM_OS_DELAY( 1 );
}
/* FIXME: This is being ignored... */

View file

@ -115,29 +115,21 @@ typedef struct drm_r128_buf_priv {
} drm_r128_buf_priv_t;
/* r128_cce.c */
extern int r128_cce_init( struct inode *inode, struct file *filp,
unsigned int cmd, unsigned long arg );
extern int r128_cce_start( struct inode *inode, struct file *filp,
unsigned int cmd, unsigned long arg );
extern int r128_cce_stop( struct inode *inode, struct file *filp,
unsigned int cmd, unsigned long arg );
extern int r128_cce_reset( struct inode *inode, struct file *filp,
unsigned int cmd, unsigned long arg );
extern int r128_cce_idle( struct inode *inode, struct file *filp,
unsigned int cmd, unsigned long arg );
extern int r128_engine_reset( struct inode *inode, struct file *filp,
unsigned int cmd, unsigned long arg );
extern int r128_fullscreen( struct inode *inode, struct file *filp,
unsigned int cmd, unsigned long arg );
extern int r128_cce_buffers( struct inode *inode, struct file *filp,
unsigned int cmd, unsigned long arg );
extern int r128_cce_init( DRM_OS_IOCTL );
extern int r128_cce_start( DRM_OS_IOCTL );
extern int r128_cce_stop( DRM_OS_IOCTL );
extern int r128_cce_reset( DRM_OS_IOCTL );
extern int r128_cce_idle( DRM_OS_IOCTL );
extern int r128_engine_reset( DRM_OS_IOCTL );
extern int r128_fullscreen( DRM_OS_IOCTL );
extern int r128_cce_buffers( DRM_OS_IOCTL );
extern void r128_freelist_reset( drm_device_t *dev );
extern drm_buf_t *r128_freelist_get( drm_device_t *dev );
extern int r128_wait_ring( drm_r128_private_t *dev_priv, int n );
static inline void
static __inline__ void
r128_update_ring_snapshot( drm_r128_ring_buffer_t *ring )
{
ring->space = (GET_RING_HEAD( ring ) - ring->tail) * sizeof(u32);
@ -150,22 +142,14 @@ extern int r128_do_cleanup_cce( drm_device_t *dev );
extern int r128_do_cleanup_pageflip( drm_device_t *dev );
/* r128_state.c */
extern int r128_cce_clear( struct inode *inode, struct file *filp,
unsigned int cmd, unsigned long arg );
extern int r128_cce_swap( struct inode *inode, struct file *filp,
unsigned int cmd, unsigned long arg );
extern int r128_cce_vertex( struct inode *inode, struct file *filp,
unsigned int cmd, unsigned long arg );
extern int r128_cce_indices( struct inode *inode, struct file *filp,
unsigned int cmd, unsigned long arg );
extern int r128_cce_blit( struct inode *inode, struct file *filp,
unsigned int cmd, unsigned long arg );
extern int r128_cce_depth( struct inode *inode, struct file *filp,
unsigned int cmd, unsigned long arg );
extern int r128_cce_stipple( struct inode *inode, struct file *filp,
unsigned int cmd, unsigned long arg );
extern int r128_cce_indirect( struct inode *inode, struct file *filp,
unsigned int cmd, unsigned long arg );
extern int r128_cce_clear( DRM_OS_IOCTL );
extern int r128_cce_swap( DRM_OS_IOCTL );
extern int r128_cce_vertex( DRM_OS_IOCTL );
extern int r128_cce_indices( DRM_OS_IOCTL );
extern int r128_cce_blit( DRM_OS_IOCTL );
extern int r128_cce_depth( DRM_OS_IOCTL );
extern int r128_cce_stipple( DRM_OS_IOCTL );
extern int r128_cce_indirect( DRM_OS_IOCTL );
/* Register definitions, register access macros and drmAddMap constants