rpmsg:rpmsg.git
6 years agoomap: remoteproc: remove the iommu clk temporary workaround
Suman Anna [Fri, 3 Jun 2011 01:55:13 +0000 (20:55 -0500)]
omap: remoteproc: remove the iommu clk temporary workaround

iommu module has been enhanced to use the hwmod framework,
and does not use any clock api directly. This patch removes
the relevant temporary workarounds in the remoteproc code.

Signed-off-by: Suman Anna <s-anna@ti.com>
6 years agoomap: iommu: adapt to hwmod implementation
Hari Kanigeri [Fri, 30 Jul 2010 16:15:04 +0000 (11:15 -0500)]
omap: iommu: adapt to hwmod implementation

This patch adapts iommu to hwmod implementation for OMAP4.
Work needs to be done for OMAP3.

Signed-off-by: Hari Kanigeri <h-kanigeri2@ti.com>
Signed-off-by: Suman Anna <s-anna@ti.com>
6 years agoomap: iommu: remove clock functions from iommu module
Ramesh Gupta Guntha [Tue, 29 Jun 2010 23:36:32 +0000 (18:36 -0500)]
omap: iommu: remove clock functions from iommu module

This patch removes the clk_enable/disable functions for
iommu functions, module auto idle should take care
of this.

Signed-off-by: Ramesh Gupta G<grgupta@ti.com>
Signed-off-by: Suman Anna <s-anna@ti.com>
6 years agoomap4: clockdomain: enable forced wakeup and sleep for ipu & dsp
Suman Anna [Fri, 3 Jun 2011 20:32:12 +0000 (15:32 -0500)]
omap4: clockdomain: enable forced wakeup and sleep for ipu & dsp

This setting is required for bringing Ducati/Tesla out of reset. Without
this, the corresponding clocks are not getting enabled.

Signed-off-by: Hari Kanigeri <h-kanigeri2@ti.com>
Signed-off-by: Suman Anna <s-anna@ti.com>
6 years agoomap4: hwmod: changes to add address space for MMU
Hari Kanigeri [Wed, 28 Jul 2010 16:47:42 +0000 (11:47 -0500)]
omap4: hwmod: changes to add address space for MMU

This patch adds the address space changes for DSP and IPU MMU in OMAP4

Signed-off-by: Hari Kanigeri <h-kanigeri2@ti.com>
Signed-off-by: Suman Anna <s-anna@ti.com>
Signed-off-by: Benoit Cousson <b-cousson@ti.com>
Signed-off-by: Cris Jansson <cjansson@ti.com>
6 years agoomap4: Kconfig: select ipc/omx modules by default
Suman Anna [Wed, 25 May 2011 01:41:10 +0000 (20:41 -0500)]
omap4: Kconfig: select ipc/omx modules by default

This patch enables the required IPC and OMX modules by default
so that application developers need not select these.

Signed-off-by: Suman Anna <s-anna@ti.com>
6 years agoomap4: Kconfig: reduce dynamic carveout memory
Suman Anna [Wed, 25 May 2011 01:29:39 +0000 (20:29 -0500)]
omap4: Kconfig: reduce dynamic carveout memory

Reduce the dynamica carveout memory from 51MB to 7MB
since most of the Ducati memory is coming from bootargs.

The Dynamic carveout will be used by IPC and Code sections
only for now.

Signed-off-by: Suman Anna <s-anna@ti.com>
6 years agoomap4: remoteproc: program additional l3 addresses into ducati iommu
Suman Anna [Fri, 6 May 2011 01:46:52 +0000 (20:46 -0500)]
omap4: remoteproc: program additional l3 addresses into ducati iommu

Additional L3 addresses such as TILER, IVAHD SL2 and config space,
L4 PER region are mapped into the Ducati MMU to enable MM usecases.

The memory mapped for the data sections of the Ducati image have
been increased to allow MM Camera integration.

Signed-off-by: Suman Anna <s-anna@ti.com>
6 years agorpmsg: add client and server sample drivers
Ohad Ben-Cohen [Fri, 21 Jan 2011 00:19:01 +0000 (02:19 +0200)]
rpmsg: add client and server sample drivers

Add RPMSG sample drivers that demonstrate both client and server
functionality.

Both drivers repeatedly send across a "Hello World!" message to the remote processor.

Once probed, the drivers can immediately start using the rpmsg_send()
and rpmsg_sendto() API, without having to worry about creating endpoints
or allocating rpmsg addresses: all that information is already embedded
in the rpmsg channel that the driver is probed with.

Note: the inherent difference between servers and clients is, that
client drivers are probe()ed with a channel that has an rpmsg destination
address, and therefore they can immediately start using rpmsg_send()
to communicate with their remote service. OTOH, server drivers are not
bound to a specific destination address, and therefore must use the
rpmsg_sendto() API to explicitly indicate the dst address every time they
send a message.

Another difference is that the local address of server drivers is
predefined (currently, at least). The local address of client drivers,
OTOH, is dynamically allocated by the rpmsg bus as soon as they probe().

Change-Id: Ib938b573ec798e1cad1eccb50832d6dc379a0e50
Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>
6 years agorpmsg: support TILER buffer address translation
Suman Anna [Fri, 6 May 2011 03:23:41 +0000 (22:23 -0500)]
rpmsg: support TILER buffer address translation

Support user space virtual address to ducati address translation
for TILER buffers in the rpmsg OMX driver.

Signed-off-by: Aditya Monga <admonga@ti.com>
Signed-off-by: Suman Anna <s-anna@ti.com>
6 years agoomap4: Kconfig: select mailbox by default for rpmsg
Suman Anna [Fri, 27 May 2011 00:22:21 +0000 (19:22 -0500)]
omap4: Kconfig: select mailbox by default for rpmsg

The rpmsg driver has a dependency on omap mailbox driver, and so
mailbox driver should be built in by default.

Signed-off-by: Suman Anna <s-anna@ti.com>
6 years agoSend OMX instance endpoint with OMX_DISCONNECT msg to service mgr.
G Anthony [Fri, 6 May 2011 20:35:01 +0000 (13:35 -0700)]
Send OMX instance endpoint with OMX_DISCONNECT msg to service mgr.

Signed-off-by: G Anthony <a0783926@ti.com>
6 years agorpmsg: add OMX driver
Ohad Ben-Cohen [Mon, 21 Mar 2011 11:38:21 +0000 (13:38 +0200)]
rpmsg: add OMX driver

Add an rpmsg OMX driver, which enables user space to offload
cpu-intensive multimedia tasks to OMX instances running on remote
processors.

The current driver is a raw skeleton: it supports connecting to (and by
that, creating) remote OMX instances, and sending and receiving raw
messages from them, but there's no OMX API knowledge yet, no buffer
management, and no per-connection resource tracking and cleaning up.

The goal of this driver is to demonstrate rpmsg usage and the life
cycle (and usage) of local/remote rpmsg addresses while allowing
creation of, and connection to multiple remote OMX instances, while
only enabling a strict point-to-point communications between user space
and those OMX components.

Change-Id: I2162620d6da0b615bd4e28e6ca783888b50296a9
Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>
6 years agoomap: fix random meta-iommu issues
Guzman Lugo, Fernando [Wed, 20 Apr 2011 07:40:27 +0000 (10:40 +0300)]
omap: fix random meta-iommu issues

Fixes the Kconfig and Makefile to not tristate omap iommu support (make it bool
instead).  Changes the clock from ducati_ick to ipu_fck.

Change-Id: I80ac067ad2d604d50fb373245bd1d8b9acccd6f5
Signed-off-by: Guzman Lugo, Fernando <fernando.lugo@ti.com>
6 years agoomap:iommu-dmm fixes
Hari Kanigeri [Mon, 16 Aug 2010 20:59:03 +0000 (15:59 -0500)]
omap:iommu-dmm fixes

This fixes the following:
  1. pgd and pte entries weren't getting flushed out leading to MMU faults.
  2. Cache invalidate was setting wrong size parameter to
     memory_regain_ownership leading cache invalidate function to fail.

Change-Id: I7ab72956325b0de6c58ffa7796c6f8a061793d14
Signed-off-by: Hari Kanigeri <h-kanigeri2@ti.com>
6 years agoomap:iommu-added cache flushing operation for L2 cache
Ramesh Gupta [Wed, 4 Aug 2010 02:18:41 +0000 (21:18 -0500)]
omap:iommu-added cache flushing operation for L2 cache

Change-Id: I6e22cc125daf84a23a9a07d68e696390e64f5c75
Signed-off-by: Ramesh Gupta <grgupta@ti.com>
Signed-off-by: Hari Kanigeri <h-kanigeri2@ti.com>
Signed-off-by: Iliyan Malchev <malchev@google.com>
6 years agoomap: add rpmsg backend virtio device
Ohad Ben-Cohen [Thu, 20 Jan 2011 23:28:16 +0000 (01:28 +0200)]
omap: add rpmsg backend virtio device

Add an rpmsg device that wires virtio to the OMAP mailbox and
enabled A9<->M3 communications.

Use the mailbox payload to indicate which of the virtqueues is
triggered. In addition, a simpler STATE_CHANGE mode is also
supported.

Map the two vrings and the IPC buffers as noncacheable; use
dynamically carved-out physical memory for that (still not using the
resource table though).

Change-Id: I85e5765a147eb56507395776b5d92b38c137bfb5
Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>
6 years agodrivers: introduce rpmsg, a remote-processor messaging virtio bus
Ohad Ben-Cohen [Fri, 21 Jan 2011 00:03:59 +0000 (02:03 +0200)]
drivers: introduce rpmsg, a remote-processor messaging virtio bus

Add a virtio IPC bus, which enables kernel users to communicate
with remote processors over shared memory using a simple messaging
protocol.

Assign a local address for every local endpoint that is created,
and bind it to the user's callback. Invoke that callback when a message
is received carrying the user's address as the destination addr.

Change-Id: I0c6804859c2344bdddd433075d4116d88eea67e4
Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>
6 years agoomap: add remoteproc devices
Guzman Lugo, Fernando [Wed, 20 Apr 2011 09:58:22 +0000 (12:58 +0300)]
omap: add remoteproc devices

Add omap remoteproc devices for the ipu and dsp remote processors.

Change-Id: I36a73ecc75f646ac33cc125e476d5b7badab3a8b
[ohad@wizery.com: refactored and simplified, can reduce mem maps even further]
Signed-off-by: Guzman Lugo, Fernando <fernando.lugo@ti.com>
Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>
6 years agoomap: add carveout memory support for remoteproc
Ohad Ben-Cohen [Wed, 20 Apr 2011 09:53:32 +0000 (12:53 +0300)]
omap: add carveout memory support for remoteproc

Temporary patch to enable carveout memory support for remoteproc.

Cleanme: carveout memory code should be better consolidated with TIDSPBRIDGE.

Change-Id: I84f0099c3589383c741b0095d4222b496b3836d6
Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>
6 years agoremoteproc: add omap implementation
Guzman Lugo, Fernando [Wed, 20 Apr 2011 07:59:34 +0000 (10:59 +0300)]
remoteproc: add omap implementation

Add remoteproc implementation for OMAP4, to be able to load the remote
dual M3 and DSP processors.

Still needs some clean ups here.

Based on code by Hari Kanigeri <h-kanigeri2@ti.com>

Change-Id: I479553ed58d27ca771f9ce3c60608e8eaab89963
Signed-off-by: Guzman Lugo, Fernando <fernando.lugo@ti.com>
[ohad@wizery.com: refactored and simplified, still wip]
Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>
6 years agodrivers: add generic remoteproc framework
Ohad Ben-Cohen [Tue, 19 Apr 2011 16:24:52 +0000 (19:24 +0300)]
drivers: add generic remoteproc framework

Some systems are equipped with slave heterogeneous remote processor
devices, that are usually used to offload cpu-intensive computations
(e.g. multimedia codec tasks).

Introduce a generic remoteproc framework that allows drivers to start
and stop those remote processor devices, load up their firmware (which
might not necessarily be Linux-based), and in the future also manage
their runtime PM status, recovery, and any other relevant
configuration/states.

Firmware loader is based on code by Mark Grosen <mgrosen@ti.com>.

Change-Id: I7094eb8e0eb512b53a5333ff2dd70c756a775a7e
Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>
6 years agoOMAP:TILER: Add debugfs interfaces for Tiler
Lajos Molnar [Thu, 14 Jul 2011 02:13:54 +0000 (19:13 -0700)]
OMAP:TILER: Add debugfs interfaces for Tiler

Added <debugfs>/tiler/map/2x1 file which contains the TILER container map
subsampled 2x1.  Reading this file will perform a dump of the tiler container.

Added <debugfs/tiler/alloc_debug debugfs parameter.  Setting this parameter
to a non-zero value will cause debug prints for each area allocation and
deallocation.

Signed-off-by: Lajos Molnar <molnar@ti.com>
Signed-off-by: Andy Gross<andy.gross@ti.com>
6 years agoTILER: Fix a use-after free error
Iliyan Malchev [Mon, 22 Aug 2011 18:47:10 +0000 (11:47 -0700)]
TILER: Fix a use-after free error

Removed errant usage of previously freed memory in unregister
buffer ioctl.

Signed-off-by: Iliyan Malchev <malchev@google.com>
Signed-off-by: Andy Gross <andy.gross@ti.com>
6 years agoTILER: Make userspace API support a configurable option
Andy Gross [Wed, 8 Jun 2011 22:05:15 +0000 (17:05 -0500)]
TILER: Make userspace API support a configurable option

Added kernel configuration option for enabling userspace
ioctl interfaces.  If set, ioctl support will be enabled in the
driver.

Signed-off-by: Andy Gross <andy.gross@ti.com>
6 years agoTILER: Make tiler nv12 support a configuration option
Andy Gross [Wed, 8 Jun 2011 03:15:55 +0000 (22:15 -0500)]
TILER: Make tiler nv12 support a configuration option

The tiler driver now allows for configuring the nv12
support as a kernel configuration option.  If enabled,
nv12 support will be compiled into the driver.

Signed-off-by: Andy Gross <andy.gross@ti.com>
6 years agoTILER: Refactor function names to resemble actual functionality
Andy Gross [Thu, 2 Jun 2011 18:36:41 +0000 (13:36 -0500)]
TILER: Refactor function names to resemble actual functionality

Change references of mapping to pinning where applicable, so that the
new function names resemble more closer to the actual functionality.

Signed-off-by: Andy Gross <andy.gross@ti.com>
6 years agoOMAP: TILER: Added 1D area allocation + memory pinning operations
Lajos Molnar [Thu, 9 Jun 2011 23:50:56 +0000 (18:50 -0500)]
OMAP: TILER: Added 1D area allocation + memory pinning operations

Added new tiler kernel methods:

tiler_alloc_block_area() allocates a 1D container area of certain size
tiler_pin_memory() can pin memory-backing to a 1D container area (or replace
its previous mapping)
tiler_unpin_memory() clears the memory-backing of a 1D container area

tiler_free_block() can be still used to free the container area.

Signed-off-by: Lajos Molnar <molnar@ti.com>
6 years agoOMAP: TILER: Expose 1D mapping/unmapping operations
Lajos Molnar [Thu, 9 Jun 2011 23:03:40 +0000 (18:03 -0500)]
OMAP: TILER: Expose 1D mapping/unmapping operations

Expose kernel methods to map a set of physical pages into TILER 1D
(reserve area + pin memory), and free those areas.

Signed-off-by: Lajos Molnar <molnar@ti.com>
6 years agoOMAP: TILER: Pin the correct # of pages to 1D areas.
Lajos Molnar [Thu, 9 Jun 2011 21:37:41 +0000 (16:37 -0500)]
OMAP: TILER: Pin the correct # of pages to 1D areas.

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>
6 years agoOMAP: TILER: Separate sub-tiler operations: mem-alloc, area-alloc, pin
Lajos Molnar [Thu, 9 Jun 2011 17:07:32 +0000 (12:07 -0500)]
OMAP: TILER: Separate sub-tiler operations: mem-alloc, area-alloc, pin

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>
6 years agoOMAP: TILER: TCM-SITA: Fix bug in 1D area allocation
Lajos Molnar [Thu, 9 Jun 2011 22:16:22 +0000 (17:16 -0500)]
OMAP: TILER: TCM-SITA: Fix bug in 1D area allocation

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>
6 years agoTILER: Implement tcm_clear, and initialize TILER container
Lajos Molnar [Thu, 9 Jun 2011 23:45:37 +0000 (18:45 -0500)]
TILER: Implement tcm_clear, and initialize TILER container

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>
6 years agoTILER: Add support for mapping kernel allocated buffers into TILER
Lajos Molnar [Wed, 18 May 2011 01:00:50 +0000 (18:00 -0700)]
TILER: Add support for mapping kernel allocated buffers into TILER

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>
6 years agoTILER: Simplify TILIOC_GSSP ioctl
Suman Anna [Thu, 26 May 2011 19:15:18 +0000 (14:15 -0500)]
TILER: Simplify TILIOC_GSSP ioctl

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>
6 years agoTILER: Add tiler_virt2phys function
Suman Anna [Thu, 26 May 2011 18:07:16 +0000 (13:07 -0500)]
TILER: Add tiler_virt2phys function

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>
6 years agoTILER: Fix NULL dereference when mapping kernel buffers with map_block
Lajos Molnar [Wed, 6 Apr 2011 02:33:07 +0000 (21:33 -0500)]
TILER: Fix NULL dereference when mapping kernel buffers with map_block

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>
6 years agoTILER: Add missing kfree for pointer elements
Andy Gross [Tue, 31 May 2011 20:22:14 +0000 (15:22 -0500)]
TILER: Add missing kfree for pointer elements

Add missing kfree when cleaning up fast structure

Signed-off-by: Andy Gross <andy.gross@ti.com>
6 years agoTILER: Include header when using mm_struct
David Sin [Tue, 14 Dec 2010 16:40:23 +0000 (10:40 -0600)]
TILER: Include header when using mm_struct

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>
6 years agoTILER: Fix tilview_flip logic
Lajos Molnar [Thu, 14 Oct 2010 06:35:09 +0000 (01:35 -0500)]
TILER: Fix tilview_flip logic

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>
6 years agoTILER: Notifier callback mechanism for events
Angela Stegmaier [Thu, 2 Sep 2010 23:25:41 +0000 (18:25 -0500)]
TILER: Notifier callback mechanism for events

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>
6 years agoTILER: Make copy_to_user args consistent
David Sin [Thu, 26 Aug 2010 18:00:08 +0000 (13:00 -0500)]
TILER: Make copy_to_user args consistent

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>
6 years agoTILER: Cleaned up tiler-iface.c and tiler.h, _tiler.h
Lajos Molnar [Sat, 17 Jul 2010 04:39:41 +0000 (23:39 -0500)]
TILER: Cleaned up tiler-iface.c and tiler.h, _tiler.h

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>
6 years agoTILER: Cleaned up tiler-reserve.c
Lajos Molnar [Sat, 17 Jul 2010 04:17:58 +0000 (23:17 -0500)]
TILER: Cleaned up tiler-reserve.c

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>
6 years agoTILER: Add menuconfig and memparse support for cache_limit setting.
Lajos Molnar [Fri, 16 Jul 2010 15:36:46 +0000 (10:36 -0500)]
TILER: Add menuconfig and memparse support for cache_limit setting.

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>
6 years agoTILER: Correct PAT array allocation error handling
Lajos Molnar [Fri, 16 Jul 2010 15:10:19 +0000 (10:10 -0500)]
TILER: Correct PAT array allocation error handling

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>
6 years agoTILER: TCM-SiTA: Combined fill_1d/2d_area
Lajos Molnar [Wed, 14 Jul 2010 23:45:32 +0000 (18:45 -0500)]
TILER: TCM-SiTA: Combined fill_1d/2d_area

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>
6 years agoTILER: Cleaned up tmm-pat.c
Lajos Molnar [Fri, 16 Jul 2010 07:06:55 +0000 (02:06 -0500)]
TILER: Cleaned up tmm-pat.c

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>
6 years agoTILER: Clear PAT also when freeing mapped blocks
Lajos Molnar [Thu, 15 Jul 2010 01:51:46 +0000 (20:51 -0500)]
TILER: Clear PAT also when freeing mapped blocks

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>
6 years agoTILER: Fixed id & physical address handing of tiler_alloc/free.
Lajos Molnar [Wed, 14 Jul 2010 20:10:38 +0000 (15:10 -0500)]
TILER: Fixed id & physical address handing of tiler_alloc/free.

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>
6 years agoTILER: Added checks for invalid (0) area allocation.
Lajos Molnar [Wed, 14 Jul 2010 20:09:51 +0000 (15:09 -0500)]
TILER: Added checks for invalid (0) area allocation.

Allocating 0-sized area now fails.

Signed-off-by: Lajos Molnar <molnar@ti.com>
Signed-off-by: David Sin <davidsin@ti.com>
6 years agoTILER: fix tilview_rotate that returns invalid address
Lajos Molnar [Wed, 14 Jul 2010 20:07:58 +0000 (15:07 -0500)]
TILER: fix tilview_rotate that returns invalid address

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>
6 years agoTILER: Added tilview_create to create views from a pointer.
Lajos Molnar [Wed, 14 Jul 2010 20:02:21 +0000 (15:02 -0500)]
TILER: Added tilview_create to create views from a pointer.

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>
6 years agoTILER: Update file-headers and includes
Lajos Molnar [Sat, 10 Jul 2010 02:11:44 +0000 (21:11 -0500)]
TILER: Update file-headers and includes

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>
6 years agoTILER: Better abstracted geometric manipulations.
Lajos Molnar [Sat, 10 Jul 2010 01:58:45 +0000 (20:58 -0500)]
TILER: Better abstracted geometric manipulations.

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>
6 years agoTILER: Fix 1D in-page offset support and QBLK kernel panic.
Lajos Molnar [Thu, 8 Jul 2010 18:24:28 +0000 (13:24 -0500)]
TILER: Fix 1D in-page offset support and QBLK kernel panic.

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>
6 years agoTILER: Expose physical alignment after MBLK or GBLK.
Lajos Molnar [Thu, 8 Jul 2010 15:26:01 +0000 (10:26 -0500)]
TILER: Expose physical alignment after MBLK or GBLK.

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>
6 years agoTILER: Add support for in-page offset for buffers.
Lajos Molnar [Thu, 8 Jul 2010 14:57:37 +0000 (09:57 -0500)]
TILER: Add support for in-page offset for buffers.

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>
6 years agoTILER: Limit the amount of pages available in the free page stack
David Sin [Mon, 14 Jun 2010 15:26:27 +0000 (10:26 -0500)]
TILER: Limit the amount of pages available in the free page stack

Add logic to cap the total amount of pages to keep on hand.

Signed-off-by: David Sin <davidsin@ti.com>
6 years agoTILER: Move dma_alloc_coherent call to tiler init
David Sin [Thu, 1 Jul 2010 16:11:49 +0000 (11:11 -0500)]
TILER: Move dma_alloc_coherent call to tiler init

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>
6 years agoTILER: Make URBUF return the length of the buffer unregistered.
Lajos Molnar [Thu, 8 Jul 2010 13:10:11 +0000 (08:10 -0500)]
TILER: Make URBUF return the length of the buffer unregistered.

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>
6 years agoTILER: TCM-SITA: Simplified map handling.
Lajos Molnar [Thu, 8 Jul 2010 11:01:18 +0000 (06:01 -0500)]
TILER: TCM-SITA: Simplified map handling.

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>
6 years agoTILER: Removed unused DMM macro definitions
Lajos Molnar [Thu, 8 Jul 2010 07:26:44 +0000 (02:26 -0500)]
TILER: Removed unused DMM macro definitions

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>
6 years agoTILER: Fixed ioctl handling issues.
Lajos Molnar [Thu, 8 Jul 2010 07:10:24 +0000 (02:10 -0500)]
TILER: Fixed ioctl handling issues.

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>
6 years agoTILER: Use function table for non-static methods.
Lajos Molnar [Thu, 8 Jul 2010 06:04:12 +0000 (01:04 -0500)]
TILER: Use function table for non-static methods.

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>
6 years agoTILER: Detailed reorganization of tiler driver
Lajos Molnar [Fri, 2 Jul 2010 17:49:35 +0000 (12:49 -0500)]
TILER: Detailed reorganization of tiler driver

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>
6 years agoTILER: Combined dmm and tiler folders and renamed files.
Lajos Molnar [Tue, 29 Jun 2010 20:57:27 +0000 (15:57 -0500)]
TILER: Combined dmm and tiler folders and renamed files.

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>
6 years agoTILER: Replace dsb calls with wmb for es2.0
David Sin [Tue, 29 Jun 2010 16:09:05 +0000 (11:09 -0500)]
TILER: Replace dsb calls with wmb for es2.0

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>
6 years agoTILER: Ensure the pat refill has correct data before programming it
Santosh Shilimkar [Mon, 29 Mar 2010 05:08:23 +0000 (10:38 +0530)]
TILER: Ensure the pat refill has correct data before programming it

Signed-off-by: David Sin <davidsin@ti.com>
6 years agoTILER: Added Kconfig support for TILER parameters.
Lajos Molnar [Tue, 29 Jun 2010 11:54:58 +0000 (06:54 -0500)]
TILER: Added Kconfig support for TILER parameters.

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>
6 years agoTILER: Add module parameter support for TILER.
Lajos Molnar [Tue, 29 Jun 2010 11:28:24 +0000 (06:28 -0500)]
TILER: Add module parameter support for TILER.

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>
6 years agoTILER: Added close to optimal NV12 packing reservation logic.
Lajos Molnar [Tue, 29 Jun 2010 11:16:05 +0000 (06:16 -0500)]
TILER: Added close to optimal NV12 packing reservation logic.

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>
6 years agoTILER: Added key-id enforcement.
Lajos Molnar [Tue, 29 Jun 2010 10:23:47 +0000 (05:23 -0500)]
TILER: Added key-id enforcement.

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>
6 years agoTILER: Update to v2.0 kernel API, remove d2cmap limitation
Lajos Molnar [Tue, 29 Jun 2010 09:41:37 +0000 (04:41 -0500)]
TILER: Update to v2.0 kernel API, remove d2cmap limitation

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>
6 years agoTILER: Remove tiler_pack_alloc and tiler_pack_alloc_nv12 APIs
Lajos Molnar [Tue, 29 Jun 2010 09:44:52 +0000 (04:44 -0500)]
TILER: Remove tiler_pack_alloc and tiler_pack_alloc_nv12 APIs

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>
6 years agoTILER: Added support for granularity and in-tile offset.
Lajos Molnar [Tue, 29 Jun 2010 08:31:17 +0000 (03:31 -0500)]
TILER: Added support for granularity and in-tile offset.

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>
6 years agoTILER: Simplify _m_add2area parameters.
Lajos Molnar [Tue, 29 Jun 2010 08:17:10 +0000 (03:17 -0500)]
TILER: Simplify _m_add2area parameters.

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>
6 years agoTILER: Add reference count to group info struct.
Lajos Molnar [Tue, 29 Jun 2010 08:12:35 +0000 (03:12 -0500)]
TILER: Add reference count to group info struct.

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>
6 years agoTILER: Updated to v2.0 userspace API.
Lajos Molnar [Tue, 29 Jun 2010 07:59:14 +0000 (02:59 -0500)]
TILER: Updated to v2.0 userspace API.

This patch requires similar changes in user space API/memmgr
header files.

Signed-off-by: Lajos Molnar <molnar@ti.com>
6 years agoTILER: Extend and move SiTA div points
David Sin [Wed, 2 Jun 2010 16:31:55 +0000 (11:31 -0500)]
TILER: Extend and move SiTA div points

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>
6 years agoTILER: Clear PAT irq and status registers after refill
David Sin [Tue, 11 May 2010 20:38:35 +0000 (15:38 -0500)]
TILER: Clear PAT irq and status registers after refill

Clear PAT IRQ STATUS RAW and set PAT_DESC_0 to NULL before
exiting the refill function.  Check the PAT STATUS
reg before exiting to make sure PAT 0 is in the ready state.

Signed-off-by: David Sin <davidsin@ti.com>
6 years agoTILER: Fix rotated tiler address calculation.
Lajos Molnar [Thu, 20 May 2010 00:24:44 +0000 (19:24 -0500)]
TILER: Fix rotated tiler address calculation.

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>
6 years agoTILER: Include slab header for kmalloc/kfree calls
David Sin [Wed, 19 May 2010 17:38:52 +0000 (12:38 -0500)]
TILER: Include slab header for kmalloc/kfree calls

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>
6 years agoTILER: Fix klocwork defects in tiler_reservex() and tiler_exit()
Lajos Molnar [Sat, 1 May 2010 13:05:07 +0000 (08:05 -0500)]
TILER: Fix klocwork defects in tiler_reservex() and tiler_exit()

Signed-off-by: Lajos Molnar <molnar@ti.com>
Signed-off-by: David Sin <davidsin@ti.com>
6 years agoTILER: Fixed issue with tiler_alloc_packed for 16/32-bit buffers.
Lajos Molnar [Fri, 30 Apr 2010 18:33:31 +0000 (13:33 -0500)]
TILER: Fixed issue with tiler_alloc_packed for 16/32-bit buffers.

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>
6 years agoTILER: Relocate entries to the media Kconfig file
David Sin [Tue, 27 Apr 2010 20:34:51 +0000 (15:34 -0500)]
TILER: Relocate entries to the media Kconfig file

Signed-off-by: David Sin <davidsin@ti.com>
6 years agoTILER: Added reference counting and cleanup. Fixed query bugs.
Lajos Molnar [Thu, 15 Apr 2010 13:23:44 +0000 (08:23 -0500)]
TILER: Added reference counting and cleanup. Fixed query bugs.

The reference count of blocks increases on alloc, and by registered
buffers that contain that block.

When all tiler drivers of a process are closed:
  - blocks allocated by it are marked "freed"
  - buffers registered by it are unregistered
All blocks that are no longer marked "allocated" and are not
referenced by registered buffers are actually freed.

Blocks allocated by the kernel API are tracked separately, and
are not release when tiler drivers are closed.  They are only
freed using tiler_free, or when the kernel driver closes.

Fixed a bug with querying buffers by address, which did not
account for the new TCM support for 1D buffers and block management.

Added support for clearing PAT for freed blocks.

Added extended tiler kernel API-s for specifying group ids, pids,
alignment and offset.

tiler_allocx
tiler_reserve
tiler_reservex
tiler_map
tiler_mapx

Signed-off-by: Lajos Molnar <molnar@ti.com>
Signed-off-by: David Sin <davidsin@ti.com>
6 years agoTILER: Cleaned up SiTA container manager algorithm code
Lajos Molnar [Mon, 12 Apr 2010 21:04:57 +0000 (16:04 -0500)]
TILER: Cleaned up SiTA container manager algorithm code

Removed unnecessary true/false identical macro values
Changed tcm_area.type field to is2d
Shortened variable names
Renamed functions based on what they do
Simplified some of the logic
Removed most of the debug messages and unused/duplicate variables
Removed duplicate parameter checks and made fuctions that always
succeed void.
Moved tcm_dbg.h macros into tcm_utils.h

Tested using memmgr_1.0 tests.

Signed-off-by: Lajos Molnar <molnar@ti.com>
Signed-off-by: David Sin <davidsin@ti.com>
6 years agoTILER: Added support for auto-packing of tiler blocks.
Lajos Molnar [Mon, 12 Apr 2010 16:25:59 +0000 (11:25 -0500)]
TILER: Added support for auto-packing of tiler blocks.

Changed the way tiler blocks are maintained.  1D blocks are maintained
similarly as before, but 2D blocks now reside on "reserved areas" that
are maintained in area_info structs.

Note, that even though auto-packing is supported, there is no open API
to specify alignment other than kernel page size.  Therefore, there is
no expected allocation efficiency gain.

Reference counts are also introduced although they are not yet used.

Tested using memmgr_1.0 test as well as select allocation/freeing
kernel calls to verify logic of maintaining blocks in the reserved area.

Signed-off-by: Lajos Molnar <molnar@ti.com>
Signed-off-by: David Sin <davidsin@ti.com>
6 years agoTILER: Renamed dmm_mem.c to tmm_pat.c to reflect what it is.
Lajos Molnar [Mon, 12 Apr 2010 00:03:38 +0000 (19:03 -0500)]
TILER: Renamed dmm_mem.c to tmm_pat.c to reflect what it is.

Also fixed a compiler warning.

Signed-off-by: Lajos Molnar <molnar@ti.com>
Signed-off-by: David Sin <davidsin@ti.com>
6 years agoTILER: Added support for multiple containers and PAT instances.
Lajos Molnar [Sun, 11 Apr 2010 23:51:23 +0000 (18:51 -0500)]
TILER: Added support for multiple containers and PAT instances.

Added instance support for DMM PAT programming (dmm.c)
Created TMM interface for flexible tiler memory management (PAT or not).
Added instance support to DMM PAT memory pages management (dmm_mem.c)
Removed unused get_page/free_page methods.
Fixed TILER_GET_ACC_MODE macro to return correct tiler_fmt values.
Fixed a few sizeof style errors, and simplified dmm_mem.c

Signed-off-by: Lajos Molnar <molnar@ti.com>
Signed-off-by: David Sin <davidsin@ti.com>
6 years agoTILER: Renamed SiTA tcm files to *tcm_sita*
Lajos Molnar [Sun, 11 Apr 2010 20:50:32 +0000 (15:50 -0500)]
TILER: Renamed SiTA tcm files to *tcm_sita*

Signed-off-by: Lajos Molnar <molnar@ti.com>
6 years agoTILER: Separated SiTA TCM implementation from TCM definition
Lajos Molnar [Sun, 11 Apr 2010 20:44:57 +0000 (15:44 -0500)]
TILER: Separated SiTA TCM implementation from TCM definition

Moved SiTA specific util function into tcm_sita.c
Added copyright headers
Adjusted TCM_INIT definition macro as attribute type can be known.
Prepared for renames in next commit.

Signed-off-by: Lajos Molnar <molnar@ti.com>
Signed-off-by: David Sin <davidsin@ti.com>
6 years agoTILER: Consolidated PAT programming
Lajos Molnar [Sun, 11 Apr 2010 20:11:12 +0000 (15:11 -0500)]
TILER: Consolidated PAT programming

Also removed unnecessary fields in mem_info struct

Signed-off-by: Lajos Molnar <molnar@ti.com>
Signed-off-by: David Sin <davidsin@ti.com>
6 years agoTILER: Use TCM features for tiler space allocations.
Lajos Molnar [Sun, 11 Apr 2010 18:58:03 +0000 (13:58 -0500)]
TILER: Use TCM features for tiler space allocations.

TCM sita allocator bug fix: set area type
Allow flexible tiler-allocation bands vs. hardoded 64-slot bands.
Allow 1D area allocation/mapping at slot granularity.
Use kernel macros for rounding and aligning.
Remove duplicate checks in TCM.
Minor formatting.
Added tcm_sizeof macro.
Fixed tcm_for_each_slice macro.

Signed-off-by: Lajos Molnar <molnar@ti.com>
Signed-off-by: David Sin <davidsin@ti.com>
6 years agoTILER: Update to Linux sizeof conventions and formatting.
Lajos Molnar [Sun, 11 Apr 2010 15:28:42 +0000 (10:28 -0500)]
TILER: Update to Linux sizeof conventions and formatting.

Fixe sizeof constructs to use the target variable's type instead of
hardcoded type.
Removed multi-line strings, extra empty lines.

Signed-off-by: Lajos Molnar <molnar@ti.com>
Signed-off-by: David Sin <davidsin@ti.com>
6 years agoTILER: Initial reorganization of TCM files.
Lajos Molnar [Sat, 10 Apr 2010 00:15:50 +0000 (19:15 -0500)]
TILER: Initial reorganization of TCM files.

Moved TCM files to their correct location to be able to see future diffs.

Signed-off-by: Lajos Molnar <molnar@ti.com>
Signed-off-by: David Sin <davidsin@ti.com>
TILER: Initial TCM code cleanup

Fixed spacing and most comments according to kernel coding style.
Fixed multi-line strings.
Made all function signatures static.
Replaced memset initialization with "= {0}".
Replaced AREA_STR macro with cleaner print macro.
Removed unnecessary mutex macros.
Removed unnecessary parentheses.

There is a checkpatch warning for the AREA macro, which is expected.

Signed-off-by: Lajos Molnar <molnar@ti.com>
Signed-off-by: David Sin <davidsin@ti.com>
6 years agoTILER: Moved to New Tiler APIs defined in tcm.h, add multi-continer support
R Ramachandra [Fri, 9 Apr 2010 22:16:51 +0000 (17:16 -0500)]
TILER: Moved to New Tiler APIs defined in tcm.h, add multi-continer support

Signed-off-by: R Ramachandra <r.ramachandra@ti.com>
Signed-off-by: David Sin <davidsin@ti.com>
TILER: Fixed bugs in sita_init

Signed-off-by: David Sin <davidsin@ti.com>
TILER: Fixed Bugs, Added memset to sita_pvt in sita_init, updated utils to copy new fields in insert_element

Signed-off-by: David Sin <davidsin@ti.com>
6 years agoTILER: Export latest DMM header to mach directory
David Sin [Thu, 18 Mar 2010 15:22:41 +0000 (10:22 -0500)]
TILER: Export latest DMM header to mach directory

Signed-off-by: David Sin <davidsin@ti.com>
6 years agoTILER: Renamed files with shorter names
Ravi Ramachandra [Wed, 24 Feb 2010 22:28:39 +0000 (16:28 -0600)]
TILER: Renamed files with shorter names

Signed-off-by: David Sin <davidsin@ti.com>