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;
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 *
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;*/
drm_ioremapfree(map);
/* FALLTHROUGH */
case _DRM_FRAME_BUFFER:
-#ifndef DRM_NO_MTRR
if (map->mtrr) {
int retcode;
DRM_MTRR_WC);
DRM_DEBUG("mtrr_del = %d\n", retcode);
}
-#endif
break;
case _DRM_AGP:
case _DRM_SCATTER_GATHER:
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);
drm_memrange_takedown(&dev->handle_mm);
-#if !defined(DRM_NO_MTRR) && !defined(DRM_NO_AGP)
if (dev->agp && dev->agp->mtrr) {
int retcode;
dev->agp->info.ai_aperture_size, DRM_MTRR_WC);
DRM_DEBUG("mtrr_del = %d", retcode);
}
-#endif
DRM_LOCK();
drm_lastclose(dev);