aboutsummaryrefslogtreecommitdiffstats
path: root/omap/omap_drm.c
Commit message (Collapse)AuthorAgeFilesLines
* libdrm: omap: Add DRM_RDWR flag to dmabuf exportHemant Hariyani2019-04-251-1/+1
| | | | | | | | | | | | | | | | | | | Allows mmap on dmabuf fd with MAP_SHARED and PROT_WRITE. This fixes boot failures with Android (likely w/ closed source user-space drivers) that were caused due to mmap() returning error. Cc: Sean Paul <seanpaul@chromium.org> Cc: Alistair Strachan <astrachan@google.com> Cc: Marissa Wall <marissaw@google.com> Acked-by: Emil Velikov <emil.velikov@collabora.com> Signed-off-by: Hemant Hariyani <hemanthariyani@ti.com> [picked and updated commitmsg from http://git.ti.com/cgit/cgit.cgi/android/external-libdrm.git/] Signed-off-by: Praneeth Bajjuri <praneeth@ti.com> Signed-off-by: Alistair Strachan <astrachan@google.com> [jstultz: Tweaked commit message] Signed-off-by: John Stultz <john.stultz@linaro.org>
* omap: fix symbol annotationsEric Engestrom2018-09-201-12/+12
| | | | | | | Fixes: f3f7266d94e0354bfd97 "omap: annotate public functions" Cc: Lucas De Marchi <lucas.demarchi@intel.com> Signed-off-by: Eric Engestrom <eric.engestrom@intel.com> Reviewed-by: Lucas De Marchi <lucas.demarchi@intel.com>
* omap: annotate public functionsLucas De Marchi2018-09-191-18/+18
| | | | | | | | | | | | | | | | while read sym; do read f func line _ <<<$(cscope -d -L -1 $sym) if [ ! -z "$f" ]; then sed -i "${line}s/^/drm_public /" $f fi done < /tmp/a.txt In which /tmp/a.txt contains the public symbols from omap-symbol-check. The idea here will be to switch the default visibility to hidden so we don't export symbols we shouldn't. Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com> Acked-by: Eric Engestrom <eric.engestrom@intel.com>
* meson,configure: include config.h automaticallyEric Engestrom2018-03-201-4/+0
| | | | | | | | | This will prevent any more missing `#include "config.h"` bug, at the cost of having to recompile some files that didn't need to be when changing build options. Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com> Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
* omap: Initialize DMA BUF file descriptor to -1Thierry Reding2015-08-261-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>
* omap: zero is a valid fd number, treat it as suchEmil Velikov2015-07-161-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>
* drm: remove drm_public macroEmil Velikov2015-04-281-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>
* drm: rename libdrm{,_macros}.hEmil Velikov2015-04-281-1/+1
| | | | | | Provide a more meaningful name, considering what it does. Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
* omap: Use symbol visibility.Maarten Lankhorst2014-08-141-20/+26
| | | | | | No changes to exported symbols. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
* omap: release lock also on error pathsVincent Penquerc'h2012-10-091-0/+2
| | | | Signed-off-by: Rob Clark <rob@ti.com>
* omap: add refcnting and handle trackingRob Clark2012-07-131-26/+124
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* omap: add API to import bo's from dmabuf fd'sRob Clark2012-07-131-0/+32
| | | | Signed-off-by: Rob Clark <rob@ti.com>
* omap: clarify dmabuf file descriptor ownershipRob Clark2012-07-131-1/+9
| | | | Signed-off-by: Rob Clark <rob@ti.com>
* omap: add dmabuf supportRob Clark2012-04-111-0/+21
| | | | Signed-off-by: Rob Clark <rob@ti.com>
* omap: fix compiler warningVíctor Manuel Jáquez Leal2012-04-031-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>
* omap: add omapdrm supportRob Clark2012-03-281-0/+310
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>