diff options
author | Daniel Vetter <daniel.vetter@ffwll.ch> | 2013-08-14 18:02:48 -0400 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2013-08-20 23:00:31 -0400 |
commit | de9564d8b9e69bf6603521e810d3cb46fa98ad81 (patch) | |
tree | 7718486eb076af7fdf55458495181f9f41374204 | |
parent | 838cd4455ee1c76db06175d44319a8e7ac114b0e (diff) |
drm/prime: make drm_prime_lookup_buf_handle static
... and move it to the top of the function to avoid a forward
declaration.
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Dave Airlie <airlied@redhat.com>
-rw-r--r-- | drivers/gpu/drm/drm_prime.c | 29 | ||||
-rw-r--r-- | include/drm/drmP.h | 1 |
2 files changed, 15 insertions, 15 deletions
diff --git a/drivers/gpu/drm/drm_prime.c b/drivers/gpu/drm/drm_prime.c index 5e543e9264d7..ed1ea5c1a9ca 100644 --- a/drivers/gpu/drm/drm_prime.c +++ b/drivers/gpu/drm/drm_prime.c | |||
@@ -83,6 +83,21 @@ static int drm_prime_add_buf_handle(struct drm_prime_file_private *prime_fpriv, | |||
83 | return 0; | 83 | return 0; |
84 | } | 84 | } |
85 | 85 | ||
86 | static int drm_prime_lookup_buf_handle(struct drm_prime_file_private *prime_fpriv, | ||
87 | struct dma_buf *dma_buf, | ||
88 | uint32_t *handle) | ||
89 | { | ||
90 | struct drm_prime_member *member; | ||
91 | |||
92 | list_for_each_entry(member, &prime_fpriv->head, entry) { | ||
93 | if (member->dma_buf == dma_buf) { | ||
94 | *handle = member->handle; | ||
95 | return 0; | ||
96 | } | ||
97 | } | ||
98 | return -ENOENT; | ||
99 | } | ||
100 | |||
86 | static int drm_gem_map_attach(struct dma_buf *dma_buf, | 101 | static int drm_gem_map_attach(struct dma_buf *dma_buf, |
87 | struct device *target_dev, | 102 | struct device *target_dev, |
88 | struct dma_buf_attachment *attach) | 103 | struct dma_buf_attachment *attach) |
@@ -655,20 +670,6 @@ void drm_prime_destroy_file_private(struct drm_prime_file_private *prime_fpriv) | |||
655 | } | 670 | } |
656 | EXPORT_SYMBOL(drm_prime_destroy_file_private); | 671 | EXPORT_SYMBOL(drm_prime_destroy_file_private); |
657 | 672 | ||
658 | int drm_prime_lookup_buf_handle(struct drm_prime_file_private *prime_fpriv, struct dma_buf *dma_buf, uint32_t *handle) | ||
659 | { | ||
660 | struct drm_prime_member *member; | ||
661 | |||
662 | list_for_each_entry(member, &prime_fpriv->head, entry) { | ||
663 | if (member->dma_buf == dma_buf) { | ||
664 | *handle = member->handle; | ||
665 | return 0; | ||
666 | } | ||
667 | } | ||
668 | return -ENOENT; | ||
669 | } | ||
670 | EXPORT_SYMBOL(drm_prime_lookup_buf_handle); | ||
671 | |||
672 | void drm_prime_remove_buf_handle(struct drm_prime_file_private *prime_fpriv, struct dma_buf *dma_buf) | 673 | void drm_prime_remove_buf_handle(struct drm_prime_file_private *prime_fpriv, struct dma_buf *dma_buf) |
673 | { | 674 | { |
674 | mutex_lock(&prime_fpriv->lock); | 675 | mutex_lock(&prime_fpriv->lock); |
diff --git a/include/drm/drmP.h b/include/drm/drmP.h index ce1e6bd30306..5914cc5c3fa6 100644 --- a/include/drm/drmP.h +++ b/include/drm/drmP.h | |||
@@ -1508,7 +1508,6 @@ int drm_gem_dumb_destroy(struct drm_file *file, | |||
1508 | 1508 | ||
1509 | void drm_prime_init_file_private(struct drm_prime_file_private *prime_fpriv); | 1509 | void drm_prime_init_file_private(struct drm_prime_file_private *prime_fpriv); |
1510 | void drm_prime_destroy_file_private(struct drm_prime_file_private *prime_fpriv); | 1510 | void drm_prime_destroy_file_private(struct drm_prime_file_private *prime_fpriv); |
1511 | int drm_prime_lookup_buf_handle(struct drm_prime_file_private *prime_fpriv, struct dma_buf *dma_buf, uint32_t *handle); | ||
1512 | void drm_prime_remove_buf_handle(struct drm_prime_file_private *prime_fpriv, struct dma_buf *dma_buf); | 1511 | void drm_prime_remove_buf_handle(struct drm_prime_file_private *prime_fpriv, struct dma_buf *dma_buf); |
1513 | 1512 | ||
1514 | #if DRM_DEBUG_CODE | 1513 | #if DRM_DEBUG_CODE |