Wed Jul 24 03:18:05 2013 UTC ()
Add drm_io_mapping_create_wc to drmP.h.

Linux's io_mapping_create_wc just takes a bus address and a size, but
we need to pass along extra information, namely the bus space tag,
which we shall pass via a struct drm_device.


(riastradh)
diff -r1.1.1.1.2.45 -r1.1.1.1.2.46 src/sys/external/bsd/drm2/dist/include/drm/drmP.h

cvs diff -r1.1.1.1.2.45 -r1.1.1.1.2.46 src/sys/external/bsd/drm2/dist/include/drm/Attic/drmP.h (expand / switch to unified diff)

--- src/sys/external/bsd/drm2/dist/include/drm/Attic/drmP.h 2013/07/24 03:15:28 1.1.1.1.2.45
+++ src/sys/external/bsd/drm2/dist/include/drm/Attic/drmP.h 2013/07/24 03:18:05 1.1.1.1.2.46
@@ -2129,15 +2129,30 @@ DRM_WRITE32(struct drm_local_map *map, b @@ -2129,15 +2129,30 @@ DRM_WRITE32(struct drm_local_map *map, b
2129} 2129}
2130 2130
2131static inline void 2131static inline void
2132DRM_WRITE64(struct drm_local_map *map, bus_size_t offset, uint64_t value) 2132DRM_WRITE64(struct drm_local_map *map, bus_size_t offset, uint64_t value)
2133{ 2133{
2134 if (DRM_IS_BUS_SPACE(map)) 2134 if (DRM_IS_BUS_SPACE(map))
2135 bus_space_write_8(map->lm_data.bus_space.bst, 2135 bus_space_write_8(map->lm_data.bus_space.bst,
2136 map->lm_data.bus_space.bsh, offset, value); 2136 map->lm_data.bus_space.bsh, offset, value);
2137 else 2137 else
2138 *(volatile uint64_t *)((vaddr_t)map->handle + offset) = value; 2138 *(volatile uint64_t *)((vaddr_t)map->handle + offset) = value;
2139} 2139}
2140#endif /* defined(__NetBSD__) */ 2140#endif /* defined(__NetBSD__) */
2141 2141
 2142#ifdef __NetBSD__
 2143
 2144/* XXX This is pretty kludgerific. */
 2145
 2146#include <linux/io-mapping.h>
 2147
 2148static inline struct io_mapping *
 2149drm_io_mapping_create_wc(struct drm_device *dev, resource_size_t addr,
 2150 unsigned long size)
 2151{
 2152 return bus_space_io_mapping_create_wc(dev->bst, addr, size);
 2153}
 2154
 2155#endif /* defined(__NetBSD__) */
 2156
2142#endif /* __KERNEL__ */ 2157#endif /* __KERNEL__ */
2143#endif 2158#endif