Commit Graph
62 Commits
Author SHA1 Message Date
Rebecca Schultz Zavin 618d6bebc6 gpu: ion: Make ion_free asynchronous
Add the ability for a heap to free buffers asynchrounously.  Freed buffers
are placed on a free list and freed from a low priority background thread.
If allocations from a particular heap fail, the free list is drained.  This
patch also enable asynchronous frees from the chunk heap.

Change-Id: Id16ad870355a8099be26084b51feb3d622d15ced
Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com>
Git-commit: 4e9ef397ec3cfb04b64f165d40dcf1b501415718
Git-repo: https://android.googlesource.com/kernel/common
[lauraa@codeaurora.org: Fixup context differences due to
addition of CMA heap and delayed unsecure]
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
2013-04-16 11:11:54 -07:00
Johan Mossberg 748c11df42 gpu: ion: Add support for sharing buffers with dma buf kernel handles
Currently ion can only share buffers with dma buf fd's. Fd's can not be
used inside the kernel as they are process specific so support for
sharing buffers with dma buf kernel handles is needed to support kernel
only use cases. An example use case could be a GPU driver using ion
that wants to share its output buffers with a 3d party display
controller driver supporting dma buf.

Change-Id: I74388160ad65ee5380b87dbb20521a97ddf6727a
Signed-off-by: Johan Mossberg <johan.mossberg@stericsson.com>
Git-commit: 1a6c74e0d58f6ca028f36c3d794fecff8543bbfb
Git-repo: https://android.googlesource.com/kernel/common
[lauraa@codeaurora.org: update callers of function]
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
2013-04-16 11:11:46 -07:00
Rebecca Schultz Zavin 75aec5b8f8 gpu: ion: Remove heapmask from client
The heapmask in the client generally wasn't being used.  This
patch removes it.

Change-Id: I18bcf11089a0bc20373327ffaead41f73e810e78
Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com>
Git-commit: cd56ef058fdf8aed9cf583e25c6e20308cd61521
Git-repo: https://android.googlesource.com/kernel/common
[lauraa@codeaurora.org: Dropped debugfs changes, adjusted
msm_ion_client_create for compilation purposes]
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
2013-04-16 11:11:31 -07:00
Rebecca Schultz Zavin 2536d60e79 gpu: ion: Clarify variable names and comments around heap ids v types
There is some confusion between when to use the heap type and when
the id.  This patch clarifies this by using clearer variable names
and describing the intention in the comments.  Also fixes the client
debug code to print heaps by id instead of type.

Change-Id: I0c1903ed7bf748ac4b1f2c4235e4d31d6a906f2d
Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com>
Git-commit: ac3da7344f52f727e833593ce547c7d60fa42074
Git-repo: https://android.googlesource.com/kernel/common
[lauraa@codeaurora.org: Minor context differences due to more
debugging output and debugfs differences. Need to change some
debug prints. Dropping changing the name of the userspace field
until we can synchronize all clients later]
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
2013-04-16 11:11:19 -07:00
Rebecca Schultz Zavin d2ce6f8aec gpu: ion: Add chunk heap
This patch adds support for a chunk heap that allows for buffers that are
made up of a list of fixed size chunks taken from a carveout.  Chunk sizes
are configured when the heaps are created by passing the chunk size in the
priv field of the heap platform data.

Change-Id: I188b96f0e1cb40240241984cfd3647817fec28e2
Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com>
Git-commit: 2faceab86ef57bc60e8629bbbea02c057b4fd4c5
Git-repo: https://android.googlesource.com/kernel/common
[lauraa@codeaurora.org: Context differences in Makefile and ion.h due
to additional heaps added. Change sync API for newer kernel.
Changed print formats to actually be correct]
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
2013-04-16 11:11:04 -07:00
Laura Abbott a06bbd05ab gpu: ion: Remove request/release region from platform_heap structure
These definitions are no longer used. Remove them.

Change-Id: If379beb0f31762253fc8417036e1b79c8b0978e4
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
2013-04-11 09:18:54 -07:00
Laura Abbott ca2f5dbd5e gpu: ion: Move msm specific functions to msm_ion.h
msm only functionality that google does not want belongs
in msm_ion.h, not generic ion code. Move the definitons
to msm_ion.h.

Change-Id: I16cb780dd880fd102f59a6528671c49eb374de01
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
2013-04-11 09:18:53 -07:00
Laura Abbott ec56c20f9c gpu: ion: Remove dead comments
The comments no longer apply as definitions have moved files.
Remove them.

Change-Id: Ic82cb19f4f61954cde065ca7147983507fb5017f
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
2013-04-11 09:18:53 -07:00
Laura Abbott 4f6c71d4ce gpu: ion: Move ION_HEAP_TYPE_DMA to msm specific code
ION_HEAP_TYPE_DMA has not yet been merged upstream. Keep
the definitions in msm code until a final version has
been reached.

Change-Id: Idaf3a4df48a627f94d60c53d30edc7a20b1b2127
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
2013-04-04 14:01:01 -07:00
Rebecca Schultz Zavin 3edb9006cd gpu: ion: Add support for cached mappings that don't fault
We have found that faulting in the mappings for cached
allocations has a significant performance impact and is
only a benefit if only a small part of the buffer is
touched by the cpu (an uncommon case for software rendering).
This patch introduces a ION_FLAG_CACHED_NEEDS_SYNC
which determines whether a mapping should be created by
faulting or at mmap time.  If this flag is set,
userspace must manage the caches explictly using the SYNC ioctl.

Change-Id: I227561f49e0f382a481728fb55ac5c930fc26025
Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com>
Git-commit: 71545d66cc5afa4c930523810e62ba8ce391f621
Git-repo: https://android.googlesource.com/kernel/common
[mitchelh@codeaurora.org: merge conflicts in ion_buffer]
Signed-off-by: Mitchel Humpherys <mitchelh@codeaurora.org>
2013-03-25 15:05:03 -07:00
Rebecca Schultz Zavin f441922535 gpu: ion: Add explicit sync ioctl
This is deprecated in favor of using the dma_buf api which will
automatically sync a buffer to memory when it is mapped to a device.
However, that functionality is not ready, so this patch adds the
ability to sync a buffer explicitly.

Change-Id: Ia15810a13cd5c4b939f4afa5c8e721c89fac76d4
Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com>
Git-commit: a73e94ce46cfc32b6deeb1589142e3c53fee09ab
Git-repo: https://android.googlesource.com/kernel/common
[mitchelh@codeaurora.org: minor merge conflicts]
Signed-off-by: Mitchel Humpherys <mitchelh@codeaurora.org>
2013-03-25 15:05:02 -07:00
Laura Abbott 871ad42d59 gpu: ion: Remove ion_virt_addr_t
The ion_virt_addr_t was added for historical code which
is not used anymore. Remove it.

Change-Id: Ic628ce675cc7b9dfd570ccfb5fbed6fab67b4571
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
2013-03-13 14:28:19 -07:00
Mitchel Humpherys a75e4eb075 gpu: ion: check for leaks in ion_client_destroy
If an ion client is destroyed without destroying all handles created
by that client, there will be leaked buffers. Print a message if this
happens.

Change-Id: Id674f508666d506b3a9ee848adbc29435c5fe8c2
Signed-off-by: Mitchel Humpherys <mitchelh@codeaurora.org>
2013-02-25 11:53:59 -08:00
Duy Truong 790f06d941 Update copyright to The Linux Foundation
Change-Id: I9d411a9c00b37d0907066dbfa6db3a78c108646f
Signed-off-by: Duy Truong <dtruong@codeaurora.org>
2013-02-13 16:38:12 -08:00
Benjamin Gaignard 07b590eb0e add CMA heap
New heap type ION_HEAP_TYPE_DMA where allocation is done with dma_alloc_coherent API.
device coherent_dma_mask must be set to DMA_BIT_MASK(32).
ion_platform_heap private field is used to retrieve the device linked to CMA,
if NULL the default CMA area is used.
ion_cma_get_sgtable is a copy of dma_common_get_sgtable function which should
be in kernel 3.5

Change-Id: I9ae54a3a021cb3513c2b0e8c58b69f3ae118561b
Signed-off-by: Benjamin Gaignard <benjamin.gaignard@linaro.org>
[lauraa: Fix context in ion_priv.h/ion.h and omit Makefile change for now]
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
2012-12-03 12:38:15 -08:00
Benjamin Gaignard 8dff0a6bc5 add private field in ion_heap and ion_platform_heap structure
copy private field from platform configuration to internal heap structure.

Change-Id: Ia7571d88fc2f72f5d655fb6f6b54fde389d96c85
Signed-off-by: Benjamin Gaignard <benjamin.gaignard@linaro.org>
[laura: Rebase context fixes]
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
2012-12-03 12:38:14 -08:00
Benjamin Gaignard 63d8103955 fix ion_platform_data definition
fix ion_platform_heap to make is use an usual way in board configuration file.

Change-Id: I8686108a9fe0aa2ba9f9c84990d555f947f78f86
Signed-off-by: Benjamin Gaignard <benjamin.gaignard@linaro.org>
[lauraa: Fixup msm board files]
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
2012-12-03 12:38:10 -08:00
Mitchel Humpherys c4dba0a8c5 ion: update documentation
Some of the documentation has gotten out of sync with the recent Ion
API changes. Update out-of-date function headers to reflect the new
API.

Change-Id: I7ce6da2b2c4464d58af7bd59066f0b4873e65bfc
Signed-off-by: Mitchel Humpherys <mitchelh@codeaurora.org>
2012-11-05 14:06:18 -08:00
Mitchel Humpherys baa8692f93 ion: update API stubs
The stubs for some of the Ion functions have gotten stale since the
last Ion API change. Update these to avoid compile errors when Ion is
not included in the build.

Change-Id: Idfe475c0f1990e5a9b5919434a27ae9dd63ffcb4
Signed-off-by: Mitchel Humpherys <mitchelh@codeaurora.org>
2012-11-02 16:35:39 -07:00
Mitchel Humpherys 362b52b141 ion: isolate msm-specific ion extensions
This is another step in the process of isolating msm-specific ion
features from stock ion.

Change-Id: I3a437dbc618cb70859126c81596373338ad06500
Signed-off-by: Mitchel Humpherys <mitchelh@codeaurora.org>
2012-10-01 09:53:37 -07:00
Mitchel Humpherys 76b9b4d881 ion: remove obsolete ion flags
The symbols CACHED and UNCACHED have been replaced by ION_FLAG_CACHED
upstream. This removes them from the kernel.

Change-Id: I565dcc4595298ce6a0e81dd8cb98b86a1b38fdb2
Signed-off-by: Mitchel Humpherys <mitchelh@codeaurora.org>
2012-09-25 20:27:02 -07:00
Mitchel Humpherys 911b4b702a ion: change ion kernel map function to not take flags argument
Buffer flags are going to be specified at allocation time rather than
map time. This removes the flags argument from the ion kernel map
function.

Change-Id: I91589ca7b1ab142bb5ac8e6b0f4c06fa1305f23a
Signed-off-by: Mitchel Humpherys <mitchelh@codeaurora.org>
2012-09-25 20:27:02 -07:00
Hanumant Singh 7d72bad55a ion: Port heap mask change to ion
Heap mask field passes as argument at allocation time to specify ion
heap.

Change-Id: I8881dfc491dc0f8f70581ad97b35756a6a33dd6d
Signed-off-by: Hanumant Singh <hanumant@codeaurora.org>
Signed-off-by: Mitchel Humpherys <mitchelh@codeaurora.org>
2012-09-25 20:27:01 -07:00
Mitchel Humpherys 227a6582d8 ion: change ion buffer flags
This syncs up our ion buffer flags in ion.h with upstream (using
ION_FLAG_CACHED instead of CACHED and UNCACHED).

Change-Id: I0bca35210da403098a12747ddadb51fa399f8758
Signed-off-by: Mitchel Humpherys <mitchelh@codeaurora.org>
2012-09-25 20:27:01 -07:00
Laura Abbott 0eec15100e gpu: ion: Add compatibility with future changes
Several changes are pending to be pulled in which are
not compatible with our changes:

* a new field to the allocation ioctl is added
* the ioctl numbers for cache flushing need to be changed.
* the size of the structure passed to ION_IOC_IMPORT
has changed

Add these changes now until full changes can be pulled
in the future.

Change-Id: I9540495e25c7b6c414a6e3719f66f2cd9f78c585
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
2012-08-29 16:50:07 -07:00
Laura Abbott b14ed96f74 gpu: ion: Pull in patches for 3.4
Pull in Ion patches for 3.4 upgrade. Inclues the following
patches from google:

 commit 7191e9ba25
 Author: Rebecca Schultz Zavin <rebecca@android.com>
 Date:   Mon Jan 30 14:18:08 2012 -0800

     ion: Switch map/unmap dma api to sg_tables

     Switch these api's from scatterlists to sg_tables

     Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com>

 commit 6f9e56945d
 Author: Rebecca Schultz Zavin <rebecca@android.com>
 Date:   Tue Jan 31 09:40:30 2012 -0800

     ion: Add reserve function to ion

     Rather than requiring each platform call memblock_remove or reserve
     from the board file, add this to ion

     Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com>

 commit 9ae7e01de1
 Author: KyongHo Cho <pullip.cho@samsung.com>
 Date:   Wed Sep 7 11:27:07 2011 +0900

     gpu: ion: several bugfixes and enhancements of ION

     1. Verifying if the size of memory allocation in ion_alloc() is aligned
     by PAGE_SIZE at least. If it is not, this change makes the size to be
     aligned by PAGE_SIZE.

     2. Unmaps all mappings to the kernel and DMA address spaces when
     destroying ion_buffer in ion_buffer_destroy(). This prevents leaks in
     those virtual address spaces.

     3. Makes the return value of ion_alloc() to be explicit Linux error code
     when it fails to allocate a buffer.

     4. Makes ion_alloc() implementation simpler. Removes 'goto' statement and
     relavant call to ion_buffer_put().

     5. Checks if the task is valid before calling put_task_struct() due
     to failure on creating a ion client in ion_client_create().

     6. Returns error when buffer allocation requested by userspace is failed.

     Signed-off-by: KyongHo Cho <pullip.cho@samsung.com>

 commit 043a61468f
 Author: Rebecca Schultz Zavin <rebecca@android.com>
 Date:   Wed Feb 1 11:09:46 2012 -0800

     ion: Switch ion to use dma-buf

     Ion now uses dma-buf file descriptors to share
     buffers with userspace.  Ion becomes a dma-buf
     exporter and any driver that can import dma-bufs
     can now import ion file descriptors.

     Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com>

 commit 0d1259b5f8
 Author: Rebecca Schultz Zavin <rebecca@android.com>
 Date:   Mon Apr 30 16:45:38 2012 -0700

     gpu: ion: Use alloc_pages instead of vmalloc from the system heap

     With this change the ion_system_heap will only use kernel address
     space when the memory is mapped into the kernel (rare case).

     Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com>

 commit be4a1ee79a
 Author: Rebecca Schultz Zavin <rebecca@android.com>
 Date:   Thu Apr 26 20:44:10 2012 -0700

     gpu: ion: support begin/end and kmap/kunmap dma_buf ops

     These ops were added in the 3.4 kernel.  This patch adds support
     for them to ion.  Previous ion_map/unmap_kernel api is also
     retained in addition to this new api.

     Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com>

 commit 46d71337f9
 Author: Rebecca Schultz Zavin <rebecca@android.com>
 Date:   Mon May 7 16:06:32 2012 -0700

     gpu: ion: Allocate the sg_table at creation time rather than dynamically

     Rather than calling map_dma on the allocations dynamically, this patch
     switches to creating the sg_table at the time the buffer is created.
     This is necessary because in future updates the sg_table will be used
     for cache maintenance.

     Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com>

 commit 903f6c716d
 Author: Rebecca Schultz Zavin <rebecca@android.com>
 Date:   Wed May 23 12:55:55 2012 -0700

     gpu: ion: Get an sg_table from an ion handle

     This patch adds an interface to return and sg_table given a
     valid ion handle.

     Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com>

The commit also includes fixups needed for MSM specific code.

Change-Id: Idbcfa9d6af0febf06f56daaa6beaa59cc08e4351
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
2012-07-03 09:51:29 -07:00
Laura Abbott 7e44648174 gpu: ion: Add support for content protection 2.0 in CP heap
Add support to allow ion_cp_heap.c to secure according to new
requirements. This includes adding versioning to the secure
calls to allow other types of securing to take place.

Change-Id: I65e07ebaeefa1d0572b6531753a707a28284aa0d
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
2012-06-21 13:55:36 -07:00
Laura Abbott d0c83de621 gpu: ion: Add scm calls for content protection 2.0
The next generation of content protection has separate SCM
calls into TZ. Add these functions in a dedicated file so they
can be used by any Ion heap.

Change-Id: I197130f6a5fc33efcd6871b0f7c362fa99f18d20
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
2012-06-18 10:42:44 -07:00
Olav Haugan 85c9540668 gpu: ion: Use standard cache routines
Instead of using custom routines for cache operations use the
standard operations for cache flush, cache clean, and cache
invalidate. In addition only call outer cache routines if
outer cache is available.

Change-Id: Idb51bf7348fd526ebdea1e6ff2e366b8a3b4de33
Signed-off-by: Olav Haugan <ohaugan@codeaurora.org>
2012-05-30 17:33:36 -07:00
Olav Haugan 8726caf1e6 gpu: ion: Map everything into IOMMU with 64K pages.
Due to performance issues with 4K pages and the IOMMU we should use
64K pages. However, minimum allocation from ION is 4K so instead of
mapping on demand we need to map the full heap into the IOMMU when
the first request for mapping comes. Only unmap everything from the
IOMMU when the last buffer is freed.

CRs-fixed: 348606
Change-Id: Ic1793f5caaff2f69bf1fb7e8c8b3bd03378131b8
Signed-off-by: Olav Haugan <ohaugan@codeaurora.org>
2012-05-13 09:24:35 -07:00
Larry Bassel 2d8b42d31f ion: support creation of mm heap in a fixed place
The multimedia firmware on 8960 will always be
loaded into a fixed address, and all callers into
this firmware must be no more than 256M above the
start of this firmware.

This implies that the the mm ION heap and its associated heaps
(mm_fw and mfc) must also be created in a fixed place.

This version of the patch keeps the mm fw heap size
to 2M for compatibility with the current tip. This
will eventually be reduced to 1M.

Change-Id: I35f89b8c60165fb0adbb9d04412e0e200117beb9
Signed-off-by: Larry Bassel <lbassel@codeaurora.org>
Signed-off-by: Olav Haugan <ohaugan@codeaurora.org>
2012-04-20 09:57:59 -07:00
Olav Haugan b36765960a gpu: ion: Delay unmapping from IOMMU.
Due to limitations in the multimedia architecure
clients might not know when a buffer can be unmapped
from the IOMMU. In addition, the multimedia architecture
causes unnecessary mappings/unmappings for the same buffers
which reduces framerates.

Add logic to delay unmapping from the IOMMU
until buffer memory is freed and unmap any outstanding
mappings to avoid virtual memory address space leak.

Change-Id: Idaeae269d9ba623e25a0cb087a89b4cbb63915af
Signed-off-by: Olav Haugan <ohaugan@codeaurora.org>
2012-03-09 09:49:47 -08:00
Olav Haugan 41f8579a79 gpu: ion: Add API to do cache operations
Clients need to be able to do cache operations
on ION buffers in the kernel. Add API to
flush, invalidate, or invalidate and flush the
cache of an ION buffer.

Change-Id: I2b676dbe32372b3c17e4aaf39f51878b105a699c
Signed-off-by: Olav Haugan <ohaugan@codeaurora.org>
2012-03-02 17:33:19 -08:00
Olav Haugan 9a27d4c55b gpu: ion: Add missing argument to iommu map func
There exists one definition for ion_map_iommu
function when ION is enabled and one definition when
ION is disabled. The argument list for the definition used
when ION is disabled is missing the buffer_size argument causing
compilation error for targets that call this function without
ION enabled.

Add buffer_size argument to ion_map_iommu function
for targets that does not have ION enabled.

Change-Id: Ie184e4a6dbec2bc3dff75ab3b25985fd64e2baac
Signed-off-by: Olav Haugan <ohaugan@codeaurora.org>
2012-02-23 09:35:16 -08:00
Olav Haugan f6dc774968 gpu: ion: Move MFC heap to different address
Video hardware has the following requirements for
ION heaps:

1. MM heap must be at a higher address than FW heap.
2. MFC heap must at a higher address than FW
3. MM heap must be adjacent to FW heap.
   (There cannot be another heap between FW and MM heap)
4. MM and MFC heap cannot be more than 256MB away
   from the base address of the FW heap.

MM heap is configured as a reusable heap (FMEM heap) and FMEM
is carved out at a much higher address than the other heaps breaking
the above requirements. To support the above requirements the
MFC heap together with the FW heap must be carved out at the same
location as MM heap.

Change-Id: Ie0acb4b267d4307190ea3cd9ff23c710ffa1a538
Signed-off-by: Olav Haugan <ohaugan@codeaurora.org>
2012-02-19 20:26:15 -07:00
Olav Haugan 9e123f98ea gpu: ion: Lower IOMMU heap priority
Video requires the IOMMU heap to be at a lower
priority so that video can try to allocate from
its MM carveout heap first and then if video needs
more memory and the MM heap is exhausted it will
automatically fall back on IOMMU heap.

Change the priority of the IOMMU heap so video
can fall back on IOMMU heap.

Change-Id: Id1fc19e2c3af18ced028132d1a1bdb6a3935380f
Signed-off-by: Olav Haugan <ohaugan@codeaurora.org>
2012-02-16 10:22:47 -08:00
Laura Abbott caafeea7ce gpu: ion: Add ION support for fmem
FMEM allows ION to release memory for other
purposes when ION clients are not using the
memory.

Add new heap type for fmem that make calls
into fmem API to transition memory from T to
C state and vice versa. Add support for
fmem to content protection heap.

Change-Id: I95f949b57c99949e6eafe6a6f5fd147bdaa264f6
Signed-off-by: Olav Haugan <ohaugan@codeaurora.org>
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
2012-02-03 15:21:49 -08:00
Olav Haugan 80854eb491 gpu: ion: Add new heap for qse comm
Add new 1MB carveout heap for Qualcomm Secure Executive (QSE)
communications.

Change-Id: I8cc87d5af68e9fd4f775770b16638ee01ef88e05
Signed-off-by: Olav Haugan <ohaugan@codeaurora.org>
2012-01-18 17:44:32 -08:00
Olav Haugan 42ebe71efc gpu: ion: Add support for adjacent heaps
ION has to guarantee that two of the heaps are
adjacent to each other. This is due to a limitation
in the hardware. Add code to ensure these heaps
are adjacent.

Change-Id: Icc18437a50e1d872112468d02b61ab47fd70acc9
Signed-off-by: Olav Haugan <ohaugan@codeaurora.org>
2012-01-18 16:40:39 -08:00
Olav Haugan 0703dbf608 gpu: ion: Refactor platform data
Refactor platform data to allow for better
expansion in the future. Add void * for
elements unique to each heap type.

Change-Id: I435679819c67ce917b5798009eff7e71047fd2ea
Signed-off-by: Olav Haugan <ohaugan@codeaurora.org>
2012-01-15 09:30:35 -08:00
Olav Haugan 0a85251cd8 gpu: ion: Add support for secure buffers
Secure buffers provides a way to allow premium encrypted
multimedia content to be decrypted in a secured
memory area that does not allow for interception of the
decrypted content.

Add support for heap type that allow heap to be
used for content protection. Introduce new content
protection heap type and id's.

Change-Id: Idd56aa8805b5b74d1b9ab3fe8964aacc218668c1
Signed-off-by: Olav Haugan <ohaugan@codeaurora.org>
2012-01-14 22:18:45 -07:00
Olav Haugan b5be7998c6 gpu: ion: Add heap ids
Add heap ids for ion heaps. Remove unused
system contiguous heap. Fix vmalloc heap name.

Change-Id: I3c3a653a53c8db8b66a7bba2abac0dfe560c407c
Signed-off-by: Olav Haugan <ohaugan@codeaurora.org>
2012-01-06 14:49:08 -08:00
Olav Haugan ee0f780d78 board: 8660: Add callbacks to request_region
Callbacks to request_region, release_region,
setup_region is missing from ION platform data for
SMI heap.

Change-Id: Ida603d4ac7c3246c0deedb9b80dc0c1ea64638eb
Signed-off-by: Olav Haugan <ohaugan@codeaurora.org>
2011-12-21 16:32:08 -08:00
Laura Abbott 8c0173668e gpu: ion: Add support for iommus
Add infrastructure to support mapping allocations
into iommus.

Change-Id: Ia5eafebee408e297013bf55284abf67d9eb8d78b
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
2011-12-05 10:36:11 -08:00
Alex Bird 8a3ede3801 gpu: ion: Add callbacks to enable SMI voting in ION.
This change is part of the move from PMEM to ION. ION needs an SMI
voting interface smiliar to PMEM's.

Change-Id: I18888f46198848694fb7e1e0d2671074bf51d7c9
Signed-off-by: Alex Bird <alexbird@codeaurora.org>
2011-12-01 17:45:22 -08:00
Laura Abbott e80ea017f1 gpu: ion: Add support for flushing via fd
Userspace clients pass fds around, not handles. Support flushing
via fd.

Change-Id: Ic22d9327e9fa72cb604c3010a2a6f798be8dfdb1
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
2011-11-21 12:27:52 -08:00
Alex Bird 27ca661bda msm: Add SMI callbacks to ION platform data.
As part of the transition from PMEM to ION, the interface for accessing
SMI memory needs to be accessible from ION as it was from PMEM.

Change-Id: Ia6f9475dc030bbb0dafdcc1b6dbe93c7cdeca268
Signed-off-by: Alex Bird <alexbird@codeaurora.org>
2011-11-10 10:43:24 -08:00
Laura Abbott 63cfd7e6a2 8660: Add support for Ion
Add support for Ion

Change-Id: I1c04b8a6df005c6ced8681f419f4445592b4832d
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
2011-11-01 16:30:51 -07:00
Laura Abbott 6557696b65 gpu: ion: Add header file for ERR_PTR
Add err.h for the declaration of ERR_PTR which
is used with the stubbed out ion headers.

Change-Id: Ic5e5aea556723ea6b9c8953ef54ad5a82d3761ec
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
2011-10-31 22:40:09 -07:00
Laura Abbott 2d1760b4f1 board-msm8960: Add ion heaps corresponding to pmem heaps
Add adsp heaps for ion. This corresponds directly
to what pmem currently does. This also includes disabling
the adsp and pmem heaps for pmem.

Change-Id: I4354c713413ebbe949579741efdd75e9c444c8e7
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
2011-10-30 06:02:16 -06:00