Commit message (Collapse)AuthorAgeFilesLines
* libdce[LINUX] : Mutex protection support and other bug fixesBuddy Liong2015-05-051-16/+16
| | | | | | | | | | | | | | | | | | | * The dce_init/dce_deinit APIs can be called multiple times by applications. This is called from multiple thread contexts in the viddec3test and is also invoked several times by the GStreamer framework. * But certain init functions and deinit operations need to be done only on the first and last calls of the respective APIs. * Additionally, according the pthread documentation we need to use **either** the PTHREAD_MUTEX_INITIALIZER or the pthread_mutex_init APIs with the attribs * The protection for the dce_init with the ref count mechanism is additionally needed for the mutex initialization because if this is not done conditionally (for the first dce_init) sequence, the subsequent call to this API would actually reinit the mutex value and cause the new thread sequence to acquire the same. Change-Id: I2d129a2b030a25c4e8c5f621abf05d68562db6b8 Signed-off-by: Karthik Ramanan <a0393906@ti.com> Signed-off-by: Buddy Liong <buddy.budiono@ti.com>
* libdce[Linux]: Add mutex protection for dce_buf_lock/dce_buf_unlockSunita Nadampalli2015-04-271-0/+28
| | | | | | | | | | | | The dce_buf_lock and dce_buf_unlock are meant for any video buffer locking and unlocking with the GEM allocator. Currently, these methods are being called from libdce apis with ipc mutex held. In order to enable other media components to make use of these buffer lock/unlock apis, explicit ipc mutex protection is added. Change-Id: Ibb4976120e5dfe6f88b42359655a460cafc223ac Signed-off-by: Sunita Nadampalli <sunitan@ti.com>
* [Fix] Support Multiplanar encoder input buffers3.00.07.00Pradeep Venkatasubbarao2014-11-271-1/+1
| | | | | | | | | | An earlier patch to enable Single planar buffers for encoder broke the multiplanar support. This patch fixes this issue. Change-Id: Ide169a43b3df915a969a401e623fdad7f8792faf Signed-off-by: Pradeep Venkatasubbarao <pradeepv@ti.com>
* [LINUX] Manage Tiler Pinning for dce DRM buffersPradeep Venkatasubbarao2014-03-251-4/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Applications using dce_alloc/dce_free calls to manage memory, leaked memory because on non-closure of the created dmabuf fds. Additionally, all memory allocated from Tiler/DMM via DRM need to be explictly pinned to tiler using dce_buf_lock/dce_buf_unlock calls. Hence in the earlier implementation, every call to dce_alloc/free had to be followed by a lock/unlock call to pin/unpin it to tiler. In order, to insulate the applications from the internal details of DRM memory management and for ease of use of alloc and free calls, dce_alloc now takes care of creating the dmabuf and pinning it to tiler while dce_free takes care of tiler unpinning and closure of dmabuf fd. Applications can continue to use dce_alloc and dce_free calls as before thus maintiaining backward compatibility. On the other hand, since the same interfaces are used for multiple remote core targets, like IPU and DSP, MemHeader struture is upgraded to hold the core for which the block of memory belongs to, to keep track of the core. Hence all applications/Remote cores using this version of libdce should recompile with the new MemHeader for proper functioning. Dependent IPUMM patch: https://gerrit.ext.ti.com/gerrit/omap/#/c/12994/ Change-Id: If09a1039b5b16f3cc5ff0e9c6c598932d8a2ce3e Signed-off-by: Pradeep Venkatasubbarao <pradeepv@ti.com> Signed-off-by: Amarinder Bindra <a-bindra@ti.com> Signed-off-by: Karthik Ramanan <a0393906@ti.com>
* [DSP]Added duplicate functions for buffer lock and unlock.Pradeep Venkatasubbarao2013-12-061-3/+56
| | | | | | | | | | | | | | This is required temporarily as there is no other way to get the core index.dce_buf_lock and unlock functions expects MmRpcHandle and now as there are separate handles for DSP and IPU, to avoid modifying these APIs, duplicate functions have been created coreIndex is hardcoded. Added prototypes of dsp specific lock and unlock functions in libdce.h Change-Id: I360632acd061f9e134c38bea009b1ad257e32bb8 Signed-off-by: Pradeep Venkatasubbarao <pradeepv@ti.com>
* Add check for ownership for file descriptorAmarinder Bindra2013-09-271-2/+12
| | | | | | | | | | | | Currently, the dce_deinit function deletes the file descriptor(fd) that it uses for allocation of the buffers even if it has not created it. This adds a check where it only deletes the fd only when the ownership of fd is with libdce else it only deletes th device which it uses. Also, add a check where the dce_set_fd sets the fd only if the drm device fd is not already set to avoid memory leak. Change-Id: Ie5e23f06a5d171f2c06f4bebb64b040915e71153 Signed-off-by: Amarinder Bindra <a-bindra@ti.com>
* [Linux] fixed an unreachable statementChandramohan2013-09-271-1/+1
| | | | | | | | | | | | | | Applications can optionally communicate the drm FD to libdce using dce_set_fd before calling dce_init. In such cases dce_init will not open a new DRM file descriptor. But for applications not using this option, libdce will create a new fd for its use in dce_alloc. The drmOpen call was unreachable in such cases and hence there was an invalid handle. This patch fixes this issue of an unreachable statement in dce_init Change-Id: I4758416a7d34fff873c280f7583c05c1640c312b Signed-off-by: Chandramohan <chandramohan.c@ti.com> Signed-off-by: Amarinder Bindra <a-bindra@ti.com>
* [LIBDCE] Trace and Comments cleanup3.00.03.00Saurabh Bipin Chandra2013-09-131-2/+2
| | | | | | | | | This patch: 1. replaces printf with trace MACROS. 2. Remove unwanted comments. Change-Id: Id137603cbe947ca371550f594fc249d2f1b1410b Signed-off-by: Saurabh Bipin Chandra <a0131926@ti.com>
* [LINUX] Fix for memory allocation/free in buf_lock/unlockSaurabh Bipin Chandra2013-09-131-2/+8
| | | | | | | | | | This patch makes the following changes within dce_buf_lock/unlock: 1. Changes API of memory allocation from memplugin_alloc to malloc as Tiler/Shared memory is not needed 2. Frees the allocated memory at EXIT from function. Change-Id: Id728abad86d4582f0e904f4c8680e99d47cb3a0a Signed-off-by: Saurabh Bipin Chandra <a0131926@ti.com>
* [LIBDCE] update memplugin headers and apisSunita Nadampalli2013-09-131-2/+2
| | | | | | | | memheader and memplugin apis are extended to meet the requirements for mem allocations/free/share for all OSes. Change-Id: Ide911d1654ccd0807ace37de9576299cbb860d07 Signed-off-by: Sunita Nadampalli <sunitan@ti.com>
* [LINUX] Fix for make installSathishkumar2013-09-051-4/+6
| | | | | | | | | | | | This patch fixes make install. All the required headers are copied to $(includedir)/dce on make install. Unused variables(X11 and WAYLAND) are removed in Makefile.am and pkg-config on libmmrpc is removed as no libmmrpc.pc is available. xdc_target_types__=gnu/targets/std.h is added to libdce.h, so that applications need not do it when using libdce.h. Change-Id: I8cc70aa2102becdbdc4c6b1e38e2aaa91739c4cc Signed-off-by: Sathishkumar <x0203598@ti.com>
* [LINUX] Moving Linux specific functions to new c fileSaurabh Bipin Chandra2013-09-051-0/+133
This patch moves Linux specific functions to libdce_linux.c. It also takes in the DRM Initialization cleanup changes in dce_init from: https://gerrit.ext.ti.com/gerrit/omap/#/c/12888 Change-Id: I570341c8dfbe1d120bc89071a86020b6ba5d4cac Signed-off-by: Saurabh Bipin Chandra <a0131926@ti.com>