From 8c21b783c3e38aa2c2d16e11ec01cf695f8e7f8a Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Mon, 15 Aug 2005 18:07:12 +0000 Subject: Port the VIA DRM to FreeBSD. Original patch by Jake, with some cleanup by me to match other drivers and avoid ifdeffing. The linux via_drv.c will be moved from shared-core to linux-core soon by repocopy. Submitted by: Jake Burkholder Tested by: unichrome --- shared-core/via_verifier.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'shared-core/via_verifier.c') diff --git a/shared-core/via_verifier.c b/shared-core/via_verifier.c index 65a7b9e7..6b70be21 100644 --- a/shared-core/via_verifier.c +++ b/shared-core/via_verifier.c @@ -259,23 +259,29 @@ eat_words(const uint32_t **buf, const uint32_t *buf_end, unsigned num_words) * Partially stolen from drm_memory.h */ -static __inline__ drm_map_t * +static __inline__ drm_local_map_t * via_drm_lookup_agp_map (drm_via_state_t *seq, unsigned long offset, unsigned long size, drm_device_t *dev) { +#ifdef __linux__ struct list_head *list; drm_map_list_t *r_list; - drm_map_t *map = seq->map_cache; +#endif + drm_local_map_t *map = seq->map_cache; if (map && map->offset <= offset && (offset + size) <= (map->offset + map->size)) { return map; } +#ifdef __linux__ list_for_each(list, &dev->maplist->head) { r_list = (drm_map_list_t *) list; map = r_list->map; if (!map) continue; +#else + TAILQ_FOREACH(map, &dev->maplist, link) { +#endif if (map->offset <= offset && (offset + size) <= (map->offset + map->size) && !(map->flags & _DRM_RESTRICTED) && (map->type == _DRM_AGP)) { seq->map_cache = map; -- cgit v1.2.3