From b0da5df90a76e4e79c356fdbc90211a8e21f095c Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 4 Aug 2005 07:42:01 +0000 Subject: 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. --- shared-core/mga_state.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'shared-core/mga_state.c') 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; } -- cgit v1.2.3