diff options
author | dfr <dfr@FreeBSD.org> | 2000-07-12 10:13:07 +0000 |
---|---|---|
committer | dfr <dfr@FreeBSD.org> | 2000-07-12 10:13:07 +0000 |
commit | 6ab55f97093431d174fc5d9f839fe4f13aebcafe (patch) | |
tree | 13ae3615beebc7b58ec7387f19eb27c864c7d781 /sys/dev/agp/agp.c | |
parent | 44b02079a7c6306451f17f95f9ddafa11928fa26 (diff) | |
download | FreeBSD-src-6ab55f97093431d174fc5d9f839fe4f13aebcafe.zip FreeBSD-src-6ab55f97093431d174fc5d9f839fe4f13aebcafe.tar.gz |
Add support for Intel's i810 chipset with integrated graphics. An
associated patch to XFree86 allows the X server to work with this chipset
on FreeBSD. Additional work will include porting the Linux 3D driver.
Submitted by: Ruslan Ermilov <ru@FreeBSD.org>
Diffstat (limited to 'sys/dev/agp/agp.c')
-rw-r--r-- | sys/dev/agp/agp.c | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/sys/dev/agp/agp.c b/sys/dev/agp/agp.c index 0916e70..4848f01 100644 --- a/sys/dev/agp/agp.c +++ b/sys/dev/agp/agp.c @@ -344,9 +344,16 @@ agp_generic_alloc_memory(device_t dev, int type, vm_size_t size) if (sc->as_allocated + size > sc->as_maxmem) return 0; + if (type != 0) { + printf("agp_generic_alloc_memory: unsupported type %d\n", + type); + return 0; + } + mem = malloc(sizeof *mem, M_AGP, M_WAITOK); mem->am_id = sc->as_nextid++; mem->am_size = size; + mem->am_type = 0; mem->am_obj = vm_object_allocate(OBJT_DEFAULT, atop(round_page(size))); mem->am_physical = 0; mem->am_offset = 0; @@ -592,10 +599,13 @@ agp_allocate_user(device_t dev, agp_allocate *alloc) mem = AGP_ALLOC_MEMORY(dev, alloc->type, alloc->pg_count << AGP_PAGE_SHIFT); - alloc->key = mem->am_id; - alloc->physical = mem->am_physical; - - return 0; + if (mem) { + alloc->key = mem->am_id; + alloc->physical = mem->am_physical; + return 0; + } else { + return ENOMEM; + } } static int |