diff options
author | Ian Romanick <idr@us.ibm.com> | 2007-07-26 16:58:28 -0700 |
---|---|---|
committer | Ian Romanick <idr@us.ibm.com> | 2007-07-26 16:58:28 -0700 |
commit | c561cb4650dc5895acfb3ae00c7ff455be31a860 (patch) | |
tree | 65b21097253d216e0385778597031ae288e34023 /bsd-core/drm_scatter.c | |
parent | 2bafeb673f14b1e3799bf00817138c0b8211635e (diff) | |
parent | 4175dd818110bd10d6d09190d30c271e89202b18 (diff) |
Merge branch 'master' of ssh+git://git.freedesktop.org/git/mesa/drm into xgi-0-0-2
Conflicts:
linux-core/drmP.h
linux-core/drm_scatter.c
Diffstat (limited to 'bsd-core/drm_scatter.c')
-rw-r--r-- | bsd-core/drm_scatter.c | 33 |
1 files changed, 10 insertions, 23 deletions
diff --git a/bsd-core/drm_scatter.c b/bsd-core/drm_scatter.c index 46222f18..91c3c6c5 100644 --- a/bsd-core/drm_scatter.c +++ b/bsd-core/drm_scatter.c @@ -44,6 +44,7 @@ int drm_sg_alloc(drm_device_t * dev, drm_scatter_gather_t * request) { drm_sg_mem_t *entry; unsigned long pages; + int i; if ( dev->sg ) return EINVAL; @@ -52,7 +53,7 @@ int drm_sg_alloc(drm_device_t * dev, drm_scatter_gather_t * request) if ( !entry ) return ENOMEM; - pages = round_page(request.size) / PAGE_SIZE; + pages = round_page(request->size) / PAGE_SIZE; DRM_DEBUG( "sg size=%ld pages=%ld\n", request->size, pages ); entry->pages = pages; @@ -89,45 +90,31 @@ int drm_sg_alloc(drm_device_t * dev, drm_scatter_gather_t * request) dev->sg = entry; DRM_UNLOCK(); + return 0; } -int drm_sg_alloc_ioctl(DRM_IOCTL_ARGS) +int drm_sg_alloc_ioctl(drm_device_t *dev, void *data, struct drm_file *file_priv) { - DRM_DEVICE; - drm_scatter_gather_t request; + drm_scatter_gather_t *request = data; int ret; DRM_DEBUG( "%s\n", __FUNCTION__ ); - - DRM_COPY_FROM_USER_IOCTL(request, (drm_scatter_gather_t *)data, - sizeof(request) ); - - ret = drm_sg_alloc(dev, &request); - if ( ret ) return ret; - - DRM_COPY_TO_USER_IOCTL( (drm_scatter_gather_t *)data, - request, - sizeof(request) ); - - return 0; + ret = drm_sg_alloc(dev, request); + return ret; } -int drm_sg_free(DRM_IOCTL_ARGS) +int drm_sg_free(drm_device_t *dev, void *data, struct drm_file *file_priv) { - DRM_DEVICE; - drm_scatter_gather_t request; + drm_scatter_gather_t *request = data; drm_sg_mem_t *entry; - DRM_COPY_FROM_USER_IOCTL( request, (drm_scatter_gather_t *)data, - sizeof(request) ); - DRM_LOCK(); entry = dev->sg; dev->sg = NULL; DRM_UNLOCK(); - if ( !entry || entry->handle != request.handle ) + if ( !entry || entry->handle != request->handle ) return EINVAL; DRM_DEBUG( "sg free virtual = 0x%lx\n", entry->handle ); |