diff options
Diffstat (limited to 'bsd/drm_agpsupport.h')
-rw-r--r-- | bsd/drm_agpsupport.h | 36 |
1 files changed, 24 insertions, 12 deletions
diff --git a/bsd/drm_agpsupport.h b/bsd/drm_agpsupport.h index a940378e..1414569d 100644 --- a/bsd/drm_agpsupport.h +++ b/bsd/drm_agpsupport.h @@ -37,7 +37,8 @@ int DRM(agp_info)(DRM_IOCTL_ARGS) struct agp_info *kern; drm_agp_info_t info; - if (!dev->agp || !dev->agp->acquired) return EINVAL; + if (!dev->agp || !dev->agp->acquired) + return EINVAL; kern = &dev->agp->info; agp_get_info(dev->agp->agpdev, kern); @@ -60,9 +61,11 @@ int DRM(agp_acquire)(DRM_IOCTL_ARGS) DRM_DEVICE; int retcode; - if (!dev->agp || dev->agp->acquired) return EINVAL; + if (!dev->agp || dev->agp->acquired) + return EINVAL; retcode = agp_acquire(dev->agp->agpdev); - if (retcode) return retcode; + if (retcode) + return retcode; dev->agp->acquired = 1; return 0; } @@ -93,7 +96,8 @@ int DRM(agp_enable)(DRM_IOCTL_ARGS) DRM_DEVICE; drm_agp_mode_t mode; - if (!dev->agp || !dev->agp->acquired) return EINVAL; + if (!dev->agp || !dev->agp->acquired) + return EINVAL; mode = *(drm_agp_mode_t *) data; @@ -114,7 +118,8 @@ int DRM(agp_alloc)(DRM_IOCTL_ARGS) u_int32_t type; struct agp_memory_info info; - if (!dev->agp || !dev->agp->acquired) return EINVAL; + if (!dev->agp || !dev->agp->acquired) + return EINVAL; request = *(drm_agp_buffer_t *) data; @@ -136,7 +141,8 @@ int DRM(agp_alloc)(DRM_IOCTL_ARGS) entry->pages = pages; entry->prev = NULL; entry->next = dev->agp->memory; - if (dev->agp->memory) dev->agp->memory->prev = entry; + if (dev->agp->memory) + dev->agp->memory->prev = entry; dev->agp->memory = entry; agp_memory_info(dev->agp->agpdev, entry->handle, &info); @@ -166,7 +172,8 @@ int DRM(agp_unbind)(DRM_IOCTL_ARGS) drm_agp_mem_t *entry; int retcode; - if (!dev->agp || !dev->agp->acquired) return EINVAL; + if (!dev->agp || !dev->agp->acquired) + return EINVAL; request = *(drm_agp_binding_t *) data; if (!(entry = DRM(agp_lookup_entry)(dev, (void *) request.handle))) return EINVAL; @@ -209,15 +216,20 @@ int DRM(agp_free)(DRM_IOCTL_ARGS) drm_agp_buffer_t request; drm_agp_mem_t *entry; - if (!dev->agp || !dev->agp->acquired) return EINVAL; + if (!dev->agp || !dev->agp->acquired) + return EINVAL; request = *(drm_agp_buffer_t *) data; if (!(entry = DRM(agp_lookup_entry)(dev, (void*) request.handle))) return EINVAL; - if (entry->bound) DRM(unbind_agp)(entry->handle); + if (entry->bound) + DRM(unbind_agp)(entry->handle); - if (entry->prev) entry->prev->next = entry->next; - else dev->agp->memory = entry->next; - if (entry->next) entry->next->prev = entry->prev; + if (entry->prev) + entry->prev->next = entry->next; + else + dev->agp->memory = entry->next; + if (entry->next) + entry->next->prev = entry->prev; DRM(free_agp)(entry->handle, entry->pages); DRM(free)(entry, sizeof(*entry), DRM_MEM_AGPLISTS); return 0; |