summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGareth Hughes <gareth@users.sourceforge.net>2001-03-21 03:29:23 +0000
committerGareth Hughes <gareth@users.sourceforge.net>2001-03-21 03:29:23 +0000
commitb90028231c5c73783ee45124903794970f244978 (patch)
treef46f0cea9c07af1cdb675033d6c39e8659a3dc37
parent86c41620a5f0a3b3af143bebdda0cca2114ade88 (diff)
Remove compiler warnings, minor cleanups.
-rw-r--r--linux/mga_dma.c12
-rw-r--r--linux/mga_state.c13
2 files changed, 19 insertions, 6 deletions
diff --git a/linux/mga_dma.c b/linux/mga_dma.c
index 8b0a67a2..bfc661c3 100644
--- a/linux/mga_dma.c
+++ b/linux/mga_dma.c
@@ -42,6 +42,7 @@
#include <linux/delay.h>
#define MGA_DEFAULT_USEC_TIMEOUT 10000
+#define MGA_FREELIST_DEBUG 0
/* ================================================================
@@ -261,6 +262,7 @@ void mga_do_dma_wrap_end( drm_mga_private_t *dev_priv )
#define MGA_BUFFER_USED ~0
#define MGA_BUFFER_FREE 0
+#if MGA_FREELIST_DEBUG
static void mga_freelist_print( drm_device_t *dev )
{
drm_mga_private_t *dev_priv = dev->dev_private;
@@ -280,6 +282,7 @@ static void mga_freelist_print( drm_device_t *dev )
}
DRM_INFO( "\n" );
}
+#endif
static int mga_freelist_init( drm_device_t *dev )
{
@@ -348,6 +351,9 @@ static void mga_freelist_cleanup( drm_device_t *dev )
dev_priv->head = dev_priv->tail = NULL;
}
+#if 0
+/* FIXME: Still needed?
+ */
static void mga_freelist_reset( drm_device_t *dev )
{
drm_device_dma_t *dma = dev->dma;
@@ -362,6 +368,7 @@ static void mga_freelist_reset( drm_device_t *dev )
MGA_BUFFER_FREE, 0 );
}
}
+#endif
static drm_buf_t *mga_freelist_get( drm_device_t *dev )
{
@@ -468,6 +475,11 @@ static int mga_do_init_dma( drm_device_t *dev, drm_mga_init_t *init )
dev_priv->depth_offset = init->depth_offset;
dev_priv->depth_pitch = init->depth_pitch;
+ /* FIXME: Need to support AGP textures...
+ */
+ dev_priv->texture_offset = init->texture_offset[0];
+ dev_priv->texture_size = init->texture_size[0];
+
list_for_each( list, &dev->maplist->head ) {
drm_map_list_t *entry = (drm_map_list_t *)list;
if ( entry->map &&
diff --git a/linux/mga_state.c b/linux/mga_state.c
index 4c9c9c05..de5a4309 100644
--- a/linux/mga_state.c
+++ b/linux/mga_state.c
@@ -408,7 +408,7 @@ static int mga_verify_context( drm_mga_private_t *dev_priv )
if ( ctx->dstorg != dev_priv->front_offset &&
ctx->dstorg != dev_priv->back_offset ) {
- DRM_DEBUG( "*** bad DSTORG: %x (front %x, back %x)\n\n",
+ DRM_ERROR( "*** bad DSTORG: %x (front %x, back %x)\n\n",
ctx->dstorg, dev_priv->front_offset,
dev_priv->back_offset );
ctx->dstorg = 0;
@@ -429,7 +429,7 @@ static int mga_verify_tex( drm_mga_private_t *dev_priv, int unit )
org = tex->texorg & (MGA_TEXORGMAP_MASK | MGA_TEXORGACC_MASK);
if ( org == (MGA_TEXORGMAP_SYSMEM | MGA_TEXORGACC_PCI) ) {
- DRM_DEBUG( "*** bad TEXORG: 0x%x, unit %d\n",
+ DRM_ERROR( "*** bad TEXORG: 0x%x, unit %d\n",
tex->texorg, unit );
tex->texorg = 0;
return -EINVAL;
@@ -473,10 +473,13 @@ static int mga_verify_iload( drm_mga_private_t *dev_priv,
if ( dstorg < dev_priv->texture_offset ||
dstorg + length > (dev_priv->texture_offset +
dev_priv->texture_size) ) {
+ DRM_ERROR( "*** bad iload DSTORG: 0x%x\n", dstorg );
return -EINVAL;
}
if ( length & MGA_ILOAD_MASK ) {
+ DRM_ERROR( "*** bad iload length: 0x%x\n",
+ length & MGA_ILOAD_MASK );
return -EINVAL;
}
@@ -488,6 +491,8 @@ static int mga_verify_blit( drm_mga_private_t *dev_priv,
{
if ( (srcorg & 0x3) == (MGA_SRCACC_PCI | MGA_SRCMAP_SYSMEM) ||
(dstorg & 0x3) == (MGA_SRCACC_PCI | MGA_SRCMAP_SYSMEM) ) {
+ DRM_ERROR( "*** bad blit: src=0x%x dst=0x%x\n",
+ srcorg, dstorg );
return -EINVAL;
}
return 0;
@@ -1010,14 +1015,10 @@ int mga_dma_iload( struct inode *inode, struct file *filp,
buf = dma->buflist[iload.idx];
buf_priv = buf->dev_private;
-#if 0
- DRM_INFO( " verifying iload...\n" );
if ( mga_verify_iload( dev_priv, iload.dstorg, iload.length ) ) {
mga_freelist_put( dev, buf );
return -EINVAL;
}
- DRM_INFO( " verifying iload... done.\n" );
-#endif
WRAP_TEST_WITH_RETURN( dev_priv );