summaryrefslogtreecommitdiff
path: root/freedreno
AgeCommit message (Collapse)AuthorFilesLines
2015-09-19freedreno: debug msg cleanupRob Clark1-2/+2
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2015-09-19freedreno: drop exported dmabuf fd trackingRob Clark4-19/+10
There is really no reason to keep around the fd, it just consumes an extra file handle. Signed-off-by: Rob Clark <robclark@freedesktop.org>
2015-09-19freedreno: don't reuse exported buffersRob Clark1-0/+2
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2015-09-04freedreno: annotate the device/bo/pipe/ringbuffer funcs as const dataEmil Velikov10-12/+12
Cc: freedreno@lists.freedesktop.org Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-09-04freedreno: add API to get drm fd from fd_deviceRob Clark3-0/+7
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2015-09-03freedreno: don't take ownership of the dmabuf fd on importRob Clark1-1/+0
EGL_EXT_image_dma_buf_import specifies that the importer retains ownership of the fd, rather then the importee. Signed-off-by: Rob Clark <robclark@freedesktop.org>
2015-08-31freedreno: serialize drmPrimeFDToHandle under table_lockVarad Gautam1-1/+9
fixes the prime sharing race condition described by "intel: Serialize drmPrimeFDToHandle with struct_mutex". we inline fd_bo_from_handle() into fd_bo_from_dmabuf() and allow locking. Signed-off-by: Varad Gautam <varadgautam@gmail.com> Signed-off-by: Rob Clark <robclark@freedesktop.org>
2015-08-31freedreno: use drmPrime wrappers to import/export prime bo'sVarad Gautam1-12/+7
don't call drmIoctl() directly for prime bo's, use the wrappers instead. v3: remove struct drm_prime_handle and split locking Signed-off-by: Varad Gautam <varadgautam@gmail.com> Signed-off-by: Rob Clark <robclark@freedesktop.org>
2015-08-23freedreno: get bo size for imported dma-bufVarad Gautam1-2/+3
Signed-off-by: Varad Gautam <varadgautam@gmail.com> Signed-off-by: Rob Clark <robclark@freedesktop.org>
2015-08-23freedreno: fill bo->fd when importingVarad Gautam1-1/+5
Signed-off-by: Varad Gautam <varadgautam@gmail.com> Signed-off-by: Rob Clark <robclark@freedesktop.org>
2015-08-23freedreno: fix a bo cache segfault with imported bo'sVarad Gautam1-0/+3
Importing a bo whose handle is still in the bo cache crashes during cleanup. Remove bo from cache when importing. Signed-off-by: Varad Gautam <varadgautam@gmail.com> Signed-off-by: Rob Clark <robclark@freedesktop.org>
2015-08-18freedreno: update freedreno-symbol-checkRob Clark1-0/+1
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2015-08-17freedreno: add fd_pipe_wait_timeout()Rob Clark7-9/+20
We need to pass through a timeout parameter to implement pipe->fence_finish() properly. Signed-off-by: Rob Clark <robclark@freedesktop.org>
2015-08-17freedreno/msm: dump out submit info on errorRob Clark1-1/+19
User should only see these with LIBGL_DEBUG=verbose. But in case you are hitting issues like "handle X at index Y already on submit list" errors from the kernel, this gives some useful visibility for debug. Signed-off-by: Rob Clark <robclark@freedesktop.org>
2015-08-17freedreno/msm: fix issue where same bo is on multiple ringsRob Clark3-29/+58
It should be a less common case, but it is possible for a single bo to be on multiple rings, for example when sharing a buffer across multiple pipe_context's created from same pipe_screen. So rather than completely fall over in this case, fallback to slow-path of looping over all bo's in the ring's bo-table (but retain the fast- path of constant-lookup for the first ring the buffer is on). Signed-off-by: Rob Clark <robclark@freedesktop.org>
2015-08-17freedreno/msm: reorg ringbuffer structRob Clark1-39/+44
Group the parts related to building out submit ioctl into their own sub-struct. Split out from next commit since it is just boring churn. Signed-off-by: Rob Clark <robclark@freedesktop.org>
2015-08-05drm: consolidate common list implementations (v2)Alex Deucher3-140/+2
This is used by radeon and freedreno and will be used by amdgpu. I looked at switching to libdrm_lists.h, but it's pretty horrible. E.g., DRMLISTFOREACHENTRYSAFE. v2: remove missed list.h from tests/radeon/Makefile.am Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2015-07-16freedreno: zero is a valid fd number, treat it as suchEmil Velikov4-4/+6
Abeit quite unlikely to get hit by this bug here, let just fix it. v2: Correct conditional (do not call ioctl(DRM_IOCTL_PRIME_HANDLE_TO_FD) when we already have the fd). v3: Fix kgsl_pipe.c, suggested by Thierry. Cc: freedreno@lists.freedesktop.org Cc: Rob Clark <robdclark@gmail.com> Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Reviewed-by: Thierry Reding <thierry.reding@gmail.com>
2015-04-29freedreno: link against CLOCK_LIBEmil Velikov1-1/+4
Required by clock_gettime() Cc: Rob Clark <robdclark@gmail.com> Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-04-28drm: remove drm_public macroEmil Velikov5-35/+35
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-28freedreno: add symbols testEmil Velikov2-1/+54
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-04-28freedreno: annotate the private symbolsEmil Velikov13-42/+54
They are less and easier to track than the public ones. The macro drm_public will be going away by the end of the series. Cc: Rob Clark <robdclark@gmail.com> 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>
2015-03-20android: remove LOCAL_COPY_HEADERS* variablesEmil Velikov1-3/+0
With earlier changes we've implicitly add the relevant directories to the includes list, via LOCAL_EXPORT_C_INCLUDES_DIRS. v2: Update the top Android.mk as well. Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-03-20android: remove ${srcdir} from the includesEmil Velikov1-3/+0
Already handled by the build system. v2: s/compiler/build system/. Spotted by Chih-Wei. Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-03-20android: simplify LOCAL_C_INCLUDESEmil Velikov1-3/+1
Each of the libdrm_${hw} modules pull libdrm for linking as such: libdrm's LOCAL_EXPORT_C_INCLUDE_DIRS are added to the includes list. The former of which is already set to ${top} and ${top}/include/drm. Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-03-20android: correcly set LOCAL_EXPORT_C_INCLUDE_DIRSEmil Velikov1-2/+1
- Don't add ${hw}/${hw}, but ${hw} to the includes path. The former does not exist. - Set the variable for libkms. Inspired by the work of from Chih-Wei from the Android-x86 project. Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-02-23android: remove duplicate libdrm in LOCAL_SHARED_LIBRARIESChih-Wei Huang1-3/+0
v2: Fold libpciaccess and libdrm into a single local_shared_libraries Acked-by: Jan Vesely <jan.vesely@rutgers.edu> Signed-off-by: Chih-Wei Huang <cwhuang@linux.org.tw> Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-01-18configure/freedreno: make KGSL support optionalRob Clark3-11/+18
libdrm_freedreno currently supports two backends, 'msm' for the upstream drm/msm driver, and 'kgsl' which supports (to some extent), the android/ downstream kgsl driver plus a sort of drm shim nonsense to get flink names. However, kgsl support is strictly on a best-effort basis. Different android devices with different versions of kgsl may have different abi's. And the existing kgsl interface (at least the parts of it that we use) is completely broken for 64bit. Lets disable it by default lest anyone actually try to use it. Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-11-18freedreno: do handle lookup on handle and dmabuf importRob Clark1-0/+7
We also need to check handle_table in the _from_handle() path and the _from_dmabuf() (which goes through _from_handle()) to avoid duplicate imports. Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-09-28fix compile error on 32bit systemsRob Clark12-0/+48
4c2766b (drm_mmap/drm_unmap) brought this error for every .c file that was not #including config.h: In file included from private.h:4:0, from abi16.c:29: ../libdrm.h: In function 'drm_munmap': ../libdrm.h:81:4: error: size of unnamed array is negative Signed-off-by: Rob Clark <robdclark@gmail.com>
2014-09-28freedreno: use drm_mmap/drm_munmap wrappersEmil Velikov4-6/+5
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
2014-09-28automake: pick up all files for distribution.Emil Velikov1-0/+2
Autotools is already smart enough to pick the *.pc.in files but it needs some help with the Android.mk ones. Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
2014-09-21freedreno: add dmabuf import/export helpersRob Clark3-0/+46
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-09-01freedreno: fd_bo_from_handle() remove duplicate declarationEmil Velikov1-3/+0
Already declared in our public header freedreno_drmif.h Cc: Rob Clark <robclark@freedesktop.org> Cc: freedreno@lists.freedesktop.org Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Acked-by: Rob Clark <robclark@freedesktop.org>
2014-09-01freedreno: add Android build supportEmil Velikov1-0/+30
v2 Rename the headers variable(s) to *_H_FILES. Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-09-01libdrm, freedreno, intel, nouveau, radeon: add Makefile.sourcesEmil Velikov2-21/+27
Will be used to consolidate the required sources lists as well as the install-able headers. This is turn will help us to avoid the duplication with the upcoming Android build support. v2: Rename the headers variable to *_H_FILES. v3: Rebase on top of symbol visibility patches. Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-08-14freedreno: Use symbol visibility.Maarten Lankhorst7-42/+51
Hiding fd_device_del_locked, and fd_cleanup_bo_cache. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
2014-06-18freedreno: add chip-id propertyRob Clark4-0/+10
Userspace needs to know the patch-revision in addition to just the gpu-id (ie. 320, 305, etc). Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-06-18freedreno: sync kernel headerRob Clark1-0/+12
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-04-25freedreno: add missing fxn prototypeRob Clark1-0/+2
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-03-19freedreno: zero out unused fieldRob Clark1-0/+1
Since realloc() doesn't zero-init. Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-03-16freedreno: do not leak drmVersionEmil Velikov1-0/+1
Cc: Rob Clark <robclark@freedesktop.org> Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Reviewed-by: Rob Clark <robdclark@gmail.com> Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-03-05freedreno/kgsl: don't even bother trying CREATE_FDRob Clark1-12/+4
Don't even bother trying DRM_KGSL_GEM_CREATE_FD. It hasn't worked since (afaict) 2.6.35 kernels. And in some cases seems to cause some problems. Instead just allocate a minimum size dummy object (just for purposes of having a handle) and then mmap the framebuffer as user-mem (which is deprecated, but seems to still work.. and as far as I can tell is the best option for now). Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-03-05freedreno: fix null ptr in error pathRob Clark1-1/+2
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-03-05freedreno: simplify device creationRob Clark2-27/+1
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-02-19freedreno: some msm-ring reset/flush fixesRob Clark3-9/+35
Need to update timestamp on all ring's associated with a submit (ie. both the binning pass and main ring). Also, make sure nr_reloc's in particular gets cleared if the rb is reset. Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-01-31freedreno: fix licenseRob Clark1-9/+16
The userspace headers were intended to be BSD license. Signed-off-by: Rob Clark <robclark@freedesktop.org>