Commit Graph

8 Commits (0b3e540aa40117561d4dc1e9616f003ec7a8d621)

Author SHA1 Message Date
Maarten Lankhorst 2d1044cc47 omap: Use symbol visibility.
No changes to exported symbols.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
2014-08-14 21:59:18 +02:00
Vincent Penquerc'h 28a13f0be7 omap: release lock also on error paths
Signed-off-by: Rob Clark <rob@ti.com>
2012-10-09 09:41:27 -05:00
Rob Clark 22574aa887 omap: add refcnting and handle tracking
There can be scenarios, especially when re-importing an existing buffer,
where you end up with multiple 'struct omap_bo's wrapping a single GEM
object handle.  Which causes badness when the first of the evil-clones
is omap_bo_del()'d.

To do this, introduce reference counting and a hashtable to track the
handles per fd.

First, to avoid bo's slipping through the crack if multiple 'struct
omap_device's are created for one drm fd, a hashtable mapping drm
fd to omap_device, and the omap_device itself is reference counted.
Per omap_device, we keep a handle_table mapping GEM handle to omap_bo.
When buffers are imported from flink name or dmabuf fd, the handle
table is consulted, and if an omap_bo already exists, it's refcnt is
incremented and it is returned.  For good measure, to avoid the
handle_table being deleted before the omap_bo is freed, the omap_bo
holds a reference to the omap_device.

TODO: check the overhead of the hashtable.  If too much we could maybe
get away with only tracking exported and imported bo's in the table.

TODO: all the import/export flink/dmabuf operations are generic DRM
ioctls.  Really all this functionality could be handled by a generic
drm_bo and drm_device "base class" that could be extended by omap,
exynos, etc.  That would also allow more common userspace code by
avoiding artificial libdrm_omap dependencies.

Signed-off-by: Rob Clark <rob@ti.com>
2012-07-13 16:18:25 -05:00
Rob Clark 42f8a68e19 omap: add API to import bo's from dmabuf fd's
Signed-off-by: Rob Clark <rob@ti.com>
2012-07-13 16:16:46 -05:00
Rob Clark 8116a32df6 omap: clarify dmabuf file descriptor ownership
Signed-off-by: Rob Clark <rob@ti.com>
2012-07-13 16:16:46 -05:00
Rob Clark f00efc7ab4 omap: add dmabuf support
Signed-off-by: Rob Clark <rob@ti.com>
2012-04-11 09:51:36 -05:00
Víctor Manuel Jáquez Leal e98ed38ca9 omap: fix compiler warning
When compiling with linaro toolchain version 4.6.2 got this warning.

  CC     omap_drm.lo
omap_drm.c: In function 'omap_bo_new_impl':
omap_drm.c:139:6: warning: 'bo' may be used uninitialized in this function [-Wuninitialized]

This patch initialize bo to NULL avoiding the warning.

Signed-off-by: Víctor Manuel Jáquez Leal <vjaquez@igalia.com>
Signed-off-by: Rob Clark <rob@ti.com>
2012-04-03 16:47:48 -05:00
Rob Clark ef1b958cc8 omap: add omapdrm support
This adds libdrm_omap helper layer (as used by xf86-video-omap,
omapdrmtest, etc).

Signed-off-by: Rob Clark <rob@ti.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
[danvet: pushed for Rob, he doesn't yet have commit access.]
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2012-03-28 23:00:14 +02:00