diff options
author | Daniel Vetter <daniel.vetter@ffwll.ch> | 2013-08-14 18:02:30 -0400 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2013-08-18 20:44:58 -0400 |
commit | c1d6798d20eed38b842eee01813ca6c48630d563 (patch) | |
tree | 6dfd50815787b7e69edc49828915254353360eab /drivers/gpu/drm/exynos/exynos_drm_dmabuf.c | |
parent | 2bc7b0ca8cc3bdcf61a7d4a99ed55c4ad084a4ae (diff) |
drm: use common drm_gem_dmabuf_release in i915/exynos drivers
Note that this is slightly tricky since both drivers store their
native objects in dma_buf->priv. But both also embed the base
drm_gem_object at the first position, so the implicit cast is ok.
To use the release helper we need to export it, too.
Cc: Inki Dae <inki.dae@samsung.com>
Cc: Intel Graphics Development <intel-gfx@lists.freedesktop.org>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/exynos/exynos_drm_dmabuf.c')
-rw-r--r-- | drivers/gpu/drm/exynos/exynos_drm_dmabuf.c | 23 |
1 files changed, 1 insertions, 22 deletions
diff --git a/drivers/gpu/drm/exynos/exynos_drm_dmabuf.c b/drivers/gpu/drm/exynos/exynos_drm_dmabuf.c index a0f997e0cbdf..3cd56e16a0ef 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_dmabuf.c +++ b/drivers/gpu/drm/exynos/exynos_drm_dmabuf.c | |||
@@ -127,27 +127,6 @@ static void exynos_gem_unmap_dma_buf(struct dma_buf_attachment *attach, | |||
127 | /* Nothing to do. */ | 127 | /* Nothing to do. */ |
128 | } | 128 | } |
129 | 129 | ||
130 | static void exynos_dmabuf_release(struct dma_buf *dmabuf) | ||
131 | { | ||
132 | struct exynos_drm_gem_obj *exynos_gem_obj = dmabuf->priv; | ||
133 | |||
134 | /* | ||
135 | * exynos_dmabuf_release() call means that file object's | ||
136 | * f_count is 0 and it calls drm_gem_object_handle_unreference() | ||
137 | * to drop the references that these values had been increased | ||
138 | * at drm_prime_handle_to_fd() | ||
139 | */ | ||
140 | if (exynos_gem_obj->base.export_dma_buf == dmabuf) { | ||
141 | exynos_gem_obj->base.export_dma_buf = NULL; | ||
142 | |||
143 | /* | ||
144 | * drop this gem object refcount to release allocated buffer | ||
145 | * and resources. | ||
146 | */ | ||
147 | drm_gem_object_unreference_unlocked(&exynos_gem_obj->base); | ||
148 | } | ||
149 | } | ||
150 | |||
151 | static void *exynos_gem_dmabuf_kmap_atomic(struct dma_buf *dma_buf, | 130 | static void *exynos_gem_dmabuf_kmap_atomic(struct dma_buf *dma_buf, |
152 | unsigned long page_num) | 131 | unsigned long page_num) |
153 | { | 132 | { |
@@ -193,7 +172,7 @@ static struct dma_buf_ops exynos_dmabuf_ops = { | |||
193 | .kunmap = exynos_gem_dmabuf_kunmap, | 172 | .kunmap = exynos_gem_dmabuf_kunmap, |
194 | .kunmap_atomic = exynos_gem_dmabuf_kunmap_atomic, | 173 | .kunmap_atomic = exynos_gem_dmabuf_kunmap_atomic, |
195 | .mmap = exynos_gem_dmabuf_mmap, | 174 | .mmap = exynos_gem_dmabuf_mmap, |
196 | .release = exynos_dmabuf_release, | 175 | .release = drm_gem_dmabuf_release, |
197 | }; | 176 | }; |
198 | 177 | ||
199 | struct dma_buf *exynos_dmabuf_prime_export(struct drm_device *drm_dev, | 178 | struct dma_buf *exynos_dmabuf_prime_export(struct drm_device *drm_dev, |