diff options
author | Joonyoung Shim <jy0922.shim@samsung.com> | 2015-08-16 01:15:06 -0400 |
---|---|---|
committer | Inki Dae <inki.dae@samsung.com> | 2015-08-16 01:15:48 -0400 |
commit | c4130bcd6a80f29a5d0cabcef8f0341cfa812dff (patch) | |
tree | ea67287550f10dd570bcfbbe9c75e367de164dd8 | |
parent | 5f3f42664fafa7dd88aee30a2ea77ca45c9362e7 (diff) |
drm/exynos: remove function check_gem_flags
The function check_gem_flags is too simple, so it's better to move codes
in each consumer functions.
Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
-rw-r--r-- | drivers/gpu/drm/exynos/exynos_drm_gem.c | 23 |
1 files changed, 5 insertions, 18 deletions
diff --git a/drivers/gpu/drm/exynos/exynos_drm_gem.c b/drivers/gpu/drm/exynos/exynos_drm_gem.c index d7a687bd0006..a8849ed30a50 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_gem.c +++ b/drivers/gpu/drm/exynos/exynos_drm_gem.c | |||
@@ -20,16 +20,6 @@ | |||
20 | #include "exynos_drm_buf.h" | 20 | #include "exynos_drm_buf.h" |
21 | #include "exynos_drm_iommu.h" | 21 | #include "exynos_drm_iommu.h" |
22 | 22 | ||
23 | static int check_gem_flags(unsigned int flags) | ||
24 | { | ||
25 | if (flags & ~(EXYNOS_BO_MASK)) { | ||
26 | DRM_ERROR("invalid flags.\n"); | ||
27 | return -EINVAL; | ||
28 | } | ||
29 | |||
30 | return 0; | ||
31 | } | ||
32 | |||
33 | static void update_vm_cache_attr(struct exynos_drm_gem_obj *obj, | 23 | static void update_vm_cache_attr(struct exynos_drm_gem_obj *obj, |
34 | struct vm_area_struct *vma) | 24 | struct vm_area_struct *vma) |
35 | { | 25 | { |
@@ -164,6 +154,11 @@ struct exynos_drm_gem_obj *exynos_drm_gem_create(struct drm_device *dev, | |||
164 | struct exynos_drm_gem_buf *buf; | 154 | struct exynos_drm_gem_buf *buf; |
165 | int ret; | 155 | int ret; |
166 | 156 | ||
157 | if (flags & ~(EXYNOS_BO_MASK)) { | ||
158 | DRM_ERROR("invalid flags.\n"); | ||
159 | return ERR_PTR(-EINVAL); | ||
160 | } | ||
161 | |||
167 | if (!size) { | 162 | if (!size) { |
168 | DRM_ERROR("invalid size.\n"); | 163 | DRM_ERROR("invalid size.\n"); |
169 | return ERR_PTR(-EINVAL); | 164 | return ERR_PTR(-EINVAL); |
@@ -171,10 +166,6 @@ struct exynos_drm_gem_obj *exynos_drm_gem_create(struct drm_device *dev, | |||
171 | 166 | ||
172 | size = roundup_gem_size(size, flags); | 167 | size = roundup_gem_size(size, flags); |
173 | 168 | ||
174 | ret = check_gem_flags(flags); | ||
175 | if (ret) | ||
176 | return ERR_PTR(ret); | ||
177 | |||
178 | buf = exynos_drm_init_buf(dev, size); | 169 | buf = exynos_drm_init_buf(dev, size); |
179 | if (!buf) | 170 | if (!buf) |
180 | return ERR_PTR(-ENOMEM); | 171 | return ERR_PTR(-ENOMEM); |
@@ -585,10 +576,6 @@ int exynos_drm_gem_mmap(struct file *filp, struct vm_area_struct *vma) | |||
585 | obj = vma->vm_private_data; | 576 | obj = vma->vm_private_data; |
586 | exynos_gem_obj = to_exynos_gem_obj(obj); | 577 | exynos_gem_obj = to_exynos_gem_obj(obj); |
587 | 578 | ||
588 | ret = check_gem_flags(exynos_gem_obj->flags); | ||
589 | if (ret) | ||
590 | goto err_close_vm; | ||
591 | |||
592 | update_vm_cache_attr(exynos_gem_obj, vma); | 579 | update_vm_cache_attr(exynos_gem_obj, vma); |
593 | 580 | ||
594 | ret = exynos_drm_gem_mmap_buffer(exynos_gem_obj, vma); | 581 | ret = exynos_drm_gem_mmap_buffer(exynos_gem_obj, vma); |