summaryrefslogtreecommitdiff
path: root/drivers/video/tegra/nvmap/nvmap.c
AgeCommit message (Collapse)Author
2015-01-16Merge remote-tracking branch 'remotes/nvidia/l4t/l4t-r16-r2' into tegra-nextMarcel Ziswiler
(tegra-l4t-r16-16.5) Conflicts: drivers/media/video/tegra_v4l2_camera.c drivers/mmc/host/sdhci.c drivers/watchdog/tegra_wdt.c include/media/tegra_v4l2_camera.h
2014-07-31video: tegra: nvhost: validate nvmap_handle_refBibek Basu
nvhost_job_unpin should always get the nvmap_handle_ref from rb_entry after validating handle and presence in the tree. Bug 1478467 Change-Id: Ibf5f64a1a82fea8adbf7500bdb36b76357776448 Signed-off-by: Bibek Basu <bbasu@nvidia.com> Reviewed-on: http://git-master/r/436076 Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit Reviewed-by: Venkat Moganty <vmoganty@nvidia.com> Reviewed-by: Matthew Pedro <mapedro@nvidia.com>
2013-06-12video: tegra: nvmap: export symbols to build tegra_v4l2_camera modulePiotr Zierhoffer
2012-12-17tegra: Add nvmap_mark_global()Andrew Chew
Add this function, to be able to set the global field of an nvmap_handle while preserving the nvmap API's encapsulation mechanisms. Change-Id: I62de773a65119722f059b114e2d0e906c7e04e83 Signed-off-by: Andrew Chew <achew@nvidia.com> Signed-off-by: Bryan Wu <pengw@nvidia.com> Reviewed-on: http://git-master/r/169834 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Winnie Hsu <whsu@nvidia.com>
2012-08-10video: tegra: nvmap: fix usermode input validationTuomas Tynkkynen
nvmap_pin_ids accepts a list of handles to pin, which are passed directly from usermode when called from nvmap_ioctl_pinop. However, if invalid handles are passed in, the function might still access them as valid handles, and cause a crash. Bug 1023954 Change-Id: I6b98a2ef448bb496be7d569ddd4fb516fc399cba Signed-off-by: Tuomas Tynkkynen <ttynkkynen@nvidia.com> Reviewed-on: http://git-master/r/119667 Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit Reviewed-by: Juha Tukkinen <jtukkinen@nvidia.com>
2012-05-29video: tegra: nvmap: Remove nvhost specific APIsTerje Bergstrom
Remove nvmap_pin_array() and nvmap_patch_word() and their utility functions. Bug 965206 Change-Id: I217a427934b0b99b5252b33ab3ac4eaaa8c7e076 Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com> Reviewed-on: http://git-master/r/104451 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Mayuresh Kulkarni <mkulkarni@nvidia.com> GVS: Gerrit_Virtual_Submit Reviewed-by: Juha Tukkinen <jtukkinen@nvidia.com>
2012-05-18video: tegra: nvmap: Use nvmap.h include file from kernel/includeKrishna Reddy
Use nvmap.h include file from kernel/include instead of mach-tegra/include. Bug 854182 Change-Id: I385657f45483f2696e99fc2b4ed934fef5decd1e Signed-off-by: Krishna Reddy <vdumpa@nvidia.com> Reviewed-on: http://git-master/r/102720 Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit Reviewed-by: Jon Mayo <jmayo@nvidia.com>
2012-03-20arm: tegra: nvmap: Update nvmap_alloc api.Krishna Reddy
Update nvmap_alloc api to take heap_mask as arg. This is to let clients specify the specific heap needed. Change-Id: I9950b3e60e6dac0301b6dc66be3e9d0bab8e0fee Signed-off-by: Krishna Reddy <vdumpa@nvidia.com> Reviewed-on: http://git-master/r/90471 Reviewed-by: Scott Williams <scwilliams@nvidia.com> Reviewed-by: Automatic_Commit_Validation_User
2011-12-08video: tegra: host: Support for right shift on reloc patchesTerje Bergstrom
Some hardware architectures require that only select MSB bits be supplied to them for addresses. They do the reverse transformation while accessing the actual memory. Bug 857531 Change-Id: I215f099ff0ee86daff1c1eb1e5b70edf8ae856d9 Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com> Reviewed-on: http://git-master/r/66654 Reviewed-by: Yu-Huan Hsu <yhsu@nvidia.com> Reviewed-by: Shashank Garg <sgarg@nvidia.com>
2011-11-30video: tegra: nvmap: handle free null conditionsKen Adams
Original-Change-Id: I75e88d6cef2daf625c6ede38a937207b95e2b84c Reviewed-on: http://git-master/r/44364 Reviewed-by: Ken Adams <kadams@nvidia.com> Tested-by: Ken Adams <kadams@nvidia.com> Reviewed-by: Krishna Reddy <vdumpa@nvidia.com> Rebase-Id: Rd79c4aac3d3e03e601be5b35934fe36a35cd358f
2011-11-30video: tegra: nvmap: fix GART pin lockupsKirill Artamonov
Fix GART lockups caused by fragmentation by evicting mapped areas from iovm space after unsuccessful array pinning attempt. Fix double unpin error happening during interrupted submit. Fix possible sleep in atomic context in iovmm code (semaphore inside spinlock) by replacing spinlock with mutex. Fix race between handle_unpin and pin_handle. bug 838579 bug 838073 bug 818058 Original-Change-Id: I420447ffb4e02fb78a7987e22a537eefc16ff524 Reviewed-on: http://git-master/r/36129 Reviewed-by: Varun Colbert <vcolbert@nvidia.com> Tested-by: Varun Colbert <vcolbert@nvidia.com> Rebase-Id: R893c97003f2ec2f69e224f35d99d3488f673d620
2011-11-30video: tegra: nvmap: free vm_struct in nvmap_munmap()kenjchen
In nvmap_munmap(), remove_vm_area just remove the allocated memory page information. It doesn't de-allocate vm_struct. kfree() should be used to avoid memory leak in nvmap. Bug: 833796 Original-Change-Id: Ibd0309c1ff323fb8110870ace27819f5a1e006ba Reviewed-on: http://git-master/r/35638 Reviewed-by: Niket Sirsi <nsirsi@nvidia.com> Tested-by: Niket Sirsi <nsirsi@nvidia.com> Rebase-Id: R417df608c4a24667af81f328bfb65cf3389e19ae
2011-11-30nvrm: move stale wait checking into the kernelChris Johnson
The kernel now receives wait tracking data (similar to gathers and relocs) and compares the current syncpt with the threshold value. If it's old, it gets a kernel mapping and rewrites the method data to use a kernel reserved syncpt that is always 0 (so trivially pops when seen by the HW). Bug 519650 Bug 785525 Bug 803452 The waitchk implementation is also backward compatible with older user space code that didn't supply waitchk data as part of the submit. (cherry picked from commit 4069d8e67665624ad3dceb628e572980dd57acd0) (cherry picked from commit 6e4336408588e348804a62e53386acc9abc06823) (cherry picked from commit 87a9efe751716ca741caac72b9061fdfdcec540a) (cherry picked from commit 6d8d2c454e835f7cfe34371e07dac173f3153452) Original-Change-Id: I1bf4c940fefb6e251aa8c396e92631fa3cbe32df Reviewed-on: http://git-master/r/23159 Reviewed-on: http://git-master/r/30281 Reviewed-on: http://git-master/r/32669 Reviewed-by: Niket Sirsi <nsirsi@nvidia.com> Tested-by: Niket Sirsi <nsirsi@nvidia.com> Rebase-Id: Rbad4942a103de7d64d8a6a11d4a973740c56fa8e
2011-11-30video: tegra: nvmap: Add support to allocate specific IOVMvdumpa
Original-Change-Id: I95cdf71e74947d4394e0cfd272a29c47562d4059 Reviewed-on: http://git-master/r/31648 Reviewed-by: Niket Sirsi <nsirsi@nvidia.com> Tested-by: Niket Sirsi <nsirsi@nvidia.com> Rebase-Id: Rb8c6f92bdfd0bf124a878800a793828fa61c0043
2011-11-30ARM: tegra: Use proper type for physical addressesScott Williams
Original-Change-Id: I158d2be97c795313e7e74ce9fb4ec0bdc7d95496 Reviewed-on: http://git-master/r/27559 Tested-by: Scott Williams <scwilliams@nvidia.com> Reviewed-by: Hiro Sugawara <hsugawara@nvidia.com> Reviewed-by: Jin Qian <jqian@nvidia.com> Reviewed-by: Kaz Fukuoka <kfukuoka@nvidia.com> Reviewed-by: Scott Williams <scwilliams@nvidia.com> Original-Change-Id: I0ff198daa548ed2837f7fb1794013bf0adf7e5a1 Rebase-Id: R83df5f3b5104183bfe774d8eed8ce94427c9b7fc
2011-11-30video: tegra: nvmap: fix potential deadlockKirill Artamonov
Enabled mutex debugging reavealed potential deadlocks introduced with compaction. Handle spin lock replaced with mutex. Heap functions cannot be protected with spinlock because they call kernel slab allocation functions which cannot be called from atomic context. nvmap_client ref_lock is also replaced with mutex. Otherwise we cannot access heap parameters protected by mutex nvmap_handle lock. Extra locking for handle->owner removed. bug 793364 Original-Change-Id: I635ce9ebf259dd7bf8802457567f93b7be5795ea Reviewed-on: http://git-master/r/19850 Reviewed-by: Kirill Artamonov <kartamonov@nvidia.com> Tested-by: Kirill Artamonov <kartamonov@nvidia.com> Reviewed-by: Daniel Willemsen <dwillemsen@nvidia.com> Rebase-Id: Reaa132703e278d75371d5e2b25426794aa8e0e4e
2011-11-30video: tegra: nvmap: replace mutex with spinlockKirill Artamonov
There are places where nvmap_free_handle_id is called when interrupts are disabled and mutex cannot be used as nvmap handle lock. Original-Change-Id: Icc220fe627c08f21c677d936a54f70c818dc8e8c Reviewed-on: http://git-master/r/19489 Reviewed-by: Varun Colbert <vcolbert@nvidia.com> Tested-by: Varun Colbert <vcolbert@nvidia.com> Rebase-Id: Rb5a58e8226ad14340d1acae007d6b632960fae16
2011-11-30nvmap: implementing K36 carveout compactorKirill Artamonov
bug 762482 Original-Change-Id: Ifadebc1b0c4eb0df89e179091acca0ff6e527e56 Reviewed-on: http://git-master/r/15743 Reviewed-by: Kirill Artamonov <kartamonov@nvidia.com> Tested-by: Kirill Artamonov <kartamonov@nvidia.com> Reviewed-by: Varun Colbert <vcolbert@nvidia.com> Rebase-Id: R639e7f09f44c8919bd57a16a577b87db91160555
2011-11-30Revert "Revert "Revert "tegra: host: move stale wait checking into the kernel"""Nitin Kumbhar
This reverts commit be7b9ce20d645c2c9293441830ee33a0a5fc489f. Rebase-Id: R34033f7a7ed72aeb1e2a83ad5a09c219d3254048
2011-11-30video: tegra: nvmap: remove smp_lock includeColin Cross
Change-Id: I51fe70b92f256951e68c6bbd21e6b4d6081f4731
2011-11-30Revert "Revert "tegra: host: move stale wait checking into the kernel""Rebecca Schultz Zavin
This reverts commit b3cc1d84d0b962fe80fc297d2e2417c3157508b6.
2011-11-30Revert "tegra: host: move stale wait checking into the kernel"Rebecca Schultz Zavin
This reverts commit 2d49bf33f3885aab293f12d54447f66e911e3226.
2011-11-30tegra: host: move stale wait checking into the kernelPrajakta Gudadhe
The kernel now receives wait tracking data (similar to gathers and relocs) and compares the current syncpt with the threshold value. If it's old, it gets a kernel mapping and rewrites the method data to use a kernel reserved syncpt that is always 0 (so trivially pops when seen by the HW). Patch has dependency to the user-space patches Submitted on behalf of: Chris Johnson <cjohnson@nvidia.com> original work by: Chris Johnson <cjohnson@nvidia.com> Change-Id: I4d4e5d3b49cab860485c4172f87247f5b4f5ea6e
2011-11-30video: tegra: nvmap: Fix broken optimizationkartamonov
An attempt had been made to reduce the number of pte operations while patching relocs. The optimization was incorrectly coded and was not providing the expected speedup. Credit for the find goes to Peter Pipkorn. Change-Id: Ic83b20ee470e54d5053f747dbcbdf7b038b7c7c4 Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com>
2011-11-30video: tegra: nvmap: Add logging to some error conditionsRebecca Schultz Zavin
Change-Id: I1ec34fd4a6bb21a6d84912a7228c209f459261be Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com>
2011-11-30video: tegra: nvmap: Remove warning from nvmap_pinRebecca Schultz Zavin
The framebuffer driver needs to be able to arbitrarily pin whatever gets handed to it. Regardless of the interface used, functions need to unpin as soon as they finish using the gart anyway. Change-Id: Ida8aea2fb6eaca8bcbf3ae72f8dfa849dc198542 Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com>
2011-11-30video: tegra: nvmap: eliminate arm_attrib_allocator dependencyGary King
remove the dependency that nvmap has on the arm_attrib_allocator and the lowmem in PTEs change by adding a private page allocator utility function and calling vm_map_ram unconditionally for all sysmem handles. also, add Kconfig variables to allow platforms to disallow the SYSMEM heap, and to optionally restrict the SYSMEM and IOVMM heaps to just HIGHMEM. Change-Id: I3dab1c7323f54a8ab3994dc672b27fd79a9057d7 Signed-off-by: Gary King <gking@nvidia.com>
2011-11-30video: tegra: nvmap: fix read failures, super user and noref pinningGary King
a >= vs > error when checking the operating region of the read and write ioctls was causing failures when reading the last byte of a handle. the super-user node (knvmap) wasn't registered correctly due to a cut- and-paste error, and the regular user node was assigned super-user priveleges. noref pinning wasn't correctly validating that the specified handle existed before pinning it, which caused the reference count for the handle to become imbalanced on a subsequent unpin Change-Id: I9985b85023705b00389a53fb962c3b60d62da6b8 Signed-off-by: Gary King <gking@nvidia.com>
2011-11-30video: tegra: add GPU memory management driver (nvmap)Gary King
nvmap provides an interface for user- and kernel-space clients to allocate and access memory "handles" which can be pinned to enable the memory to be shared with DMA devices on the system, and may also be mapped (using caller-specified cache attributes) so that they are directly accessible by the CPU. the memory handle object gives clients a common API to allocate from multiple types of memory: platform-reserved physically contiguous "carveout" memory, physically contiguous (order > 0) OS pages, or physically discontiguous order-0 OS pages that can be remapped into a contiguous region of the DMA device's virtual address space through the tegra IOVMM subsystem. unpinned and unmapped memory handles are relocatable at run-time by the nvmap system. handles may also be shared between multiple clients, allowing (for example) a window manager and its client applications to directly share framebuffers Change-Id: Ie8ead17fe7ab64f1c27d922b1b494f2487a478b6 Signed-off-by: Gary King <gking@nvidia.com>