diff options
Diffstat (limited to 'drivers/gpu/drm/i915/i915_gem.c')
-rw-r--r-- | drivers/gpu/drm/i915/i915_gem.c | 35 |
1 files changed, 16 insertions, 19 deletions
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c index 174aef2d6481..fd2b8bdffe3f 100644 --- a/drivers/gpu/drm/i915/i915_gem.c +++ b/drivers/gpu/drm/i915/i915_gem.c | |||
@@ -1207,8 +1207,7 @@ i915_gem_create_mmap_offset(struct drm_gem_object *obj) | |||
1207 | 1207 | ||
1208 | /* Set the object up for mmap'ing */ | 1208 | /* Set the object up for mmap'ing */ |
1209 | list = &obj->map_list; | 1209 | list = &obj->map_list; |
1210 | list->map = drm_calloc(1, sizeof(struct drm_map_list), | 1210 | list->map = kzalloc(sizeof(struct drm_map_list), GFP_KERNEL); |
1211 | DRM_MEM_DRIVER); | ||
1212 | if (!list->map) | 1211 | if (!list->map) |
1213 | return -ENOMEM; | 1212 | return -ENOMEM; |
1214 | 1213 | ||
@@ -1248,7 +1247,7 @@ i915_gem_create_mmap_offset(struct drm_gem_object *obj) | |||
1248 | out_free_mm: | 1247 | out_free_mm: |
1249 | drm_mm_put_block(list->file_offset_node); | 1248 | drm_mm_put_block(list->file_offset_node); |
1250 | out_free_list: | 1249 | out_free_list: |
1251 | drm_free(list->map, sizeof(struct drm_map_list), DRM_MEM_DRIVER); | 1250 | kfree(list->map); |
1252 | 1251 | ||
1253 | return ret; | 1252 | return ret; |
1254 | } | 1253 | } |
@@ -1270,7 +1269,7 @@ i915_gem_free_mmap_offset(struct drm_gem_object *obj) | |||
1270 | } | 1269 | } |
1271 | 1270 | ||
1272 | if (list->map) { | 1271 | if (list->map) { |
1273 | drm_free(list->map, sizeof(struct drm_map), DRM_MEM_DRIVER); | 1272 | kfree(list->map); |
1274 | list->map = NULL; | 1273 | list->map = NULL; |
1275 | } | 1274 | } |
1276 | 1275 | ||
@@ -1493,7 +1492,7 @@ i915_add_request(struct drm_device *dev, struct drm_file *file_priv, | |||
1493 | if (file_priv != NULL) | 1492 | if (file_priv != NULL) |
1494 | i915_file_priv = file_priv->driver_priv; | 1493 | i915_file_priv = file_priv->driver_priv; |
1495 | 1494 | ||
1496 | request = drm_calloc(1, sizeof(*request), DRM_MEM_DRIVER); | 1495 | request = kzalloc(sizeof(*request), GFP_KERNEL); |
1497 | if (request == NULL) | 1496 | if (request == NULL) |
1498 | return 0; | 1497 | return 0; |
1499 | 1498 | ||
@@ -1675,7 +1674,7 @@ i915_gem_retire_requests(struct drm_device *dev) | |||
1675 | 1674 | ||
1676 | list_del(&request->list); | 1675 | list_del(&request->list); |
1677 | list_del(&request->client_list); | 1676 | list_del(&request->client_list); |
1678 | drm_free(request, sizeof(*request), DRM_MEM_DRIVER); | 1677 | kfree(request); |
1679 | } else | 1678 | } else |
1680 | break; | 1679 | break; |
1681 | } | 1680 | } |
@@ -2833,8 +2832,7 @@ i915_gem_object_set_to_full_cpu_read_domain(struct drm_gem_object *obj) | |||
2833 | /* Free the page_cpu_valid mappings which are now stale, whether | 2832 | /* Free the page_cpu_valid mappings which are now stale, whether |
2834 | * or not we've got I915_GEM_DOMAIN_CPU. | 2833 | * or not we've got I915_GEM_DOMAIN_CPU. |
2835 | */ | 2834 | */ |
2836 | drm_free(obj_priv->page_cpu_valid, obj->size / PAGE_SIZE, | 2835 | kfree(obj_priv->page_cpu_valid); |
2837 | DRM_MEM_DRIVER); | ||
2838 | obj_priv->page_cpu_valid = NULL; | 2836 | obj_priv->page_cpu_valid = NULL; |
2839 | } | 2837 | } |
2840 | 2838 | ||
@@ -2876,8 +2874,8 @@ i915_gem_object_set_cpu_read_domain_range(struct drm_gem_object *obj, | |||
2876 | * newly adding I915_GEM_DOMAIN_CPU | 2874 | * newly adding I915_GEM_DOMAIN_CPU |
2877 | */ | 2875 | */ |
2878 | if (obj_priv->page_cpu_valid == NULL) { | 2876 | if (obj_priv->page_cpu_valid == NULL) { |
2879 | obj_priv->page_cpu_valid = drm_calloc(1, obj->size / PAGE_SIZE, | 2877 | obj_priv->page_cpu_valid = kzalloc(obj->size / PAGE_SIZE, |
2880 | DRM_MEM_DRIVER); | 2878 | GFP_KERNEL); |
2881 | if (obj_priv->page_cpu_valid == NULL) | 2879 | if (obj_priv->page_cpu_valid == NULL) |
2882 | return -ENOMEM; | 2880 | return -ENOMEM; |
2883 | } else if ((obj->read_domains & I915_GEM_DOMAIN_CPU) == 0) | 2881 | } else if ((obj->read_domains & I915_GEM_DOMAIN_CPU) == 0) |
@@ -3300,8 +3298,8 @@ i915_gem_execbuffer(struct drm_device *dev, void *data, | |||
3300 | } | 3298 | } |
3301 | 3299 | ||
3302 | if (args->num_cliprects != 0) { | 3300 | if (args->num_cliprects != 0) { |
3303 | cliprects = drm_calloc(args->num_cliprects, sizeof(*cliprects), | 3301 | cliprects = kcalloc(args->num_cliprects, sizeof(*cliprects), |
3304 | DRM_MEM_DRIVER); | 3302 | GFP_KERNEL); |
3305 | if (cliprects == NULL) | 3303 | if (cliprects == NULL) |
3306 | goto pre_mutex_err; | 3304 | goto pre_mutex_err; |
3307 | 3305 | ||
@@ -3554,8 +3552,7 @@ err: | |||
3554 | pre_mutex_err: | 3552 | pre_mutex_err: |
3555 | drm_free_large(object_list); | 3553 | drm_free_large(object_list); |
3556 | drm_free_large(exec_list); | 3554 | drm_free_large(exec_list); |
3557 | drm_free(cliprects, sizeof(*cliprects) * args->num_cliprects, | 3555 | kfree(cliprects); |
3558 | DRM_MEM_DRIVER); | ||
3559 | 3556 | ||
3560 | return ret; | 3557 | return ret; |
3561 | } | 3558 | } |
@@ -3772,7 +3769,7 @@ int i915_gem_init_object(struct drm_gem_object *obj) | |||
3772 | { | 3769 | { |
3773 | struct drm_i915_gem_object *obj_priv; | 3770 | struct drm_i915_gem_object *obj_priv; |
3774 | 3771 | ||
3775 | obj_priv = drm_calloc(1, sizeof(*obj_priv), DRM_MEM_DRIVER); | 3772 | obj_priv = kzalloc(sizeof(*obj_priv), GFP_KERNEL); |
3776 | if (obj_priv == NULL) | 3773 | if (obj_priv == NULL) |
3777 | return -ENOMEM; | 3774 | return -ENOMEM; |
3778 | 3775 | ||
@@ -3810,9 +3807,9 @@ void i915_gem_free_object(struct drm_gem_object *obj) | |||
3810 | 3807 | ||
3811 | i915_gem_free_mmap_offset(obj); | 3808 | i915_gem_free_mmap_offset(obj); |
3812 | 3809 | ||
3813 | drm_free(obj_priv->page_cpu_valid, 1, DRM_MEM_DRIVER); | 3810 | kfree(obj_priv->page_cpu_valid); |
3814 | kfree(obj_priv->bit_17); | 3811 | kfree(obj_priv->bit_17); |
3815 | drm_free(obj->driver_private, 1, DRM_MEM_DRIVER); | 3812 | kfree(obj->driver_private); |
3816 | } | 3813 | } |
3817 | 3814 | ||
3818 | /** Unbinds all objects that are on the given buffer list. */ | 3815 | /** Unbinds all objects that are on the given buffer list. */ |
@@ -4266,7 +4263,7 @@ int i915_gem_init_phys_object(struct drm_device *dev, | |||
4266 | if (dev_priv->mm.phys_objs[id - 1] || !size) | 4263 | if (dev_priv->mm.phys_objs[id - 1] || !size) |
4267 | return 0; | 4264 | return 0; |
4268 | 4265 | ||
4269 | phys_obj = drm_calloc(1, sizeof(struct drm_i915_gem_phys_object), DRM_MEM_DRIVER); | 4266 | phys_obj = kzalloc(sizeof(struct drm_i915_gem_phys_object), GFP_KERNEL); |
4270 | if (!phys_obj) | 4267 | if (!phys_obj) |
4271 | return -ENOMEM; | 4268 | return -ENOMEM; |
4272 | 4269 | ||
@@ -4285,7 +4282,7 @@ int i915_gem_init_phys_object(struct drm_device *dev, | |||
4285 | 4282 | ||
4286 | return 0; | 4283 | return 0; |
4287 | kfree_obj: | 4284 | kfree_obj: |
4288 | drm_free(phys_obj, sizeof(struct drm_i915_gem_phys_object), DRM_MEM_DRIVER); | 4285 | kfree(phys_obj); |
4289 | return ret; | 4286 | return ret; |
4290 | } | 4287 | } |
4291 | 4288 | ||