diff options
author | Seung-Woo Kim <sw0312.kim@samsung.com> | 2013-06-25 21:21:41 -0400 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2013-06-28 00:42:57 -0400 |
commit | ce92e3c9613b51adccaf4d3c04eef53aee981e10 (patch) | |
tree | 3e88075ff8099bc4e4bdd512503fc834e0c4c39c | |
parent | 7d8f06ac901300e0b517a263f571531ca27e47b6 (diff) |
drm/prime: reorder drm_prime_add_buf_handle and remove prototype
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Signed-off-by: YoungJun Cho <yj44.cho@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
-rw-r--r-- | drivers/gpu/drm/drm_prime.c | 30 |
1 files changed, 14 insertions, 16 deletions
diff --git a/drivers/gpu/drm/drm_prime.c b/drivers/gpu/drm/drm_prime.c index 340caabc0424..117ffe32a7af 100644 --- a/drivers/gpu/drm/drm_prime.c +++ b/drivers/gpu/drm/drm_prime.c | |||
@@ -68,7 +68,20 @@ struct drm_prime_attachment { | |||
68 | enum dma_data_direction dir; | 68 | enum dma_data_direction dir; |
69 | }; | 69 | }; |
70 | 70 | ||
71 | static int drm_prime_add_buf_handle(struct drm_prime_file_private *prime_fpriv, struct dma_buf *dma_buf, uint32_t handle); | 71 | static int drm_prime_add_buf_handle(struct drm_prime_file_private *prime_fpriv, struct dma_buf *dma_buf, uint32_t handle) |
72 | { | ||
73 | struct drm_prime_member *member; | ||
74 | |||
75 | member = kmalloc(sizeof(*member), GFP_KERNEL); | ||
76 | if (!member) | ||
77 | return -ENOMEM; | ||
78 | |||
79 | get_dma_buf(dma_buf); | ||
80 | member->dma_buf = dma_buf; | ||
81 | member->handle = handle; | ||
82 | list_add(&member->entry, &prime_fpriv->head); | ||
83 | return 0; | ||
84 | } | ||
72 | 85 | ||
73 | static int drm_gem_map_attach(struct dma_buf *dma_buf, | 86 | static int drm_gem_map_attach(struct dma_buf *dma_buf, |
74 | struct device *target_dev, | 87 | struct device *target_dev, |
@@ -571,21 +584,6 @@ void drm_prime_destroy_file_private(struct drm_prime_file_private *prime_fpriv) | |||
571 | } | 584 | } |
572 | EXPORT_SYMBOL(drm_prime_destroy_file_private); | 585 | EXPORT_SYMBOL(drm_prime_destroy_file_private); |
573 | 586 | ||
574 | static int drm_prime_add_buf_handle(struct drm_prime_file_private *prime_fpriv, struct dma_buf *dma_buf, uint32_t handle) | ||
575 | { | ||
576 | struct drm_prime_member *member; | ||
577 | |||
578 | member = kmalloc(sizeof(*member), GFP_KERNEL); | ||
579 | if (!member) | ||
580 | return -ENOMEM; | ||
581 | |||
582 | get_dma_buf(dma_buf); | ||
583 | member->dma_buf = dma_buf; | ||
584 | member->handle = handle; | ||
585 | list_add(&member->entry, &prime_fpriv->head); | ||
586 | return 0; | ||
587 | } | ||
588 | |||
589 | int drm_prime_lookup_buf_handle(struct drm_prime_file_private *prime_fpriv, struct dma_buf *dma_buf, uint32_t *handle) | 587 | int drm_prime_lookup_buf_handle(struct drm_prime_file_private *prime_fpriv, struct dma_buf *dma_buf, uint32_t *handle) |
590 | { | 588 | { |
591 | struct drm_prime_member *member; | 589 | struct drm_prime_member *member; |