aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
Commit message (Collapse)AuthorAge
...
* OMAP: TILER: Pin the correct # of pages to 1D areas.Lajos Molnar2012-08-17
| | | | | | | | We may want to pin less pages to a 1D area than the area size, when we will pre-allocate container areas to map arbitrary 1D memory to (to make it "physically" contiguous.) This patch makes this work. Signed-off-by: Lajos Molnar <molnar@ti.com>
* OMAP: TILER: Separate sub-tiler operations: mem-alloc, area-alloc, pinLajos Molnar2012-08-17
| | | | | | | | | | | | | | | | | | | | | Create common structure to hold memory backing of a tiler area (struct tiler_pa_info). Use this structure in struct mem_info. Separate alloc_block into: 1. area-alloc (alloc_block_area) 2. mem-alloc (get_new_pa) 3. pin (pin_memory) Similarly map_block becomes: 1. get memory backing (user_block_to_pa) 2. area-alloc 3. pin (using already allocated memory) This was in preparation for allowing to pin preallocated memory into tiler, which is now implemented by map_any_block(). Signed-off-by: Lajos Molnar <molnar@ti.com>
* OMAP: TILER: TCM-SITA: Fix bug in 1D area allocationLajos Molnar2012-08-17
| | | | | | | TCM-SiTA allocated 1 page more than necessary for every 1D area allocation. This is now fixed. Signed-off-by: Lajos Molnar <molnar@ti.com>
* TILER: Implement tcm_clear, and initialize TILER containerLajos Molnar2012-08-17
| | | | | | | | | | Implement tcm_clear and initialize TILER container to a blank page. This eliminates problems from reading into an unmapped TILER page that can happen with 3rd party applications. Signed-off-by: Lajos Molnar <molnar@ti.com> Signed-off-by: Andy Gross <andy.gross@ti.com> Signed-off-by: Suman Anna <s-anna@ti.com>
* TILER: Add support for mapping kernel allocated buffers into TILERLajos Molnar2012-08-17
| | | | | | | | | get_user_pages is not effective for kernel allocated buffers. We fall back to tiler_virt2phys() for those. Signed-off-by: Lajos Molnar <molnar@ti.com> Signed-off-by: Mark Tyler <mark.tyler@ti.com> Signed-off-by: Andy Gross <andy.gross@ti.com>
* TILER: Simplify TILIOC_GSSP ioctlSuman Anna2012-08-17
| | | | | | | | Simplify the TILIOC_GSSP ioctl to use the common tiler_virt2phys function Signed-off-by: Lajos Molnar <molnar@ti.com> Signed-off-by: Suman Anna <s-anna@ti.com>
* TILER: Add tiler_virt2phys functionSuman Anna2012-08-17
| | | | | | | | | Move the virt2phys functionality into a common function, and export it so that it can be used by different drivers. Signed-off-by: Lajos Molnar <molnar@ti.com> Signed-off-by: Mark Tyler <mark.tyler@ti.com> Signed-off-by: Suman Anna <s-anna@ti.com>
* TILER: Fix NULL dereference when mapping kernel buffers with map_blockLajos Molnar2012-08-17
| | | | | | | get_user_pages sets page to NULL for kernel allocated buffers, which we dereferenced. This patch fixes this. Signed-off-by: Lajos Molnar <molnar@ti.com>
* TILER: Add missing kfree for pointer elementsAndy Gross2012-08-17
| | | | | | Add missing kfree when cleaning up fast structure Signed-off-by: Andy Gross <andy.gross@ti.com>
* TILER: Include header when using mm_structDavid Sin2012-08-17
| | | | | | | | | | | | | | | | | | Build fails without this when using omap3 defconfig. Signed-off-by: David Sin <davidsin@ti.com> TILER: Use unlocked ioctl Use .unlocked_ioctl and change return value to long Signed-off-by: David Sin <davidsin@ti.com> TILER: Add semi-colon to fix compile error Add semi-colon to fix error: two or more data types in declaration specifiers Signed-off-by: David Sin <davidsin@ti.com>
* TILER: Fix tilview_flip logicLajos Molnar2012-08-17
| | | | | | | | | If TILER view was rotated, the flip logic was incorrectly flipping the view resulting in incorrect top-left coordinate. This is now fixed. Signed-off-by: Lajos Molnar <molnar@ti.com>
* TILER: Notifier callback mechanism for eventsAngela Stegmaier2012-08-17
| | | | | | | | This patch adds a tiler notifier callback mechanism for events. This covers file close events. Signed-off-by: Angela Stegmaier <angelabaker@ti.com> Signed-off-by: David Sin <davidsin@ti.com>
* TILER: Make copy_to_user args consistentDavid Sin2012-08-17
| | | | | | | | | | | | | | | | | | | Signed-off-by: David Sin <davidsin@ti.com> TILER: Use WARN_ON for sita area check We don't want to crash the system, so use WARN_ON instead of BUG_ON. Also, remove some whitespaces in comments. Signed-off-by: David Sin <davidsin@ti.com> TILER: vma flags need not to be set in tiler mmap function vma flags are set by remap_pfn_range function in mmap function, so don't need to set this seperatly in the function. Signed-off-by: Hari Kanigeri <h-kanigeri2@ti.com> Signed-off-by: David Sin <davidsin@ti.com>
* TILER: Cleaned up tiler-iface.c and tiler.h, _tiler.hLajos Molnar2012-08-17
| | | | | | | | | | | | | | | | | | | | | | | | | Updated comments. Simplified common expression when copying ioctl data. Simplified block_info filling. Removed unused variables, initializers, macros. Fixed issue with registering buffer with no blocks. Signed-off-by: Lajos Molnar <molnar@ti.com> Signed-off-by: David Sin <davidsin@ti.com> TILER: Minor comment & code cleanup Updated header comments. Removed extranous headers. Made ssptr_id flag read-only, as it should not be changed once tiler is being used. __analize_area now returns error values. 1D stride is explicitly set to 0 by describe. Signed-off-by: Lajos Molnar <molnar@ti.com> Signed-off-by: David Sin <davidsin@ti.com>
* TILER: Cleaned up tiler-reserve.cLajos Molnar2012-08-17
| | | | | | | | | | | | | | | Fixed formattings. Added comments Standardized method parameter order. Removed can_together flag that is now unneeded. Signed-off-by: Lajos Molnar <molnar@ti.com> Signed-off-by: David Sin <davidsin@ti.com> TILER: Cleaned up tiler-geom.c comments. Signed-off-by: Lajos Molnar <molnar@ti.com> Signed-off-by: David Sin <davidsin@ti.com>
* TILER: Add menuconfig and memparse support for cache_limit setting.Lajos Molnar2012-08-17
| | | | | | | | | 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>
* TILER: Correct PAT array allocation error handlingLajos Molnar2012-08-17
| | | | | | | | | | | 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>
* TILER: TCM-SiTA: Combined fill_1d/2d_areaLajos Molnar2012-08-17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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> TILER: TCM-SiTA: Cleaned up tcm_sita code and fixed 1D allocation. 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> TILER: TCM-SiTA: Remove unnecessary copy of width and height 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> TILER: TCM-SiTA: Simplified scanning code and neighbor stats Only combined neighbor stats are used by algorithm, so we now calculate combined stats. Now passing map to is_area_clear. Also, is_area_clear starts by checking top left corner, so checking whether it is busy is redundant. Removed done variable from scan, and instead exit loop directly. Signed-off-by: Lajos Molnar <molnar@ti.com> Signed-off-by: David Sin <davidsin@ti.com>
* TILER: Cleaned up tmm-pat.cLajos Molnar2012-08-17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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> TILER: Simplified dmm.c 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> TILER: Cleaned up tcm API definitions. 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>
* TILER: Clear PAT also when freeing mapped blocksLajos Molnar2012-08-17
| | | | | | | | 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>
* TILER: Fixed id & physical address handing of tiler_alloc/free.Lajos Molnar2012-08-17
| | | | | | | | | | | | 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>
* TILER: Added checks for invalid (0) area allocation.Lajos Molnar2012-08-17
| | | | | | | Allocating 0-sized area now fails. Signed-off-by: Lajos Molnar <molnar@ti.com> Signed-off-by: David Sin <davidsin@ti.com>
* TILER: fix tilview_rotate that returns invalid addressLajos Molnar2012-08-17
| | | | | | | | 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>
* TILER: Added tilview_create to create views from a pointer.Lajos Molnar2012-08-17
| | | | | | | | | 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>
* TILER: Update file-headers and includesLajos Molnar2012-08-17
| | | | | | | | | | | | | 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>
* TILER: Better abstracted geometric manipulations.Lajos Molnar2012-08-17
| | | | | | | | | | | | | | | | | 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>
* TILER: Fix 1D in-page offset support and QBLK kernel panic.Lajos Molnar2012-08-17
| | | | | | | | | 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>
* TILER: Expose physical alignment after MBLK or GBLK.Lajos Molnar2012-08-17
| | | | | | | | | | | 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>
* TILER: Add support for in-page offset for buffers.Lajos Molnar2012-08-17
| | | | | | | | | | | | | | | | 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>
* TILER: Limit the amount of pages available in the free page stackDavid Sin2012-08-17
| | | | | | Add logic to cap the total amount of pages to keep on hand. Signed-off-by: David Sin <davidsin@ti.com>
* TILER: Move dma_alloc_coherent call to tiler initDavid Sin2012-08-17
| | | | | | | | | 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>
* TILER: Make URBUF return the length of the buffer unregistered.Lajos Molnar2012-08-17
| | | | | | | | 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>
* TILER: TCM-SITA: Simplified map handling.Lajos Molnar2012-08-17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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> TILER: TCM-SiTA: Removed tracking of tiler areas. 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> TILER: TCM-SiTA: Removed unhandled memory allocation while scanning 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>
* TILER: Removed unused DMM macro definitionsLajos Molnar2012-08-17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Removed unneeded/unused macro definitions. Signed-off-by: Lajos Molnar <molnar@ti.com> Signed-off-by: David Sin <davidsin@ti.com> TILER: Removed redundant hardcoded TILER constants. 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> TILER: Removed unnecessary adjustment by TILFMT_8BIT 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> TILER: Removed unused get_parent() API from TCM. 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>
* TILER: Fixed ioctl handling issues.Lajos Molnar2012-08-17
| | | | | | | | | | | | | | | | 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>
* TILER: Use function table for non-static methods.Lajos Molnar2012-08-17
| | | | | | | | | | 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>
* TILER: Detailed reorganization of tiler driverLajos Molnar2012-08-17
| | | | | | | | | | | | | | | | 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>
* TILER: Combined dmm and tiler folders and renamed files.Lajos Molnar2012-08-17
| | | | | | | | 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>
* TILER: Replace dsb calls with wmb for es2.0David Sin2012-08-17
| | | | | | | | | | | | This patch will resolve the data inconsistency problems seen in omap 4 es2.0. For es1.0, we were creating a memory barrier using dsb() around the PAT reg accesses. Additionally, we have added wmb() calls before the call to the PAT refill function to ensure that the data reaches the main memory beforehand. Signed-off-by: David Sin <davidsin@ti.com>
* TILER: Ensure the pat refill has correct data before programming itSantosh Shilimkar2012-08-17
| | | | Signed-off-by: David Sin <davidsin@ti.com>
* TILER: Added Kconfig support for TILER parameters.Lajos Molnar2012-08-17
| | | | | | | | | | | | | | | 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>
* TILER: Add module parameter support for TILER.Lajos Molnar2012-08-17
| | | | | | | | | | | | | | | | | | | 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>
* TILER: Added close to optimal NV12 packing reservation logic.Lajos Molnar2012-08-17
| | | | | | | | | | 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>
* TILER: Added key-id enforcement.Lajos Molnar2012-08-17
| | | | | | | | | | | | | | | | | | | | | | | | 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> TILER: Added address space support for mmap. 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> TILER: Added support for partial mmaping of TILER buffers 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>
* TILER: Update to v2.0 kernel API, remove d2cmap limitationLajos Molnar2012-08-17
| | | | | | | | | | | | | | | | 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>
* TILER: Remove tiler_pack_alloc and tiler_pack_alloc_nv12 APIsLajos Molnar2012-08-17
| | | | | | | | 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>
* TILER: Added support for granularity and in-tile offset.Lajos Molnar2012-08-17
| | | | | | | | | | | | | 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>
* TILER: Simplify _m_add2area parameters.Lajos Molnar2012-08-17
| | | | | | | 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>
* TILER: Add reference count to group info struct.Lajos Molnar2012-08-17
| | | | | | | 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>
* TILER: Updated to v2.0 userspace API.Lajos Molnar2012-08-17
| | | | | | | This patch requires similar changes in user space API/memmgr header files. Signed-off-by: Lajos Molnar <molnar@ti.com>