drm/prime: drop reference on imported dma-buf come from gem
authorSeung-Woo Kim <[email protected]>
Thu, 27 Sep 2012 06:30:06 +0000 (15:30 +0900)
committerDave Airlie <[email protected]>
Tue, 8 Jan 2013 04:41:53 +0000 (14:41 +1000)
commitbe8a42ae60addd8b6092535c11b42d099d6470ec
treef8fe5dc8c565f9ad02c7f129bf8ad091a4b0581e
parentf3215be950e40fede0dffb8534729fe0bf410727
drm/prime: drop reference on imported dma-buf come from gem

Increasing ref counts of both dma-buf and gem for imported dma-buf come from gem
makes memory leak. release function of dma-buf cannot be called because f_count
of dma-buf increased by importing gem and gem ref count cannot be decrease
because of exported dma-buf.

So I add dma_buf_put() for imported gem come from its own gem into each drivers
having prime_import and prime_export capabilities. With this, only gem ref
count is increased if importing gem exported from gem of same driver.

Signed-off-by: Seung-Woo Kim <[email protected]>
Signed-off-by: Kyungmin.park <[email protected]>
Cc: Inki Dae <[email protected]>
Cc: Daniel Vetter <[email protected]>
Cc: Rob Clark <[email protected]>
Cc: Alex Deucher <[email protected]>
Cc: stable <[email protected]>
Signed-off-by: Dave Airlie <[email protected]>
drivers/gpu/drm/exynos/exynos_drm_dmabuf.c
drivers/gpu/drm/i915/i915_gem_dmabuf.c
drivers/gpu/drm/nouveau/nouveau_prime.c
drivers/gpu/drm/radeon/radeon_prime.c
drivers/staging/omapdrm/omap_gem_dmabuf.c