diff options
author | Eric Anholt <anholt@freebsd.org> | 2005-08-04 07:42:01 +0000 |
---|---|---|
committer | Eric Anholt <anholt@freebsd.org> | 2005-08-04 07:42:01 +0000 |
commit | b0da5df90a76e4e79c356fdbc90211a8e21f095c (patch) | |
tree | 8653e6b94291441a6b101a705fad88e4d11ec0ca /shared-core/mga_state.c | |
parent | 49bbb6d86178890a03040d618a8c9c76c96d3d3f (diff) |
Fix the MGA driver on BSD by passing in the proper chipset flags to the
driver's preinit routine, and by using DRM_COPY_TO_USER_IOCTL when
copying out to an ioctl's data pointer. Pulled from the latest version
of my drm-hook-rename.diff and only compile-tested after that.
Diffstat (limited to 'shared-core/mga_state.c')
-rw-r--r-- | shared-core/mga_state.c | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/shared-core/mga_state.c b/shared-core/mga_state.c index 273854cd..704a67cb 100644 --- a/shared-core/mga_state.c +++ b/shared-core/mga_state.c @@ -1130,10 +1130,7 @@ static int mga_set_fence(DRM_IOCTL_ARGS) MGA_SOFTRAP, 0x00000000); ADVANCE_DMA(); - if (DRM_COPY_TO_USER( (u32 __user *) data, & temp, sizeof(u32))) { - DRM_ERROR("copy_to_user\n"); - return DRM_ERR(EFAULT); - } + DRM_COPY_TO_USER_IOCTL((u32 __user *)data, temp, sizeof(u32)); return 0; } @@ -1155,10 +1152,7 @@ static int mga_wait_fence(DRM_IOCTL_ARGS) mga_driver_fence_wait(dev, & fence); - if (DRM_COPY_TO_USER( (u32 __user *) data, & fence, sizeof(u32))) { - DRM_ERROR("copy_to_user\n"); - return DRM_ERR(EFAULT); - } + DRM_COPY_TO_USER_IOCTL((u32 __user *)data, fence, sizeof(u32)); return 0; } |