Lines Matching refs:agp

96 	if (!dev->agp || !dev->agp->acquired)
99 agpinfo = &dev->agp->agp_info;
121 if (!dev->agp) {
122 DRM_ERROR("drm_agp_acquire : agp isn't initialized yet");
125 ret = ldi_ioctl(dev->agp->agpgart_lh, AGPIOC_ACQUIRE,
131 dev->agp->acquired = 1;
143 if (!dev->agp)
145 if (!dev->agp->acquired)
148 ret = ldi_ioctl(dev->agp->agpgart_lh, AGPIOC_RELEASE,
154 dev->agp->acquired = 0;
165 ret = ldi_ioctl(dev->agp->agpgart_lh, AGPIOC_RELEASE,
169 dev->agp->acquired = 0;
183 if (!dev->agp)
185 if (!dev->agp->acquired)
190 dev->agp->mode = modes.mode;
193 DRM_DEBUG("drm_agp_enable: dev->agp->mode=%lx", modes.mode);
195 ret = ldi_ioctl(dev->agp->agpgart_lh, AGPIOC_SETUP,
202 dev->agp->base = dev->agp->agp_info.agpi_aperbase;
203 dev->agp->enabled = 1;
219 if (!dev->agp || !dev->agp->acquired)
229 ret = ldi_ioctl(dev->agp->agpgart_lh, AGPIOC_ALLOCATE,
242 entry->next = dev->agp->memory;
243 if (dev->agp->memory)
244 dev->agp->memory->prev = entry;
245 dev->agp->memory = entry;
266 for (entry = dev->agp->memory; entry; entry = entry->next) {
284 if (!dev->agp || !dev->agp->acquired)
297 ret = ldi_ioctl(dev->agp->agpgart_lh, AGPIOC_UNBIND,
317 if (!dev->agp || !dev->agp->acquired)
330 "agp_base=0x%lx", key, start, dev->agp->base);
334 entry->bound = dev->agp->base + (start << AGP_PAGE_SHIFT);
350 if (!dev->agp || !dev->agp->acquired)
357 if (entry == dev->agp->memory)
358 dev->agp->memory = entry->next;
365 ret = ldi_ioctl(dev->agp->agpgart_lh, AGPIOC_DEALLOCATE,
380 drm_agp_head_t *agp = NULL;
384 agp = kmem_zalloc(sizeof (drm_agp_head_t), KM_SLEEP);
386 retval = ldi_ident_from_dip(dev->dip, &agp->agpgart_li);
394 &agp->agpgart_lh, agp->agpgart_li);
401 retval = ldi_ioctl(agp->agpgart_lh, AGPIOC_INFO,
402 (intptr_t)&agp->agp_info, FKIOCTL, kcred, &rval);
410 return (agp);
413 (void) ldi_close(agp->agpgart_lh, FEXCL, kcred);
416 ldi_ident_release(agp->agpgart_li);
419 kmem_free(agp, sizeof (drm_agp_head_t));
427 drm_agp_head_t *agp = dev->agp;
428 (void) ldi_close(agp->agpgart_lh, FEXCL, kcred);
429 ldi_ident_release(agp->agpgart_li);
430 kmem_free(agp, sizeof (drm_agp_head_t));
431 dev->agp = NULL;
458 ret = ldi_ioctl(dev->agp->agpgart_lh, AGPIOC_BIND,
475 if (!dev->agp || !dev->agp->acquired)
485 ret = ldi_ioctl(dev->agp->agpgart_lh, AGPIOC_UNBIND,