summaryrefslogtreecommitdiff
path: root/drivers/media/video/tiler
AgeCommit message (Collapse)Author
2011-04-07TILER: Add menuconfig and memparse support for cache_limit setting.Lajos Molnar
tiler.cache now can be specified as a memory, such as "40M". Also added TILER_CACHE_LIMIT config to set cache limit in MB. Signed-off-by: Lajos Molnar <molnar@ti.com> Signed-off-by: David Sin <davidsin@ti.com>
2011-04-07TILER: TCM-SiTA: Remove unnecessary copy of width and heightLajos Molnar
tcm struct already contains width and height, and there is no need to copy it into the private data. Signed-off-by: Lajos Molnar <molnar@ti.com> Signed-off-by: David Sin <davidsin@ti.com>
2011-04-07TILER: Correct PAT array allocation error handlingLajos Molnar
Avoid memory leaks if PAT array allocation fails, or if further initializations fail. Signed-off-by: Bryan Wu <bryan.wu@canonical.com> Signed-off-by: David Sin <davidsin@ti.com> Signed-off-by: Lajos Molnar <molnar@ti.com> Signed-off-by: David Sin <davidsin@ti.com>
2011-04-07TILER: TCM-SiTA: Cleaned up tcm_sita code and fixed 1D allocation.Lajos Molnar
Cleaned up comments. Improved optimization for skipping blocks while searching. Rewrote 1D scan algorithm. This is now significantly simpler and to the point, and it also fixed potential incorrect x, y value if the tiler is completely full. Removed unused methods/values, and shortened some unnecessarily long variable names. Signed-off-by: Lajos Molnar <molnar@ti.com> Signed-off-by: David Sin <davidsin@ti.com>
2011-04-07TILER: Cleaned up tcm API definitions.Lajos Molnar
Fixed comments. Removed unused methods. Removed AREA_FMT macro that caused a checkpatch failure. Added further error checking to tcm methods. Signed-off-by: Lajos Molnar <molnar@ti.com> Signed-off-by: David Sin <davidsin@ti.com>
2011-04-07TILER: Simplified dmm.cLajos Molnar
Removed unnecessary type casting. Updated logic to common bitfield setting macro. Removed unnecessary step-by-step register modifications. Signed-off-by: Lajos Molnar <molnar@ti.com> Signed-off-by: David Sin <davidsin@ti.com>
2011-04-07TILER: Cleaned up tmm-pat.cLajos Molnar
Removed unnecessary initializations. Simplified page allocation logic by directly allocating pages instead of going through free_page list. Made page and memory allocation global, so that page cache can be shared between PATs. Now deinitialization logic works with multiple PATs. Signed-off-by: Lajos Molnar <molnar@ti.com> Signed-off-by: David Sin <davidsin@ti.com>
2011-04-07TILER: Clear PAT also when freeing mapped blocksLajos Molnar
PAT was only cleared when freeing allocated blocks, but PAT should be cleared for both situations. Signed-off-by: Lajos Molnar <molnar@ti.com> Signed-off-by: David Sin <davidsin@ti.com>
2011-04-07TILER: TCM-SiTA: Combined fill_1d/2d_areaLajos Molnar
We can treat 1d and 2d areas uniformly using the tcm_for_each_slice macro. Signed-off-by: Lajos Molnar <molnar@ti.com> Signed-off-by: David Sin <davidsin@ti.com>
2011-04-07TILER: Fixed id & physical address handing of tiler_alloc/free.Lajos Molnar
id is now populated by tiler_alloc/map. This is needed for tiler_free to work. id and physical address is cleared on tiler_free. This is needed for tiler_alloc to work if called using the same tiler_block_t structure. Signed-off-by: Lajos Molnar <molnar@ti.com> Signed-off-by: David Sin <davidsin@ti.com>
2011-04-07TILER: Added checks for invalid (0) area allocation.Lajos Molnar
Allocating 0-sized area now fails. Signed-off-by: Lajos Molnar <molnar@ti.com> Signed-off-by: David Sin <davidsin@ti.com>
2011-04-07TILER: fix tilview_rotate that returns invalid addressLajos Molnar
TILER container was rotated opposite from the top-left corner's rotation. This resulted in an incorrect view. This is now fixed. Signed-off-by: Lajos Molnar <molnar@ti.com> Signed-off-by: David Sin <davidsin@ti.com>
2011-04-07TILER: Added tilview_create to create views from a pointer.Lajos Molnar
This circumvents the idea of tilview, but is needed and omap_vout and dss2 cannot currently share a tilview object. Once 2D areas areas are integrated into dss2, this method can be removed. Signed-off-by: Lajos Molnar <molnar@ti.com> Signed-off-by: David Sin <davidsin@ti.com>
2011-04-07TILER: Update file-headers and includesLajos Molnar
Moved tiler_def.h into _tiler.h Updated file headers to include correct file name and copyright notice. Since _tiler.h includes <mach/tiler.h> and "tcm.h", removed these includes from source files. Signed-off-by: Lajos Molnar <molnar@ti.com> Signed-off-by: David Sin <davidsin@ti.com>
2011-04-07TILER: Better abstracted geometric manipulations.Lajos Molnar
Created tiler_view_t to abstract a view on a tiler 2d rectangle. Manipulations include crop, rotate and mirror, and provide access to horizontal and vertical increments to be used by other subsystems. Fixed issue with tiler_ops->xy that returned incorrect x, y coordinates (it returned them thinking of an x & y-mirrored view.) Simplified macro names in tiler-geom.c. Separated ioctl definitions in tiler.h. Signed-off-by: Lajos Molnar <molnar@ti.com> Signed-off-by: David Sin <davidsin@ti.com>
2011-04-07TILER: Fix 1D in-page offset support and QBLK kernel panic.Lajos Molnar
Added missing brackets for handling failing QBLK ioctl. Added 1D in-page offset. Signed-off-by: Lajos Molnar <molnar@ti.com> Signed-off-by: David Sin <davidsin@ti.com>
2011-04-07TILER: Expose physical alignment after MBLK or GBLK.Lajos Molnar
This patch sets the offset and alignment members of the tiler_block_info struct after successful GBLK or MBLK ioctls. This is required to be able to continuosly map multiple blocks if ssptr is not exposed to user space. Signed-off-by: Lajos Molnar <molnar@ti.com> Signed-off-by: David Sin <davidsin@ti.com>
2011-04-07TILER: Add support for in-page offset for buffers.Lajos Molnar
Now that blocks are not necessarily page-aligned, and the physical addresses of blocks are not revealed, the buffer offset has to contain the in-page offset. This patch propagates the in-page offset into the buffer offset and adjusts the buffer size so still only the actual pages are used. It also adjusts the offset lookup to be able to deal with non-aligned buffer offsets and lengths. Signed-off-by: Lajos Molnar <molnar@ti.com> Signed-off-by: David Sin <davidsin@ti.com>
2011-04-07TILER: Limit the amount of pages available in the free page stackDavid Sin
Add logic to cap the total amount of pages to keep on hand. Signed-off-by: David Sin <davidsin@ti.com>
2011-04-07TILER: Move dma_alloc_coherent call to tiler initDavid Sin
Instead of allocating and freeing PAT page array memory each time, allocate 128k upfront and reuse the memory. This will avoid the possibilty of not being able to obtain the memory after driver initialization. Signed-off-by: David Sin <davidsin@ti.com>
2011-04-07TILER: Make URBUF return the length of the buffer unregistered.Lajos Molnar
This is desired so that user-space components need not keep track of the size of the buffer for unmapping. Signed-off-by: Lajos Molnar <molnar@ti.com> Signed-off-by: David Sin <davidsin@ti.com>
2011-04-07TILER: TCM-SiTA: Removed unhandled memory allocation while scanningLajos Molnar
Changed scoring to happen incrementally while scanning. This avoids creating a list of potential positions that may run out of memory. Since we sort positions strictly, we can use an incremental approach. Furthermore, if first position selection is enabled, this reduces the search time. Signed-off-by: Lajos Molnar <molnar@ti.com> Signed-off-by: David Sin <davidsin@ti.com>
2011-04-07TILER: TCM-SiTA: Removed tracking of tiler areas.Lajos Molnar
Since no method requires knowing the list of tiler areas in tcm_sita, the tracking of such has been removed. Signed-off-by: Lajos Molnar <molnar@ti.com> Signed-off-by: David Sin <davidsin@ti.com>
2011-04-07TILER: TCM-SITA: Simplified map handling.Lajos Molnar
Map used to have copies of the parent area in each slot. It also used to have a busy member. This is now replaced with a pointer to the parent area which is set to NULL if not occupied. Also removed reserved member as it was not used. Signed-off-by: Lajos Molnar <molnar@ti.com> Signed-off-by: David Sin <davidsin@ti.com>
2011-04-07TILER: Removed unused get_parent() API from TCM.Lajos Molnar
Since TILER maintains a list of blocks within TCM areas, we do not use this method. Also, this method is only used when looking up blocks by ssptr, which is not used by MemMgr API-s. Originally, this method was provided to optimize this lookup. Signed-off-by: Lajos Molnar <molnar@ti.com> Signed-off-by: David Sin <davidsin@ti.com>
2011-04-07TILER: Removed unnecessary adjustment by TILFMT_8BITLajos Molnar
Since TILFMT_8BIT is not 0, we don't need to adjust array access by tiler format. Signed-off-by: Lajos Molnar <molnar@ti.com> Signed-off-by: David Sin <davidsin@ti.com>
2011-04-07TILER: Removed redundant hardcoded TILER constants.Lajos Molnar
tiler-geom.c now calculates most tiler-geometry related constants, and exposes them to other functions via a tiler_geom structure. Removed unused TILER calculation macros. Signed-off-by: Lajos Molnar <molnar@ti.com> Signed-off-by: David Sin <davidsin@ti.com>
2011-04-07TILER: Removed unused DMM macro definitionsLajos Molnar
Removed unneeded/unused macro definitions. Signed-off-by: Lajos Molnar <molnar@ti.com> Signed-off-by: David Sin <davidsin@ti.com>
2011-04-07TILER: Fixed ioctl handling issues.Lajos Molnar
Added support for NV12 packing decision based on whether container is shared between 8 and 16-bit modes. Fixed mutex handling of QBLK. Simplified mutex handling of QBUF, URBUF. Added support for looking up block info by key & id. RBUF now fills out block info for each mapped block. Signed-off-by: Lajos Molnar <molnar@ti.com> Signed-off-by: David Sin <davidsin@ti.com>
2011-04-07TILER: Use function table for non-static methods.Lajos Molnar
Moved all non-static internal functions into a function table. Also renamed tiler-ioctl.c to tiler-iface.c as it contains multiple external interfaces (file & API). Signed-off-by: Lajos Molnar <molnar@ti.com> Signed-off-by: David Sin <davidsin@ti.com>
2011-04-07TILER: Detailed reorganization of tiler driverLajos Molnar
Moved file operations, buffer/process management and major kernel API-s to tiler-ioctl.c. Moved tiler geometric manipulations to tiler-geom.c. Added wrappers around block manipulations so that other tiler source files can manipulate blocks without needing to share the main tiler mutex. Listed non-static files in tiler-pri.h. Signed-off-by: Lajos Molnar <molnar@ti.com> Signed-off-by: David Sin <davidsin@ti.com>
2011-04-07TILER: Combined dmm and tiler folders and renamed files.Lajos Molnar
Renamed (and moved around) files in preparation for upstreaming activity. Also fixed spacing checkpatch errors that are new since the creation of these files. Signed-off-by: Lajos Molnar <molnar@ti.com>
2011-04-07TILER: Ensure the pat refill has correct data before programming itSantosh Shilimkar
Signed-off-by: David Sin <davidsin@ti.com>
2011-04-07TILER: Added Kconfig support for TILER parameters.Lajos Molnar
The following config options are added: TI_TILER - whether to include TILER module. TILER_SSPTR_ID - whether to use SSPtr as the id TILER_ALIGNMENT - default TILER alignment TILER_GRANULARITY - default TILER granularity TILER_SECURITY - default process security TILER_SECURE - hardwire secure mode TILER_EXPOSE_SSPTR - whether to expose system-space addresses to userspace programs. Signed-off-by: Lajos Molnar <molnar@ti.com>
2011-04-07TILER: Add module parameter support for TILER.Lajos Molnar
Added the following params and default values: tiler.security=y - process security tiler.grain=128 - granularity tiler.align=4096 - default alignment tiler.ssptr_id=n - use ssptr as id tiler.ssptr_lookup=y - allow ssptr lookup tiler.offset_lookup=y - allow offset lookup These last two are provided to check for compatibility as ssptr and offset lookup is planned to be removed. Also fixed an issue with tiler_alloc not accepting a non-0 offset with the default alignment. Signed-off-by: Lajos Molnar <molnar@ti.com>
2011-04-07TILER: Added close to optimal NV12 packing reservation logic.Lajos Molnar
These give the optimal packings for block sizes less than 64 slots wide. Also added reservation ioctls. Signed-off-by: Lajos Molnar <molnar@ti.com> Signed-off-by: David Sin <davidsin@ti.com>
2011-04-07TILER: Added support for partial mmaping of TILER buffersLajos Molnar
Added support for mmapping only a portion of a TILER buffer. Also added helper functions that can be used by other drivers that use TILER to mmap and ioremap portions of TILER blocks. Signed-off-by: Lajos Molnar <molnar@ti.com>
2011-04-07TILER: Added address space support for mmap.Lajos Molnar
Now each TILER buffer occupies a range of the correct size in TILER's mmap memory space (offset + size). Signed-off-by: Lajos Molnar <molnar@ti.com>
2011-04-07TILER: Added key-id enforcement.Lajos Molnar
TILER block lookup is now based on key & id. However, it is still possible to look up a block's key & id based on its system space address. Signed-off-by: Lajos Molnar <molnar@ti.com>
2011-04-07TILER: Update to v2.0 kernel API, remove d2cmap limitationLajos Molnar
Changed tiler_alloc/x, tiler_map/x and tiler_free APIs to use tiler_block_t structure. Simplified tiler_mmap using information in this structure. Now storing and able to reconstruct exact dimension of each allocated tiler block. Fixed issue with virtual stride of 1D buffers when using an offset. Signed-off-by: Lajos Molnar <molnar@ti.com> Signed-off-by: David Sin <davidsin@ti.com>
2011-04-07TILER: Remove tiler_pack_alloc and tiler_pack_alloc_nv12 APIsLajos Molnar
Tiler allocations are autopacked, so these API-s are no longer needed. For more optimal allocations, tiler_reserve and tiler_reserve_nv12 can be used to prereserve these blocks. Signed-off-by: Lajos Molnar <molnar@ti.com>
2011-04-07TILER: Added support for granularity and in-tile offset.Lajos Molnar
Offset was cropped to tile boundaries. Now supporting full offset. Granularity and alignment was combined as the same concept. Now we support (min.) granularity even for larger aligmnents. Granularity is the minimum TILER block size, which could be aligned to a larger alignment value. This prevents allocating too much TILER space in this case. Signed-off-by: Lajos Molnar <molnar@ti.com>
2011-04-07TILER: Simplify _m_add2area parameters.Lajos Molnar
Change x1 (end-x-coord) parameter to width. This simplifies the use of this method with complex starting-x-coordinates. Signed-off-by: Lajos Molnar <molnar@ti.com>
2011-04-07TILER: Add reference count to group info struct.Lajos Molnar
This prevents the situation that a new group info object could be autofreed before the first area is linked to it. Signed-off-by: Lajos Molnar <molnar@ti.com>
2011-04-07TILER: Updated to v2.0 userspace API.Lajos Molnar
This patch requires similar changes in user space API/memmgr header files. Signed-off-by: Lajos Molnar <molnar@ti.com>
2011-04-07TILER: Extend and move SiTA div pointsDavid Sin
Move division point in the container manager to the right most corner, and extend division points to allow for 'zero' and 'container_width'. Signed-off-by: David Sin <davidsin@ti.com>
2011-04-07TILER: Fix rotated tiler address calculation.Lajos Molnar
This resolves incorrect colors on NV12 images, as well as incorrectly rotated images, which may result in DSS OCP_ERR. Signed-off-by: Lajos Molnar <molnar@ti.com>
2011-04-07TILER: Include slab header for kmalloc/kfree callsDavid Sin
slab.h needs to be included in the sources when using kmalloc and kfree for 2.6.34 Signed-off-by: David Sin <davidsin@ti.com>
2011-04-07TILER: Fix klocwork defects in tiler_reservex() and tiler_exit()Lajos Molnar
Signed-off-by: Lajos Molnar <molnar@ti.com> Signed-off-by: David Sin <davidsin@ti.com>
2011-04-07TILER: Fixed issue with tiler_alloc_packed for 16/32-bit buffers.Lajos Molnar
Fixed size calculation for the allocated buffer into which the packing takes place. Tested using V4L2 unit tests and debug prints as only V4L2 uses this function. Signed-off-by: Lajos Molnar <molnar@ti.com> Signed-off-by: David Sin <davidsin@ti.com>