diff options
Diffstat (limited to 'drivers/gpu/drm/r128/r128_state.c')
| -rw-r--r-- | drivers/gpu/drm/r128/r128_state.c | 84 |
1 files changed, 42 insertions, 42 deletions
diff --git a/drivers/gpu/drm/r128/r128_state.c b/drivers/gpu/drm/r128/r128_state.c index f7a5b5740764..026a48c95c8f 100644 --- a/drivers/gpu/drm/r128/r128_state.c +++ b/drivers/gpu/drm/r128/r128_state.c | |||
| @@ -910,24 +910,24 @@ static int r128_cce_dispatch_write_span(struct drm_device * dev, | |||
| 910 | } | 910 | } |
| 911 | 911 | ||
| 912 | buffer_size = depth->n * sizeof(u32); | 912 | buffer_size = depth->n * sizeof(u32); |
| 913 | buffer = drm_alloc(buffer_size, DRM_MEM_BUFS); | 913 | buffer = kmalloc(buffer_size, GFP_KERNEL); |
| 914 | if (buffer == NULL) | 914 | if (buffer == NULL) |
| 915 | return -ENOMEM; | 915 | return -ENOMEM; |
| 916 | if (DRM_COPY_FROM_USER(buffer, depth->buffer, buffer_size)) { | 916 | if (DRM_COPY_FROM_USER(buffer, depth->buffer, buffer_size)) { |
| 917 | drm_free(buffer, buffer_size, DRM_MEM_BUFS); | 917 | kfree(buffer); |
| 918 | return -EFAULT; | 918 | return -EFAULT; |
| 919 | } | 919 | } |
| 920 | 920 | ||
| 921 | mask_size = depth->n * sizeof(u8); | 921 | mask_size = depth->n * sizeof(u8); |
| 922 | if (depth->mask) { | 922 | if (depth->mask) { |
| 923 | mask = drm_alloc(mask_size, DRM_MEM_BUFS); | 923 | mask = kmalloc(mask_size, GFP_KERNEL); |
| 924 | if (mask == NULL) { | 924 | if (mask == NULL) { |
| 925 | drm_free(buffer, buffer_size, DRM_MEM_BUFS); | 925 | kfree(buffer); |
| 926 | return -ENOMEM; | 926 | return -ENOMEM; |
| 927 | } | 927 | } |
| 928 | if (DRM_COPY_FROM_USER(mask, depth->mask, mask_size)) { | 928 | if (DRM_COPY_FROM_USER(mask, depth->mask, mask_size)) { |
| 929 | drm_free(buffer, buffer_size, DRM_MEM_BUFS); | 929 | kfree(buffer); |
| 930 | drm_free(mask, mask_size, DRM_MEM_BUFS); | 930 | kfree(mask); |
| 931 | return -EFAULT; | 931 | return -EFAULT; |
| 932 | } | 932 | } |
| 933 | 933 | ||
| @@ -954,7 +954,7 @@ static int r128_cce_dispatch_write_span(struct drm_device * dev, | |||
| 954 | } | 954 | } |
| 955 | } | 955 | } |
| 956 | 956 | ||
| 957 | drm_free(mask, mask_size, DRM_MEM_BUFS); | 957 | kfree(mask); |
| 958 | } else { | 958 | } else { |
| 959 | for (i = 0; i < count; i++, x++) { | 959 | for (i = 0; i < count; i++, x++) { |
| 960 | BEGIN_RING(6); | 960 | BEGIN_RING(6); |
| @@ -978,7 +978,7 @@ static int r128_cce_dispatch_write_span(struct drm_device * dev, | |||
| 978 | } | 978 | } |
| 979 | } | 979 | } |
| 980 | 980 | ||
| 981 | drm_free(buffer, buffer_size, DRM_MEM_BUFS); | 981 | kfree(buffer); |
| 982 | 982 | ||
| 983 | return 0; | 983 | return 0; |
| 984 | } | 984 | } |
| @@ -1000,54 +1000,54 @@ static int r128_cce_dispatch_write_pixels(struct drm_device * dev, | |||
| 1000 | 1000 | ||
| 1001 | xbuf_size = count * sizeof(*x); | 1001 | xbuf_size = count * sizeof(*x); |
| 1002 | ybuf_size = count * sizeof(*y); | 1002 | ybuf_size = count * sizeof(*y); |
| 1003 | x = drm_alloc(xbuf_size, DRM_MEM_BUFS); | 1003 | x = kmalloc(xbuf_size, GFP_KERNEL); |
| 1004 | if (x == NULL) { | 1004 | if (x == NULL) { |
| 1005 | return -ENOMEM; | 1005 | return -ENOMEM; |
| 1006 | } | 1006 | } |
| 1007 | y = drm_alloc(ybuf_size, DRM_MEM_BUFS); | 1007 | y = kmalloc(ybuf_size, GFP_KERNEL); |
| 1008 | if (y == NULL) { | 1008 | if (y == NULL) { |
| 1009 | drm_free(x, xbuf_size, DRM_MEM_BUFS); | 1009 | kfree(x); |
| 1010 | return -ENOMEM; | 1010 | return -ENOMEM; |
| 1011 | } | 1011 | } |
| 1012 | if (DRM_COPY_FROM_USER(x, depth->x, xbuf_size)) { | 1012 | if (DRM_COPY_FROM_USER(x, depth->x, xbuf_size)) { |
| 1013 | drm_free(x, xbuf_size, DRM_MEM_BUFS); | 1013 | kfree(x); |
| 1014 | drm_free(y, ybuf_size, DRM_MEM_BUFS); | 1014 | kfree(y); |
| 1015 | return -EFAULT; | 1015 | return -EFAULT; |
| 1016 | } | 1016 | } |
| 1017 | if (DRM_COPY_FROM_USER(y, depth->y, xbuf_size)) { | 1017 | if (DRM_COPY_FROM_USER(y, depth->y, xbuf_size)) { |
| 1018 | drm_free(x, xbuf_size, DRM_MEM_BUFS); | 1018 | kfree(x); |
| 1019 | drm_free(y, ybuf_size, DRM_MEM_BUFS); | 1019 | kfree(y); |
| 1020 | return -EFAULT; | 1020 | return -EFAULT; |
| 1021 | } | 1021 | } |
| 1022 | 1022 | ||
| 1023 | buffer_size = depth->n * sizeof(u32); | 1023 | buffer_size = depth->n * sizeof(u32); |
| 1024 | buffer = drm_alloc(buffer_size, DRM_MEM_BUFS); | 1024 | buffer = kmalloc(buffer_size, GFP_KERNEL); |
| 1025 | if (buffer == NULL) { | 1025 | if (buffer == NULL) { |
| 1026 | drm_free(x, xbuf_size, DRM_MEM_BUFS); | 1026 | kfree(x); |
| 1027 | drm_free(y, ybuf_size, DRM_MEM_BUFS); | 1027 | kfree(y); |
| 1028 | return -ENOMEM; | 1028 | return -ENOMEM; |
| 1029 | } | 1029 | } |
| 1030 | if (DRM_COPY_FROM_USER(buffer, depth->buffer, buffer_size)) { | 1030 | if (DRM_COPY_FROM_USER(buffer, depth->buffer, buffer_size)) { |
| 1031 | drm_free(x, xbuf_size, DRM_MEM_BUFS); | 1031 | kfree(x); |
| 1032 | drm_free(y, ybuf_size, DRM_MEM_BUFS); | 1032 | kfree(y); |
| 1033 | drm_free(buffer, buffer_size, DRM_MEM_BUFS); | 1033 | kfree(buffer); |
| 1034 | return -EFAULT; | 1034 | return -EFAULT; |
| 1035 | } | 1035 | } |
| 1036 | 1036 | ||
| 1037 | if (depth->mask) { | 1037 | if (depth->mask) { |
| 1038 | mask_size = depth->n * sizeof(u8); | 1038 | mask_size = depth->n * sizeof(u8); |
| 1039 | mask = drm_alloc(mask_size, DRM_MEM_BUFS); | 1039 | mask = kmalloc(mask_size, GFP_KERNEL); |
| 1040 | if (mask == NULL) { | 1040 | if (mask == NULL) { |
| 1041 | drm_free(x, xbuf_size, DRM_MEM_BUFS); | 1041 | kfree(x); |
| 1042 | drm_free(y, ybuf_size, DRM_MEM_BUFS); | 1042 | kfree(y); |
| 1043 | drm_free(buffer, buffer_size, DRM_MEM_BUFS); | 1043 | kfree(buffer); |
| 1044 | return -ENOMEM; | 1044 | return -ENOMEM; |
| 1045 | } | 1045 | } |
| 1046 | if (DRM_COPY_FROM_USER(mask, depth->mask, mask_size)) { | 1046 | if (DRM_COPY_FROM_USER(mask, depth->mask, mask_size)) { |
| 1047 | drm_free(x, xbuf_size, DRM_MEM_BUFS); | 1047 | kfree(x); |
| 1048 | drm_free(y, ybuf_size, DRM_MEM_BUFS); | 1048 | kfree(y); |
| 1049 | drm_free(buffer, buffer_size, DRM_MEM_BUFS); | 1049 | kfree(buffer); |
| 1050 | drm_free(mask, mask_size, DRM_MEM_BUFS); | 1050 | kfree(mask); |
| 1051 | return -EFAULT; | 1051 | return -EFAULT; |
| 1052 | } | 1052 | } |
| 1053 | 1053 | ||
| @@ -1074,7 +1074,7 @@ static int r128_cce_dispatch_write_pixels(struct drm_device * dev, | |||
| 1074 | } | 1074 | } |
| 1075 | } | 1075 | } |
| 1076 | 1076 | ||
| 1077 | drm_free(mask, mask_size, DRM_MEM_BUFS); | 1077 | kfree(mask); |
| 1078 | } else { | 1078 | } else { |
| 1079 | for (i = 0; i < count; i++) { | 1079 | for (i = 0; i < count; i++) { |
| 1080 | BEGIN_RING(6); | 1080 | BEGIN_RING(6); |
| @@ -1098,9 +1098,9 @@ static int r128_cce_dispatch_write_pixels(struct drm_device * dev, | |||
| 1098 | } | 1098 | } |
| 1099 | } | 1099 | } |
| 1100 | 1100 | ||
| 1101 | drm_free(x, xbuf_size, DRM_MEM_BUFS); | 1101 | kfree(x); |
| 1102 | drm_free(y, ybuf_size, DRM_MEM_BUFS); | 1102 | kfree(y); |
| 1103 | drm_free(buffer, buffer_size, DRM_MEM_BUFS); | 1103 | kfree(buffer); |
| 1104 | 1104 | ||
| 1105 | return 0; | 1105 | return 0; |
| 1106 | } | 1106 | } |
| @@ -1167,23 +1167,23 @@ static int r128_cce_dispatch_read_pixels(struct drm_device * dev, | |||
| 1167 | 1167 | ||
| 1168 | xbuf_size = count * sizeof(*x); | 1168 | xbuf_size = count * sizeof(*x); |
| 1169 | ybuf_size = count * sizeof(*y); | 1169 | ybuf_size = count * sizeof(*y); |
| 1170 | x = drm_alloc(xbuf_size, DRM_MEM_BUFS); | 1170 | x = kmalloc(xbuf_size, GFP_KERNEL); |
| 1171 | if (x == NULL) { | 1171 | if (x == NULL) { |
| 1172 | return -ENOMEM; | 1172 | return -ENOMEM; |
| 1173 | } | 1173 | } |
| 1174 | y = drm_alloc(ybuf_size, DRM_MEM_BUFS); | 1174 | y = kmalloc(ybuf_size, GFP_KERNEL); |
| 1175 | if (y == NULL) { | 1175 | if (y == NULL) { |
| 1176 | drm_free(x, xbuf_size, DRM_MEM_BUFS); | 1176 | kfree(x); |
| 1177 | return -ENOMEM; | 1177 | return -ENOMEM; |
| 1178 | } | 1178 | } |
| 1179 | if (DRM_COPY_FROM_USER(x, depth->x, xbuf_size)) { | 1179 | if (DRM_COPY_FROM_USER(x, depth->x, xbuf_size)) { |
| 1180 | drm_free(x, xbuf_size, DRM_MEM_BUFS); | 1180 | kfree(x); |
| 1181 | drm_free(y, ybuf_size, DRM_MEM_BUFS); | 1181 | kfree(y); |
| 1182 | return -EFAULT; | 1182 | return -EFAULT; |
| 1183 | } | 1183 | } |
| 1184 | if (DRM_COPY_FROM_USER(y, depth->y, ybuf_size)) { | 1184 | if (DRM_COPY_FROM_USER(y, depth->y, ybuf_size)) { |
| 1185 | drm_free(x, xbuf_size, DRM_MEM_BUFS); | 1185 | kfree(x); |
| 1186 | drm_free(y, ybuf_size, DRM_MEM_BUFS); | 1186 | kfree(y); |
| 1187 | return -EFAULT; | 1187 | return -EFAULT; |
| 1188 | } | 1188 | } |
| 1189 | 1189 | ||
| @@ -1210,8 +1210,8 @@ static int r128_cce_dispatch_read_pixels(struct drm_device * dev, | |||
| 1210 | ADVANCE_RING(); | 1210 | ADVANCE_RING(); |
| 1211 | } | 1211 | } |
| 1212 | 1212 | ||
| 1213 | drm_free(x, xbuf_size, DRM_MEM_BUFS); | 1213 | kfree(x); |
| 1214 | drm_free(y, ybuf_size, DRM_MEM_BUFS); | 1214 | kfree(y); |
| 1215 | 1215 | ||
| 1216 | return 0; | 1216 | return 0; |
| 1217 | } | 1217 | } |
