aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/drm
diff options
context:
space:
mode:
authorDave Airlie <airlied@starflyer.(none)>2005-09-05 07:51:30 -0400
committerDave Airlie <airlied@linux.ie>2005-09-05 07:51:30 -0400
commit908f9c485042e516bb3749f4361129a94772fe26 (patch)
treedafb80d522ac9319d4485eb9d189e28c74efa6f0 /drivers/char/drm
parentf210973bb6d17aa220c797e8ea23d127d96859b7 (diff)
drm: fix MGA on non AGP systems
Al Viro noticed that MGA wouldn't build on non AGP systems. Signed-off-by: Dave Airlie <airlied@linux.ie>
Diffstat (limited to 'drivers/char/drm')
-rw-r--r--drivers/char/drm/mga_dma.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/drivers/char/drm/mga_dma.c b/drivers/char/drm/mga_dma.c
index 567b425b784f..fc7d4a594bca 100644
--- a/drivers/char/drm/mga_dma.c
+++ b/drivers/char/drm/mga_dma.c
@@ -417,6 +417,7 @@ int mga_driver_preinit(drm_device_t *dev, unsigned long flags)
417 return 0; 417 return 0;
418} 418}
419 419
420#if __OS_HAS_AGP
420/** 421/**
421 * Bootstrap the driver for AGP DMA. 422 * Bootstrap the driver for AGP DMA.
422 * 423 *
@@ -560,6 +561,13 @@ static int mga_do_agp_dma_bootstrap(drm_device_t * dev,
560 DRM_INFO("Initialized card for AGP DMA.\n"); 561 DRM_INFO("Initialized card for AGP DMA.\n");
561 return 0; 562 return 0;
562} 563}
564#else
565static int mga_do_agp_dma_bootstrap(drm_device_t * dev,
566 drm_mga_dma_bootstrap_t * dma_bs)
567{
568 return -EINVAL;
569}
570#endif
563 571
564/** 572/**
565 * Bootstrap the driver for PCI DMA. 573 * Bootstrap the driver for PCI DMA.
@@ -697,7 +705,6 @@ static int mga_do_dma_bootstrap(drm_device_t * dev,
697 * carve off portions of it for internal uses. The remaining memory 705 * carve off portions of it for internal uses. The remaining memory
698 * is returned to user-mode to be used for AGP textures. 706 * is returned to user-mode to be used for AGP textures.
699 */ 707 */
700
701 if (is_agp) { 708 if (is_agp) {
702 err = mga_do_agp_dma_bootstrap(dev, dma_bs); 709 err = mga_do_agp_dma_bootstrap(dev, dma_bs);
703 } 710 }
@@ -932,6 +939,7 @@ static int mga_do_cleanup_dma( drm_device_t *dev )
932 drm_core_ioremapfree(dev->agp_buffer_map, dev); 939 drm_core_ioremapfree(dev->agp_buffer_map, dev);
933 940
934 if (dev_priv->used_new_dma_init) { 941 if (dev_priv->used_new_dma_init) {
942#if __OS_HAS_AGP
935 if (dev_priv->agp_mem != NULL) { 943 if (dev_priv->agp_mem != NULL) {
936 dev_priv->agp_textures = NULL; 944 dev_priv->agp_textures = NULL;
937 drm_unbind_agp(dev_priv->agp_mem); 945 drm_unbind_agp(dev_priv->agp_mem);
@@ -944,7 +952,7 @@ static int mga_do_cleanup_dma( drm_device_t *dev )
944 if ((dev->agp != NULL) && dev->agp->acquired) { 952 if ((dev->agp != NULL) && dev->agp->acquired) {
945 err = drm_agp_release(dev); 953 err = drm_agp_release(dev);
946 } 954 }
947 955#endif
948 dev_priv->used_new_dma_init = 0; 956 dev_priv->used_new_dma_init = 0;
949 } 957 }
950 958
@@ -965,7 +973,7 @@ static int mga_do_cleanup_dma( drm_device_t *dev )
965 } 973 }
966 } 974 }
967 975
968 return 0; 976 return err;
969} 977}
970 978
971int mga_dma_init( DRM_IOCTL_ARGS ) 979int mga_dma_init( DRM_IOCTL_ARGS )