summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/exynos
diff options
context:
space:
mode:
authorDaniel Vetter <daniel.vetter@ffwll.ch>2013-08-15 00:02:30 +0200
committerSeung-Woo Kim <sw0312.kim@samsung.com>2015-02-12 11:26:06 +0900
commit647f620b1bd55f1f3171160b7ded753367e1eeed (patch)
tree744c0a0023f80d4a63ecb9fad7f53941d0cca886 /drivers/gpu/drm/exynos
parent5b0bb04e14723bb3631eafc6b20cb2fba70ed673 (diff)
downloadlinux-3.10-647f620b1bd55f1f3171160b7ded753367e1eeed.tar.gz
linux-3.10-647f620b1bd55f1f3171160b7ded753367e1eeed.tar.bz2
linux-3.10-647f620b1bd55f1f3171160b7ded753367e1eeed.zip
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. Change-Id: I37e9ffec79c90304d444ae9b6c47346f125feb49 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> [This patch is necessary for commit 7f663e197afa drm/prime: proper locking+refcounting for obj->dma_buf link] Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Diffstat (limited to 'drivers/gpu/drm/exynos')
-rw-r--r--drivers/gpu/drm/exynos/exynos_drm_dmabuf.c23
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 c15d81bb201..003c82382eb 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_dmabuf.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_dmabuf.c
@@ -160,27 +160,6 @@ static void exynos_gem_end_cpu_access(struct dma_buf *dmabuf, size_t start,
dir);
}
-static void exynos_dmabuf_release(struct dma_buf *dmabuf)
-{
- struct exynos_drm_gem_obj *exynos_gem_obj = dmabuf->priv;
-
- /*
- * exynos_dmabuf_release() call means that file object's
- * f_count is 0 and it calls drm_gem_object_handle_unreference()
- * to drop the references that these values had been increased
- * at drm_prime_handle_to_fd()
- */
- if (exynos_gem_obj->base.dma_buf == dmabuf) {
- exynos_gem_obj->base.dma_buf = NULL;
-
- /*
- * drop this gem object refcount to release allocated buffer
- * and resources.
- */
- drm_gem_object_unreference_unlocked(&exynos_gem_obj->base);
- }
-}
-
static void *exynos_gem_dmabuf_kmap_atomic(struct dma_buf *dma_buf,
unsigned long page_num)
{
@@ -228,7 +207,7 @@ static struct dma_buf_ops exynos_dmabuf_ops = {
.kunmap = exynos_gem_dmabuf_kunmap,
.kunmap_atomic = exynos_gem_dmabuf_kunmap_atomic,
.mmap = exynos_gem_dmabuf_mmap,
- .release = exynos_dmabuf_release,
+ .release = drm_gem_dmabuf_release,
};
struct dma_buf *exynos_dmabuf_prime_export(struct drm_device *drm_dev,