diff options
author | anholt <anholt@FreeBSD.org> | 2004-06-11 03:26:59 +0000 |
---|---|---|
committer | anholt <anholt@FreeBSD.org> | 2004-06-11 03:26:59 +0000 |
commit | be5dc242b6a2d2549e38e77baf82adb7b33b042b (patch) | |
tree | dc68be4b837d82c81a81bb2cec14ded275766e76 /sys/dev/drm/r128_state.c | |
parent | da6e1707d47446b0f3de71fd5a924233a2168f65 (diff) | |
download | FreeBSD-src-be5dc242b6a2d2549e38e77baf82adb7b33b042b.zip FreeBSD-src-be5dc242b6a2d2549e38e77baf82adb7b33b042b.tar.gz |
Merge from DRI CVS as of 2004-05-26. Most of the meat is new PCI IDs and a new
packet for Radeon.
Diffstat (limited to 'sys/dev/drm/r128_state.c')
-rw-r--r-- | sys/dev/drm/r128_state.c | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/sys/dev/drm/r128_state.c b/sys/dev/drm/r128_state.c index 5a97ac0..703d550 100644 --- a/sys/dev/drm/r128_state.c +++ b/sys/dev/drm/r128_state.c @@ -917,9 +917,9 @@ static int r128_cce_dispatch_write_span( drm_device_t *dev, DRM_DEBUG( "\n" ); count = depth->n; - if ( count > 4096 || count <= 0 ) { + if (count > 4096 || count <= 0) return DRM_ERR(EMSGSIZE); - } + if ( DRM_COPY_FROM_USER( &x, depth->x, sizeof(x) ) ) { return DRM_ERR(EFAULT); } @@ -1013,15 +1013,11 @@ static int r128_cce_dispatch_write_pixels( drm_device_t *dev, DRM_DEBUG( "\n" ); count = depth->n; - if ( count > 4096 || count <= 0 ) { + if (count > 4096 || count <= 0) return DRM_ERR(EMSGSIZE); - } xbuf_size = count * sizeof(*x); ybuf_size = count * sizeof(*y); - if ( xbuf_size <= 0 || ybuf_size <= 0 ) { - return DRM_ERR(EMSGSIZE); - } x = DRM_MALLOC( xbuf_size ); if ( x == NULL ) { @@ -1137,10 +1133,9 @@ static int r128_cce_dispatch_read_span( drm_device_t *dev, DRM_DEBUG( "\n" ); count = depth->n; - - if ( count > 4096 || count <= 0 ) { + if (count > 4096 || count <= 0) return DRM_ERR(EMSGSIZE); - } + if ( DRM_COPY_FROM_USER( &x, depth->x, sizeof(x) ) ) { return DRM_ERR(EFAULT); } @@ -1183,15 +1178,15 @@ static int r128_cce_dispatch_read_pixels( drm_device_t *dev, DRM_DEBUG( "%s\n", __FUNCTION__ ); count = depth->n; + if (count > 4096 || count <= 0) + return DRM_ERR(EMSGSIZE); + if ( count > dev_priv->depth_pitch ) { count = dev_priv->depth_pitch; } xbuf_size = count * sizeof(*x); ybuf_size = count * sizeof(*y); - if ( xbuf_size <= 0 || ybuf_size <= 0 ) { - return DRM_ERR(EMSGSIZE); - } x = DRM_MALLOC( xbuf_size ); if ( x == NULL ) { return DRM_ERR(ENOMEM); |