Commit Graph

300644 Commits

Author SHA1 Message Date
Laura Abbott
973acfd39b Kbuild: Add ion header file
Make sure the header file for Ion gets exported to userspace.
Also make sure userspace can actually use the header.

Change-Id: I44f436005a6a503811c85d4fb0f89264ba160571
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
2013-02-07 17:43:25 -08:00
Stepan Moskovchenko
a946632630 drivers: iommu: Add flags to iommu_domain_alloc
Add the ability to pass flags into the iommu_domain_alloc
function to specify domain attributes.

Change-Id: Ia33aa8d887a57f76d97ab8921385dcc551716846
Signed-off-by: Stepan Moskovchenko <stepanm@codeaurora.org>
[sboyd: Only iommu_domains.c part]
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
2013-02-07 17:43:24 -08:00
Laura Abbott
767d0d5934 gpu: ion: Add cache flushing APIs
Add ioctl to support flushing the caches of ion
buffers from userspace.

Change-Id: I60f1daf0eef09e1307242bb3fd0ce4aef374a111
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
2013-02-07 17:43:23 -08:00
Laura Abbott
3bd7db8021 gpu: ion: Add IS_CACHED macro
Add a proper IS_CACHED macro for detecting whether or not
flags indicated a cached mapping.

Change-Id: I2a7e130bd185d6b0bcb4b11593420b5888937880
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
2013-02-07 17:43:23 -08:00
Laura Abbott
f48da70f76 gpu: ion: Move initialization earlier
Ion needs to be initialized before most other subsystems.
Move the call to be earlier to ensure drivers that need to
allocate memory at bootup can.

Change-Id: I3892798850b64006dec6aaa2633281925208e20d
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
2013-02-07 17:43:22 -08:00
Laura Abbott
1d94d6cd3f gpu: ion: Add support for cached and uncached mappings
Add explicit support for cached and uncached mappings. Functions
now describe whether mappings will be cached or uncached.

Change-Id: I3f0540c0486b134d7bc610480a3f72350337e5b1
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
2013-02-07 17:43:21 -08:00
Laura Abbott
0f9ac6831e gpu: ion: Add support for carveout heaps on msm targets
Add infrastructure for supporting ion carveout heaps.
The memory type should be specified in the board file using
mach/ion.h. The ion platform driver will be responsible for
allocating the correct memory.

Change-Id: Id70ed1fd799f9a5a16ff971b18d0e868bc09d875
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
2013-02-07 17:43:21 -08:00
Laura Abbott
b870e54e8a gpu: ion: Add platform driver for msm ion
Add platform driver for msm specific ion devices

Change-Id: I8f5f2c135c667ef1ff2504306ffedc295553efe0
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
2013-02-07 17:43:20 -08:00
Laura Abbott
0fe3a23f29 gpu: ion: check return value from gen_pool_add
Check the return value from gen_pool_add and handle
any error gracefully.

Change-Id: I648f3aaafde66f484195024b5c21ef2c6a20b95a
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
2013-02-07 17:43:19 -08:00
Laura Abbott
d00184009b msm: Always map 4k pages
In future work, there will only be support for a page size
of 4k. Remove support for anything else.

Change-Id: Ide73160250e1a15a9af662c23497341d356414d6
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
2013-02-07 17:43:19 -08:00
Laura Abbott
12ba892186 msm: Simplify subsystem ids
Most contexts related to a subsystem (e.g. camera, display)
will all share the same domain. Get rid of all the extra subsystem
ids which just create confusion.

Change-Id: I1a051651ed86296338053c9747795928d467cf87
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
2013-02-07 17:43:18 -08:00
Laura Abbott
4254319ef0 msm: Allow iova address alignment specification
Some clients have specific alignment requirements for
iova addresses. Allow those requirements to be specified
via the upper bits of the flag field. Since all iommu
alignment must be at least 4k, the lower bits can specify
other options while the upper bits specify the alignment.

Change-Id: I825e8d9949ac50ecc92992e3defa3526ae81b4b7
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
2013-02-07 17:43:18 -08:00
Laura Abbott
27c281a41f msm: Don't allow overmapping
Due to the way allocations are performed, over mapping must be
disallowed. Otherwise, it may be possible to inadvertently
unmap other physical addresses. The smallest length that can
now be mapped is 4K. Lengths less than 4k can be safely
overmapped since physical addresses must be 4k aligned as well.

Change-Id: I897f479c0cec29d499406b52b624a6f2b34b718a
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
2013-02-07 17:43:17 -08:00
Laura Abbott
3a78e42cf1 msm: clean up iommu contexts and domains
Group the iommu context together in a logical manner (by subsystem)
to make the code easier to read. Also correct some errors with the
initial pass of context and domains (missing video context and
ijpeg+jpegd domains incorrectly marked as video)

Change-Id: I29064063e1117209beea9fbad044389cc246ed39
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
2013-02-07 17:43:16 -08:00
Laura Abbott
711503e46f msm: Add APIs to allocate buffers for use with IOMMUs
Wrappers to simplify mapping of buffers in kernel and iommu
address space.

Change-Id: I79a261cf8a33e11c3ac68bd0b7f8577c53055d5f
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
2013-02-07 17:43:16 -08:00
Stephen Boyd
a505cfb76e ion: mysterious movement of two assignments
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
2013-02-07 17:43:15 -08:00
Stephen Boyd
95ac3251f1 ion: Fix function signature of ion_carveout_heap_map_dma
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
2013-02-07 17:43:15 -08:00
Laura Abbott
c08951f5f5 gpu: ion: Loop on the handle count when destroying
When destroying a handle, all kernel mappings to that handle
should be destroyed. Other handles may still have references
and valid mappings to the buffer underneath which should not
be destroyed. Loop on the handle reference count, not the buffer
reference count to get rid of all kernel mappings for the handle.

Change-Id: I7dc5d6a86513fc5fa4e21110ceab434714ea2493
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
2013-02-07 17:43:14 -08:00
Stephen Boyd
9c90729512 include: Remove executable bit from sdio_func.h
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
2013-01-31 14:16:28 -08:00
Shubhraprakash Das
c30e83b813 ashmem: Add routines to get in kernel reference to ashmem file
Add get_ashmem_file and put_ashmem_file routines in ashmem driver to get
and return file references to ashmem file from within the kernel.

Change-Id: Ifbb54f7c1aab90f6d656a10a3c40ca2b65ceb89a
Signed-off-by: Shubhraprakash Das <sadas@codeaurora.org>
2013-01-20 21:20:49 -08:00
Shubhraprakash Das
5bf95d3a61 ashmem: Add cache flush routines to ashmem
Flush routines are required by msm architecture to properly
flush the cache based on cache architure.

Change-Id: Ic427a7393eccda794d681401fa7e3eb6807b0f0f
Signed-off-by: Shubhraprakash Das <sadas@codeaurora.org>
2013-01-20 21:20:48 -08:00
Stephen Boyd
a8c1feebc6 ashmem: Move ashmem.h from staging to include/linux and export it
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
2013-01-20 21:20:47 -08:00
Laura Abbott
390b8ce553 binder: Quiet binder
The majority of the binder messages are not very informative
and useful to the reader. Make them available via debug
mechanisms.

Change-Id: Ie0d262372d10fd82b0743dfd79ce7d1de14ae143
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
2013-01-20 21:20:47 -08:00
Rohit Vaswani
365b1170e3 cpuidle: menu: Remove the unused get_loadavg function
The fuction get_loadavg was unused and this also caused
a warning during build. This change also removes it from
the allowed warnings white-list.

Change-Id: I85b184e1eb0ab8b3cf763cab87a30e140d00332b
Signed-off-by: Rohit Vaswani <rvaswani@codeaurora.org>
2013-01-17 00:00:18 -08:00
Pavankumar Kondeti
05f14f2edf Revert "usb: gadget: rndis: Fix re-binding f_rndis"
This reverts commit 7f141c58da.

This patch should not have been applied in the first place. The USB
string id index is limited to 255.  Function drivers are supposed
to allocate string id for the first time their bind is called.  There
is no API to release string id index.  If string id is reset in unbind,
we will run out of string id after multiple bind/unbind.

CRs-Fixed: 425501
Change-Id: Ia82a528f9e0af192063970a9227c9c739ed77f48
Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org>
2013-01-10 11:12:11 -08:00
tirupathireddy
3df704b738 ppp: replace PPP_MTU with PPP_MRU
This replaces the uses of PPP_MTU with PPP_MRU
since both are identical.

Change-Id: Id5c1c590f4c04ab5d6b79da520b5c8eae01881e6
Signed-off-by: tirupathireddy <tirupath@codeaurora.org>
2013-01-10 11:12:10 -08:00
Stephen Boyd
702722709c char: dcc_tty: Update for spinlock changes
There is no longer a SPIN_LOCK_UNLOCKED macro; replace it with
__SPIN_LOCK_UNLOCKED so that lockdep can give the lock a name.
Also include spinlock.h so that this compiles.

Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
2013-01-10 11:12:09 -08:00
Abhimanyu Kapur
2a94e2ae76 ARM: SMP: send IPI in backtrace only for SMP
Bug in backtrace leads to NULL Pointer dereference with CONFIG_SMP_ON_UP
while sending IPI, fix it.
-----------------------------------------------------------------
[  301.992943] Unable to handle kernel NULL pointer dereference at virtual address 00000000
[  302.023626] pgd = c0004000
[  302.033985] [00000000] *pgd=00000000
[  302.048057] Internal error: Oops: 80000007 [#1] PREEMPT SMP ARM
[  302.070273] Modules linked in:
[  302.082206] CPU: 0    Not tainted  (3.4.0+ #12)
[  302.099386] PC is at 0x0
[  302.109251] LR is at smp_send_all_cpu_backtrace+0x88/0xe4
[  302.129993] pc : [<00000000>]    lr : [<c00144f0>]    psr: 20000193
[  302.130522] sp : c02edd80  ip : 00000000  fp : 7fffffff
[  302.173742] r10: 00000000  r9 : c02ee0c0  r8 : 19484bea
[  302.193789] r7 : 00002710  r6 : 00000000  r5 : 00000000  r4 : c031d034
[  302.218816] r3 : c030ad58  r2 : 00010001  r1 : 00000007  r0 : c031d044
[  302.243885] Flags: nzCv  IRQs off  FIQs on  Mode SVC_32  ISA ARM  Segment kernel
[  302.272171] Control: 10c5387d  Table: 2f404059  DAC: 00000015
[  302.293986]
[  302.294243] LR: 0xc0014470:
[  302.310233] 4470  e3c20d7f e30d4034 e3c0303f e34c4031 e3a00000 e284101c e5935014 eb05c24f
[  302.341559] 4490  e2503000 18bd80f8 e30567a4 e34c6021 e1a01004 e1a00005 e5962000 e1a06003
[  302.372890] 44b0  e3027710 e592e000 e5a1e010 eb05b841 e1a01005 e30a05bc e34c0027 eb07ed21
[  302.404222] 44d0  eb07ec87 e30a05e0 e34c0027 eb07ed1d e1a00004 e490c010 e3a01007 e12fff3c
[  302.435554] 44f0  ea000008 eb05bcab e594c010 e30605b0 e3400666 e31c000f 0a000009 eb05bca5
[  302.466888] 4510  e1560007 0a000006 e5941010 e2863001 e30605b0 e2836001 e311000f e3400666
[  302.498220] 4530  1affffef e3a00000 e59f1008 eb05b821 f57ff05f e8bd80f8 c031d050 e30537a8
[  302.529555] 4550  e34c3021 e92d4ff0 e5938000 e3067750 e30495c8 e30f6d00 e24dd00c e241b001
[  302.560973]
[  302.561235] SP: 0xc02edd00:
[  302.577222] dd00  392e3130 36353137 00205d36 00000000 c02edd7c c020f974 c02ca964 c02edd2c
[  302.608555] dd20  00000000 00000000 20000193 ffffffff c02edd6c c000eef8 c031d044 00000007
[  302.639897] dd40  00010001 c030ad58 c031d034 00000000 00000000 00002710 19484bea c02ee0c0
[  302.671221] dd60  00000000 7fffffff 00000000 c02edd80 c00144f0 00000000 20000193 ffffffff
[  302.702565] dd80  c030ad58 c05aca98 c0306764 c030dd00 c030dd00 c007c664 295f6000 00001dc6
[  302.733898] dda0  00000017 c0306970 00000000 c0306970 c02e9a98 19484bea 00000046 00000000
[  302.765220] ddc0  7fffffff c007cc58 c02ec000 c0307c80 00000000 00000000 19484bea c0033100
[  302.796555] dde0  c05ac888 c05ac888 c0341c40 c0305f40 19484bea c0060f78 c05ac888 c05ac738
[  302.827969]
[  302.828233] R0: 0xc031cfc4:
[  302.844218] cfc4  006c3776 00000000 c027eb38 00000000 410fc051 00000000 00000000 00000000
[  302.875563] cfe4  00000000 00000000 00000000 00000000 00000000 00000000 00000000 c030cac0
[  302.906895] d004  c0308d90 00000000 003.299225] ad98  00000004 ffffffff 00000000 00000001 00000000 00000000
ffffffff 00000001
[  303.330564] adb8  00000000 00000000 c030adc0 c030adc0 00000000 00000001 c0280068 c028006c
[  303.361958]
[  303.362221] R4: 0xc031cfb4:
[  303.378221] cfb4  00000000 00000000 00000000 c001e658 006c3776 0000ee000)
[  303.936303] dd80: c030ad58 c05aca98 c0306764 c030dd00 c030dd00 c007c664 295f6000 00001dc6
[  303.967588] dda0: 00000017 c0306970 00000000 c0306970 c02e9a98 19484bea 00000046 00000000
[  303.998940] ddc0: 7fffffff c007cc58 c02ec000 c0307c80 00000000 00000000 19484bea c0033100
[  304.030275] 04.500235] dfc0: c02e55ec c02ca964 00000000 00000000 c02ca448 00000000 00000000 c02e55ec
[  304.531597] dfe0: 10c5387d c0305ea0 c02e55bc c0308d04 20204059 20208040 00000000 00000000
[  304.563391] [<c00144f0>] (smp_send_all_cpu_backtrace+0x88/0xe4) from [<c007c664>] (__rcu_pending+0x17c/0x5ac)
[  30406] [<c0010108>] (handle_IRQ+0x5c/0xc0) from [<c0008530>] (gic_handle_irq+0x48/0xe8)
[  305.033405] [<c0008530>] (gic_handle_irq+0x48/0xe8) from [<c000ee00>] (__irq_svc+0x40/0x70)
[  305.064749] Exception stack(0xc02edf48 to 0xc02edf90)
[  305.084483] df40:                   00000000 00000000 a00000c02ee0c0  r8 : 80000007
[  305.544476] r7 : c0307c80  r6 : c02edb7c  r5 : c0305ef8  r4 : 000f4240
[  305.569465] r3 : 00000000  r2 : c031d034  r1 : 00000006  r0 : c02edb7c
[  305.594485] Flags: nZCv  IRQs off  FIQs on  Mode SVC_32  ISA ARM  Segment kernel
[  305.622824] Control: 10c5387d  Table: 2f408 00010000 c02ec000 c02ec2f0 0000000b c027bb60 c02edd38 00000000
[  306.414224] dbdc  00000000 80000007 00000000 00000000 c001addc 80000007 00000000 c02edd38
[  306.445623]
[  306.445886] R2: 0xc031cfb4:
[  306.461894] cfb4  00000000 00000000 00000000 c001e658 006c3776 00000000 c027eb38 00000000
[ bc  c02ec008 00010000 c02ec000 c02ec2f0 0000000b c027bb60 c02edd38 00000000
[  307.215227] dbdc  00000000 80000007 00000000 00000000 c001addc 80000007 00000000 c02edd38
[  307.246620]
[  307.246883] R7: 0xc0307c00:
[  307.262891] 7c00  c01b95ac c0213788 c01b95b8 c0213794 c01b9664 c02137a0 c01b966c b80: c031f380 c02edd38
00000000 c020f7ac c02ee0c0 c02edbbc 7fffffff c02ec2f0
[  308.150942] dba0: c02edd38 00000000 c0307c80 80000007 c031d018 c0013394 c027a19c c02ec008
[  308.182258] dbc0: 00010000 c02ec000 c02ec2f0 0000000b c027bb60 c02edd38 00000000 00000000
[  308.213580] dbe0: 80000007 000000004aa54 00000046 c02eff00
[  308.934261] dec0: c02eff54 cfa00540 00000000 d0804010 410fc051 00000027 00000000 c0074a9c
[  308.965605] dee0: c02eff00 c02eff54 00000027 c0077680 c0306970 c02e9f44 00000027 c00743ec
[  308.996956] df00: 00000178 c0010108 c0305ec8 d080400c c02edf48 c0305ec8 d0804010 c00085364>]
(__rcu_pending+0x17c/0x5ac) from [<c007cc58>] (rcu_check_callbacks+0x1c4/0x1e0)
[  309.664887] [<c007cc58>] (rcu_check_callbacks+0x1c4/0x1e0) from [<c0033100>] (update_process_times+0x38/0x68)
[  309.702911] [<c0033100>] (update_process_times+0x38/0x68) from [<c0060f78>]
(tick_sched_timer+0x9c/0xk(0xc02edf48 to 0xc02edf90)

Change-Id: Icfd3585361c88ada6550f22b316af19e1a2b7721
Signed-off-by: Abhimanyu Kapur <abhimany@codeaurora.org>
2013-01-10 10:54:34 -08:00
Jeff Boody
982f597ea0 base: sync: include struct seq_file to fix compile warning
Fixes missing declaration for struct seq_file.

Change-Id: Id77c47fad3bbee56d0dbe4a85f56f6f388e686d6
Signed-off-by: Jeff Boody <jboody@codeaurora.org>
2013-01-10 10:46:18 -08:00
Stepan Moskovchenko
21e52c9d13 Revert "ARM: Make low-level printk work"
This reverts commit ffdcd796e23c86d2cfeb25cb2d140f11d5fd6411.
This feature is replaced by passing 'earlyprintk' on the
kernel command line.

Change-Id: I2d4f2812e39b1c7afc061f106863b63710762fa7
Signed-off-by: Stepan Moskovchenko <stepanm@codeaurora.org>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
2013-01-10 10:40:56 -08:00
Stephen Boyd
d7574b90d8 cpufreq: interactive: Fix blocked task warnings
Running a kernel that never enables the interactive cpufreq
will eventually hit the following warning:

INFO: task kinteractiveup:112 blocked for more than 120 seconds.
kinteractiveup  D c07ae3a4  7072   112      2 0x00000000
[<c07ae3a4>] (__schedule+0x4e4/0x5c4) from [<c00a1b8c>] (kthread+0x70/0x94)
[<c00a1b8c>] (kthread+0x70/0x94) from [<c000f368>]
(kernel_thread_exit+0x0/0x8)

due to the fact that the kthread is never woken up after being
forked. Kick the thread to its idle loop so that it can
schedule() and move out of the D state.

Change-Id: Idc490e707d9a14dd143306a8ee1c2241320d29d5
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
2013-01-10 10:38:47 -08:00
Narayanan Gopalakrishnan
d775709793 cpufreq: fix interactive bug during hotplug
When a new cpu is added and if does not enter idle
for long, the interactive timer is not started and hence
the cpu remains at lowest frequecny, despite the system
load. This impacts mainly benchmarks. Starting a timer
at governor start to handle low frequency.

Change-Id: I8ac9705b9f166a95715c985efacd2ae8ef387cb7
Signed-off-by: Narayanan Gopalakrishnan <nargop@codeaurora.org>
2013-01-10 10:38:40 -08:00
Jeff Boody
8588a01924 base: sync: signal a sync pt when not adding to the active_list
A sync point that is not added to the active_list will never signal
in sync_timeline_signal thus causing sync_fence_wait to deadlock or
block until the timeout expired.

Change-Id: I75168d0eec874bf70dd8c28db9508dd8fc1077d3
Signed-off-by: Jeff Boody <jboody@codeaurora.org>
2013-01-10 10:36:27 -08:00
Todd Poynor
23016defd7 PM / Suspend: Print wall time at suspend entry and exit
Change-Id: I92f252414c013b018b9a392eae1ee039aa0e89dc
Signed-off-by: Todd Poynor <toddpoynor@google.com>
2012-05-30 21:01:52 -07:00
Arve Hjønnevåg
6411d5781d android: persistent_ram: Allow specifying ecc parameters in platform data
Change-Id: If5aaa968f6ce85ac8e18f07cca286f20f0aa6e58
Signed-off-by: Arve Hjønnevåg <arve@android.com>
2012-05-30 17:03:48 -07:00
Arve Hjønnevåg
6ce7d7aa4b android: persistent_ram: Include ecc_size when calculating ecc_block
Wastes less memory and allows using more memory for ecc than data.

Change-Id: I1537d28ef3e8626e2dfdc69f2e185d28b7600916
Signed-off-by: Arve Hjønnevåg <arve@android.com>
2012-05-30 17:03:48 -07:00
Erik Gilling
49795fbf33 sw_sync: export sw_sync API
Needed to let modules link against sw_sync.

Change-Id: I71d3e52677ef21b6e1ecdb84f831491be1f4fbe6
Signed-off-by: Erik Gilling <konkers@android.com>
2012-05-30 13:12:40 -07:00
Erik Gilling
4fb837a718 sync: export sync API symbols
This is needed to allow modules to link against the sync subsystem

Change-Id: I15c1818de329f24e4113ef1d0923413b22fd0eff
Signed-off-by: Erik Gilling <konkers@android.com>
2012-05-30 13:12:40 -07:00
Erik Gilling
c80114fd8b sync: allow async waits to be canceled
In order to allow drivers to cleanly handled teardown we need to allow them
to cancel pending async waits.  To do this cleanly, we move allocation of
sync_fence_waiter to the driver calling sync_async_wait().

Change-Id: Ifcd95648be6ec07026d67f810070a4310f099989
Signed-off-by: Erik Gilling <konkers@android.com>
2012-05-30 13:12:40 -07:00
Benoit Goby
dcefb2ee8d usb: gadget: android: Fix product name
Product names may contain spaces and scanf %s only matches the 1st word.
Use strlcpy instead.

Change-Id: Ie8703fea9775f7fc17fe615a42597ca3816d36b0
Signed-off-by: Benoit Goby <benoit@android.com>
2012-05-29 15:53:56 -07:00
Colin Cross
5500e4fab2 Merge commit 'v3.4' into android-3.4 2012-05-25 13:56:28 -07:00
Rebecca Schultz Zavin
903f6c716d 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.

Change-Id: Icd948c60c1af0a4279f337bcd591cd39b46325e8
Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com>
2012-05-23 13:20:25 -07:00
Todd Poynor
af120e1797 cpufreq: interactive: fixup trace of string params
Change-Id: Iac47f62437e61b13724afbbf9df1a0729f58f236
Signed-off-by: Todd Poynor <toddpoynor@google.com>
2012-05-22 18:50:10 -07:00
Todd Poynor
5a5aa70d89 cpufreq: interactive: restart above_hispeed_delay at each hispeed load
Change-Id: I2e5b91d45e8806b0ab94ca2301ed671c9af9ab13
Signed-off-by: Todd Poynor <toddpoynor@google.com>
2012-05-22 18:49:46 -07:00
Rebecca Schultz Zavin
46d71337f9 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.

Change-Id: I49aac7c6d3a5afc440d18b917ae0e73be5d3f56d
Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com>
2012-05-22 14:01:07 -07:00
Rebecca Schultz Zavin
be4a1ee79a 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.

Change-Id: I6d2db284dce12c2d8cc4e540865beee2da43bd0c
Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com>
2012-05-22 14:01:07 -07:00
Rebecca Schultz Zavin
0d1259b5f8 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).

Change-Id: I8702cf89ffec0bd5c337bd88d7444013d4d94bc8
Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com>
2012-05-22 14:01:06 -07:00
Rebecca Schultz Zavin
043a61468f 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.

Change-Id: Ia04d6d72fb301dc088eb8db6576822e9260ff332
Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com>
2012-05-22 14:01:06 -07:00
Daniel Vetter
d4e8b7193d dma-buf: mmap support
Compared to Rob Clark's RFC I've ditched the prepare/finish hooks
and corresponding ioctls on the dma_buf file. The major reason for
that is that many people seem to be under the impression that this is
also for synchronization with outstanding asynchronous processsing.
I'm pretty massively opposed to this because:

- It boils down reinventing a new rather general-purpose userspace
  synchronization interface. If we look at things like futexes, this
  is hard to get right.
- Furthermore a lot of kernel code has to interact with this
  synchronization primitive. This smells a look like the dri1 hw_lock,
  a horror show I prefer not to reinvent.
- Even more fun is that multiple different subsystems would interact
  here, so we have plenty of opportunities to create funny deadlock
  scenarios.

I think synchronization is a wholesale different problem from data
sharing and should be tackled as an orthogonal problem.

Now we could demand that prepare/finish may only ensure cache
coherency (as Rob intended), but that runs up into the next problem:
We not only need mmap support to facilitate sw-only processing nodes
in a pipeline (without jumping through hoops by importing the dma_buf
into some sw-access only importer), which allows for a nicer
ION->dma-buf upgrade path for existing Android userspace. We also need
mmap support for existing importing subsystems to support existing
userspace libraries. And a loot of these subsystems are expected to
export coherent userspace mappings.

So prepare/finish can only ever be optional and the exporter /needs/
to support coherent mappings. Given that mmap access is always
somewhat fallback-y in nature I've decided to drop this optimization,
instead of just making it optional. If we demonstrate a clear need for
this, supported by benchmark results, we can always add it in again
later as an optional extension.

Other differences compared to Rob's RFC is the above mentioned support
for mapping a dma-buf through facilities provided by the importer.
Which results in mmap support no longer being optional.

Note that this dma-buf mmap patch does _not_ support every possible
insanity an existing subsystem could pull of with mmap: Because it
does not allow to intercept pagefaults and shoot down ptes importing
subsystems can't add some magic of their own at these points (e.g. to
automatically synchronize with outstanding rendering or set up some
special resources). I've done a cursory read through a few mmap
implementions of various subsytems and I'm hopeful that we can avoid
this (and the complexity it'd bring with it).

Additonally I've extended the documentation a bit to explain the hows
and whys of this mmap extension.

In case we ever want to add support for explicitly cache maneged
userspace mmap with a prepare/finish ioctl pair, we could specify that
userspace needs to mmap a different part of the dma_buf, e.g. the
range starting at dma_buf->size up to dma_buf->size*2. This works
because the size of a dma_buf is invariant over it's lifetime. The
exporter would obviously need to fall back to coherent mappings for
both ranges if a legacy clients maps the coherent range and the
architecture cannot suppor conflicting caching policies. Also, this
would obviously be optional and userspace needs to be able to fall
back to coherent mappings.

v2:
- Spelling fixes from Rob Clark.
- Compile fix for !DMA_BUF from Rob Clark.
- Extend commit message to explain how explicitly cache managed mmap
  support could be added later.
- Extend the documentation with implementations notes for exporters
  that need to manually fake coherency.

Change-Id: Ia8f2ae5d8a1b1c87ed12ca1c89d7bf2067239ee4
Cc: Rob Clark <rob.clark@linaro.org>
Cc: Rebecca Schultz Zavin <rebecca@android.com>
Signed-Off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2012-05-22 14:01:06 -07:00
KyongHo Cho
9ae7e01de1 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.

Change-Id: I4fa9859f4a0b665fcb44e5c0da43c569732e93ae
Signed-off-by: KyongHo Cho <pullip.cho@samsung.com>
2012-05-22 14:01:05 -07:00