Tomi Valkeinen d9c148cfaf drm/omap: fix dma_addr refcounting
cec4fa7511ef7a73eb635834e9d85b25a5b47a98 ("drm/omap: use refcount API to
track the number of users of dma_addr") changed omap_gem.c to use
refcounting API to track dma_addr uses.  However, the driver only tracks
the refcounts for non-contiguous buffers, and the patch didn't fully
take this in account.

After the patch, the driver always decreased refcount in omap_gem_unpin,
instead of decreasing the refcount only for non-contiguous buffers. This
leads to refcounting mismatch.

As for the contiguous cases the refcount is never increased, fix this
issue by returning from omap_gem_unpin if the buffer being unpinned is
contiguous.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20191114080343.30704-1-tomi.valkeinen@ti.com
Fixes: cec4fa7511ef ("drm/omap: use refcount API to track the number of users of dma_addr")
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2019-12-04 19:11:28 +02:00
..
2019-10-23 11:14:11 -04:00
2019-07-22 21:24:10 +02:00
2019-07-22 21:24:10 +02:00
2019-07-22 21:24:10 +02:00
2019-07-22 21:24:10 +02:00
2019-12-04 19:11:28 +02:00
2019-07-22 21:24:10 +02:00
2019-07-22 21:24:10 +02:00
2018-03-01 09:09:10 +02:00