Kill some redundant ifdefs, they're taken care of elsewhere.
authoroga <oga@openbsd.org>
Sun, 17 Aug 2008 15:31:39 +0000 (15:31 +0000)
committeroga <oga@openbsd.org>
Sun, 17 Aug 2008 15:31:39 +0000 (15:31 +0000)
sys/dev/pci/drm/drm_agpsupport.c
sys/dev/pci/drm/drm_bufs.c
sys/dev/pci/drm/drm_drv.c

index ea8a5c1..8a9e38d 100644 (file)
@@ -378,6 +378,7 @@ drm_agp_free_ioctl(struct drm_device *dev, void *data,
 drm_agp_head_t *
 drm_agp_init(void)
 {
+#ifndef DRM_NO_AGP
        struct device *agpdev;
        drm_agp_head_t *head = NULL;
        int agp_available = 1;
@@ -393,13 +394,14 @@ drm_agp_init(void)
                if (head == NULL)
                        return NULL;
                head->agpdev = agpdev;
-#ifndef DRM_NO_AGP
                agp_get_info(agpdev, &head->info);
-#endif
                head->base = head->info.ai_aperture_base;
                TAILQ_INIT(&head->memory);
        }
        return head;
+#else
+       return (NULL);
+#endif
 }
 
 void *
index 60c0cd4..b14d2fa 100644 (file)
@@ -200,10 +200,8 @@ drm_addmap(struct drm_device * dev, unsigned long offset, unsigned long size,
                        break;
                /* FALLTHROUGH */
        case _DRM_FRAME_BUFFER:
-#ifndef DRM_NO_MTRR
                if (drm_mtrr_add(map->offset, map->size, DRM_MTRR_WC) == 0)
                        map->mtrr = 1;
-#endif
                break;
        case _DRM_AGP:
                /*valid = 0;*/
@@ -346,7 +344,6 @@ drm_rmmap(struct drm_device *dev, drm_local_map_t *map)
                drm_ioremapfree(map);
                /* FALLTHROUGH */
        case _DRM_FRAME_BUFFER:
-#ifndef DRM_NO_MTRR
                if (map->mtrr) {
                        int retcode;
                        
@@ -354,7 +351,6 @@ drm_rmmap(struct drm_device *dev, drm_local_map_t *map)
                            DRM_MTRR_WC);
                        DRM_DEBUG("mtrr_del = %d\n", retcode);
                }
-#endif
                break;
        case _DRM_AGP:
        case _DRM_SCATTER_GATHER:
index 476fd99..646d940 100644 (file)
@@ -419,13 +419,11 @@ drm_load(struct drm_device *dev)
                        retcode = ENOMEM;
                        goto error;
                }
-#ifndef DRM_NO_MTRR
                if (dev->agp != NULL) {
                        if (drm_mtrr_add(dev->agp->info.ai_aperture_base,
                            dev->agp->info.ai_aperture_size, DRM_MTRR_WC) == 0)
                                dev->agp->mtrr = 1;
                }
-#endif
        }
 
        retcode = drm_ctxbitmap_init(dev);
@@ -456,7 +454,6 @@ drm_unload(struct drm_device *dev)
 
        drm_memrange_takedown(&dev->handle_mm);
 
-#if !defined(DRM_NO_MTRR) && !defined(DRM_NO_AGP)
        if (dev->agp && dev->agp->mtrr) {
                int retcode;
 
@@ -464,7 +461,6 @@ drm_unload(struct drm_device *dev)
                    dev->agp->info.ai_aperture_size, DRM_MTRR_WC);
                DRM_DEBUG("mtrr_del = %d", retcode);
        }
-#endif
 
        DRM_LOCK();
        drm_lastclose(dev);