map the framebuffer and agp with BUS_SPACE_MAP_PREFETCHABLE

This commit is contained in:
jmcneill 2011-02-15 14:24:23 +00:00
parent 172a314918
commit 8f6ebfdd74
2 changed files with 7 additions and 2 deletions

View File

@ -197,7 +197,8 @@ drm_netbsd_ioremap(struct drm_device *dev, drm_local_map_t *map, int wc)
dev->agp_map_data[i].mapped++;
dev->agp_map_data[i].base = map->offset;
dev->agp_map_data[i].size = map->size;
dev->agp_map_data[i].flags = BUS_SPACE_MAP_LINEAR;
dev->agp_map_data[i].flags = BUS_SPACE_MAP_LINEAR |
BUS_SPACE_MAP_PREFETCHABLE;
dev->agp_map_data[i].maptype = PCI_MAPREG_TYPE_MEM;
map->fullmap = &(dev->agp_map_data[i]);
map->mapsize = dev->agp_map_data[i].size;

View File

@ -45,6 +45,7 @@ paddr_t drm_mmap(dev_t kdev, off_t offset, int prot)
#elif defined(__NetBSD__)
paddr_t phys;
unsigned long map_offs;
int flags = 0;
#endif
#if defined(__FreeBSD__)
@ -135,8 +136,11 @@ paddr_t drm_mmap(dev_t kdev, off_t offset, int prot)
case _DRM_REGISTERS:
case _DRM_AGP:
#if defined(__NetBSD__)
flags = BUS_SPACE_MAP_LINEAR;
if (type == _DRM_FRAME_BUFFER || type == _DRM_AGP)
flags |= BUS_SPACE_MAP_PREFETCHABLE;
phys = bus_space_mmap(dev->pa.pa_memt, map->offset,
offset - map->offset, prot, BUS_SPACE_MAP_LINEAR);
offset - map->offset, prot, flags);
if (phys == -1) {
DRM_ERROR("bus_space_mmap for %" PRIx64 " failed\n", offset);
return -1;