summaryrefslogtreecommitdiff
path: root/omap
AgeCommit message (Collapse)AuthorFilesLines
2015-08-26omap: Initialize DMA BUF file descriptor to -1Thierry Reding1-0/+1
Commit c86dabfc9f04 ("omap: zero is a valid fd number, treat it as such") corrected checks for valid file descriptors, but the OMAP buffer object code initializes the DMA-BUF file descriptor to 0 (as a result of calloc()'ing the structure). Obviously this isn't going to work because subsequent code will try to use file descriptor 0 (most likely stdin at that point) as a DMA-BUF. It may also try and close stdin when a buffer object is destroyed. Fix this by initializing the DMA-BUF file descriptor to -1, properly marking it as an invalid file descriptor. Fixes: c86dabfc9f04 ("omap: zero is a valid fd number, treat it as such") Reported-by: Robert Nelson <robertcnelson@gmail.com> Tested-by: Robert Nelson <robertcnelson@gmail.com> Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com> Signed-off-by: Thierry Reding <treding@nvidia.com>
2015-07-16omap: zero is a valid fd number, treat it as suchEmil Velikov1-2/+2
Equivalent to the previous patch. Cc: Rob Clark <robdclark@gmail.com> Suggested-by: Thierry Reding <thierry.reding@gmail.com> Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Reviewed-by: Thierry Reding <treding@nvidia.com>
2015-04-28drm: remove drm_public macroEmil Velikov1-18/+18
Some compilers (like the Oracle Studio), require that the function declaration must be annotated with the same visibility attribute as the definition. As annotating functions with drm_public is no longer required just remove the macro. Cc: Ben Skeggs <bskeggs@redhat.com> Cc: Damien Lespiau <damien.lespiau@intel.com> Cc: Maarten Lankhorst <maarten.lankhorst@canonical.com> Cc: Michel Dänzer <michel.daenzer@amd.com> Cc: Rob Clark <robdclark@gmail.com> Cc: Thierry Reding <treding@nvidia.com> Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-04-28drm: remove no longer needed VISIBILITY_CFLAGSEmil Velikov1-1/+0
With earlier commits we've annotated the private symbols, thus we no longer require the -fvisibility=hidden CFLAGS. Cc: Ben Skeggs <bskeggs@redhat.com> Cc: Damien Lespiau <damien.lespiau@intel.com> Cc: Maarten Lankhorst <maarten.lankhorst@canonical.com> Cc: Michel Dänzer <michel.daenzer@amd.com> Cc: Rob Clark <robdclark@gmail.com> Cc: Thierry Reding <treding@nvidia.com> Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-04-28drm: rename libdrm{,_macros}.hEmil Velikov1-1/+1
Provide a more meaningful name, considering what it does. Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-04-28omap: add symbols testEmil Velikov2-0/+38
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-03-20autotools: remove ${srcdir} from the includesEmil Velikov1-1/+0
Already handled by the build system. v2: s/compiler/build system/ Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-08-14omap: Use symbol visibility.Maarten Lankhorst2-20/+27
No changes to exported symbols. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
2012-10-09omap: release lock also on error pathsVincent Penquerc'h1-0/+2
Signed-off-by: Rob Clark <rob@ti.com>
2012-08-23omap: include omap_drm.h independentlyVíctor Manuel Jáquez Leal1-1/+2
omap_drm.h uses data type defined in stdint.h, but that header was not included. omap_drm.h includes drm.h as a local file when it is part of the compiler c flags. This two issues are fixed. New code can include omap_drm.h alone. Signed-off-by: Víctor Manuel Jáquez Leal <vjaquez@igalia.com> Signed-off-by: Rob Clark <rob@ti.com>
2012-07-13omap: add refcnting and handle trackingRob Clark2-26/+126
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-13omap: add API to import bo's from dmabuf fd'sRob Clark2-0/+33
Signed-off-by: Rob Clark <rob@ti.com>
2012-07-13omap: clarify dmabuf file descriptor ownershipRob Clark1-1/+9
Signed-off-by: Rob Clark <rob@ti.com>
2012-04-11omap: add dmabuf supportRob Clark2-0/+22
Signed-off-by: Rob Clark <rob@ti.com>
2012-04-03omap: fix compiler warningVíctor Manuel Jáquez Leal1-1/+1
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-03omap: fix license headerRob Clark1-12/+21
In syncing with the corresponding kernel header, the wrong license header was inadvertantly copied over. The intention was for the userspace headers to have a MIT license following the convention of the rest of libdrm, xorg, etc. Signed-off-by: Rob Clark <rob@ti.com>
2012-03-28omap: add omapdrm supportRob Clark5-0/+529
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>