aboutsummaryrefslogtreecommitdiff
path: root/shared-core/via_verifier.c
diff options
context:
space:
mode:
authorEric Anholt <anholt@freebsd.org>2005-08-15 18:07:12 +0000
committerEric Anholt <anholt@freebsd.org>2005-08-15 18:07:12 +0000
commit8c21b783c3e38aa2c2d16e11ec01cf695f8e7f8a (patch)
treec40ed75e583b24b7a9947221766c82d5a4cd061d /shared-core/via_verifier.c
parent4f5961eeeee806a2d6e08e159c56262d4f060cba (diff)
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 <jake@FreeBSD.org> Tested by: unichrome
Diffstat (limited to 'shared-core/via_verifier.c')
-rw-r--r--shared-core/via_verifier.c10
1 files changed, 8 insertions, 2 deletions
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;