diff options
author | David Herrmann <dh.herrmann@gmail.com> | 2013-07-11 05:56:32 -0400 |
---|---|---|
committer | Dave Airlie <airlied@gmail.com> | 2013-07-23 05:37:53 -0400 |
commit | 89c8233f82d9c8af5b20e72e4a185a38a7d3c50b (patch) | |
tree | b693be2e67816f5073807ae93aa40b7f1538773d /include/drm/drmP.h | |
parent | 23367ff49065505e4a255dba2117f654ca26063f (diff) |
drm/gem: simplify object initialization
drm_gem_object_init() and drm_gem_private_object_init() do exactly the
same (except for shmem alloc) so make the first use the latter to reduce
code duplication.
Also drop the return code from drm_gem_private_object_init(). It seems
unlikely that we will extend it any time soon so no reason to keep it
around. This simplifies code paths in drivers, too.
Last but not least, fix gma500 to call drm_gem_object_release() before
freeing objects that were allocated via drm_gem_private_object_init().
That isn't actually necessary for now, but might be in the future.
Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Patrik Jakobsson <patrik.r.jakobsson@gmail.com>
Acked-by: Rob Clark <robdclark@gmail.com>
Signed-off-by: Dave Airlie <airlied@gmail.com>
Diffstat (limited to 'include/drm/drmP.h')
-rw-r--r-- | include/drm/drmP.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/include/drm/drmP.h b/include/drm/drmP.h index dd03fd4239ad..86f524338e03 100644 --- a/include/drm/drmP.h +++ b/include/drm/drmP.h | |||
@@ -1601,8 +1601,8 @@ struct drm_gem_object *drm_gem_object_alloc(struct drm_device *dev, | |||
1601 | size_t size); | 1601 | size_t size); |
1602 | int drm_gem_object_init(struct drm_device *dev, | 1602 | int drm_gem_object_init(struct drm_device *dev, |
1603 | struct drm_gem_object *obj, size_t size); | 1603 | struct drm_gem_object *obj, size_t size); |
1604 | int drm_gem_private_object_init(struct drm_device *dev, | 1604 | void drm_gem_private_object_init(struct drm_device *dev, |
1605 | struct drm_gem_object *obj, size_t size); | 1605 | struct drm_gem_object *obj, size_t size); |
1606 | void drm_gem_object_handle_free(struct drm_gem_object *obj); | 1606 | void drm_gem_object_handle_free(struct drm_gem_object *obj); |
1607 | void drm_gem_vm_open(struct vm_area_struct *vma); | 1607 | void drm_gem_vm_open(struct vm_area_struct *vma); |
1608 | void drm_gem_vm_close(struct vm_area_struct *vma); | 1608 | void drm_gem_vm_close(struct vm_area_struct *vma); |