summaryrefslogtreecommitdiff
path: root/drivers/video/tegra/host/bus_client.c
AgeCommit message (Collapse)Author
2013-06-12video: tegra: nvmap: export symbols to build tegra_v4l2_camera modulePiotr Zierhoffer
2012-12-17tegra: Add function to release resourcesAndrew Chew
Add a companion function to nvhost_client_device_get_resources() called nvhost_client_device_put_resources() that does the opposite thing. This is useful for any nvhost clients that need to be loaded as modules, since the driver removal path will be exercised in that case. Change-Id: Ib5cec6fce7b05c780b135b03fcd88e068f772244 Signed-off-by: Andrew Chew <achew@nvidia.com> Signed-off-by: Bryan Wu <pengw@nvidia.com> Reviewed-on: http://git-master/r/169833 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Winnie Hsu <whsu@nvidia.com>
2012-08-22video: tegra: host: Fix crash if allocation failsTuomas Tynkkynen
nvhost_module_remove_client assumes that a client structure to be freed exists in the linked list. However, if an allocation fails in nvhost_module_add_client, no client structure is allocated, and during cleanup, nvhost_module_remove_client would then attempt to free an invalid pointer. Bug 1034729 Change-Id: Ie1a641071b86f8246951e9be824a6003f14b04b6 Signed-off-by: Tuomas Tynkkynen <ttynkkynen@nvidia.com> Reviewed-on: http://git-master/r/124096 Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com> Reviewed-by: Juha Tukkinen <jtukkinen@nvidia.com>
2012-06-14video: tegra: host: Parametrize host1xTerje Bergstrom
Add parameters in host1x nvhost_device on * number of sync points * number of wait bases * number of channels * number of mlocks * client managed bitmask * naming of sync points Add automatically generated headers and use symbols from them to access hardware. Move host1x device definition from generic host1x to SoC specific source files t20.c and t30.c. Bug 982965 Change-Id: Ibec84be22d75b363900d10bcbd59d4d8321d54a1 Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com> Reviewed-on: http://git-master/r/104974 Reviewed-by: Juha Tukkinen <jtukkinen@nvidia.com>
2012-06-11video: tegra: host: Add config option for timeoutTerje Bergstrom
Add configuration variable for default timeout for clients. Set it to 30s for silicon and infinity for simulation. Change-Id: I08c1fd234f738c4919adfe482dfc50948dc2f862 Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com> Reviewed-on: http://git-master/r/105331 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Juha Tukkinen <jtukkinen@nvidia.com>
2012-06-11video: tegra: host: Abstract nvmap supportTerje Bergstrom
Abstract nvmap support to one file, and use it via function pointers from other parts of nvhost. Bug 965206 Change-Id: I4e5e7de4271e0797d117ac8210af4732b6018973 Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com> Reviewed-on: http://git-master/r/105665 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Mayuresh Kulkarni <mkulkarni@nvidia.com> Reviewed-by: Juha Tukkinen <jtukkinen@nvidia.com>
2012-06-04video: tegra: host: Remove error case panicsTerje Bergstrom
Remove BUG_ON()s in error cases: * If IOCTL size is too large, return error instead * If sync point id is out of range, return error. Prevents panics in sanity checks nvhost_cdma. Bug 993642 Change-Id: I3cfa7a23dc557c811e20b726885f82666437de7f Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com> Reviewed-on: http://git-master/r/105866 Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit Reviewed-by: Juha Tukkinen <jtukkinen@nvidia.com>
2012-06-03video: tegra: host: Restrict register accessTerje Bergstrom
Register access (read/write) to modules MPE, ISP and VI lack sanity check for the register number. Add checks to ensure only aperture is accessed. Also make sure that the check accounts for wrapping of values of offset and count. Also fixes the register offset for reads which are done in multiple blocks. Bug 992938 Change-Id: I35f30cbd1dda31956286e48c5995b24fd262d1ae Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com> Reviewed-on: http://git-master/r/105585 Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit
2012-05-31video: tegra: host: Use correct units in default timeoutTerje Bergstrom
Convert the jiffies to msecs when assigning a channel the default timeout. Change-Id: If9b6fb7c695e9621a0c50d99d4d1362b6dd214b6 Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com> Reviewed-on: http://git-master/r/105022 Reviewed-by: Rohan Somvanshi <rsomvanshi@nvidia.com> Tested-by: Rohan Somvanshi <rsomvanshi@nvidia.com>
2012-05-31video: tegra: host: Fix error case memory leaksTerje Bergstrom
When a submit fails, the related nvhost_job is not freed. Add an explicit free. Also, 3D is mapping the save buffer, but it is not unmapped. Bug 991972 Change-Id: Ie335adb5e64f54557e76d12dfb6a9a1557781e8d Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com> Reviewed-on: http://git-master/r/105152 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-29video: tegra: host: Throttle lower priority jobsTerje Bergstrom
Implement per channel counter for jobs in each priority level. If there are jobs active with higher priority than the one being submitted, throttle. Bug 926690 Change-Id: I5fed341e3f248325873b31d1c53bf57bf0a78074 Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com> Reviewed-on: http://git-master/r/104939 Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit Reviewed-by: Juha Tukkinen <jtukkinen@nvidia.com> Reviewed-by: Mayuresh Kulkarni <mkulkarni@nvidia.com>
2012-05-25video: tegra: host: Replace nvmap structs with ownTerje Bergstrom
Replace usage of nvmap_pinarray_elem with own nvhost_reloc and nvhost_reloc_shift structs. Bug 965206 Change-Id: I90618d8a34d79156d8880d9925dadbf416353811 Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com> Reviewed-on: http://git-master/r/104450 Reviewed-by: Juha Tukkinen <jtukkinen@nvidia.com> Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Mayuresh Kulkarni <mkulkarni@nvidia.com>
2012-05-25video: tegra: host: Merge waitchk and relocationTerje Bergstrom
Job pinning and relocation already maps the gather buffers to kernel memory. Move waitchk to be done at the same time so that we do not need to re-map the memory to patch expired waits. Bug 965206 Change-Id: I23634b501a45de080200e57d3debf267b39fea38 Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com> Reviewed-on: http://git-master/r/104415 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Juha Tukkinen <jtukkinen@nvidia.com> Reviewed-by: Mayuresh Kulkarni <mkulkarni@nvidia.com>
2012-05-24video: tegra: host: rewrite nvhost_job_pin/unpin APIsMayuresh Kulkarni
- remove usage of custom interface of nvmap to patch the relocs and and pin the gathers/relocs - convert code that references nvmap_handle to nvmap_handle_ref - add logic to pin and map only unique gathers and relocs - rename nvhost_channel_gather to nvhost_job_gather, because it's used in nvhost_job code only Bug 965206 Change-Id: Iaa7fbac9e4a7b08c0a7c1e184b8dd3566e1edfe2 Signed-off-by: Mayuresh Kulkarni <mkulkarni@nvidia.com> Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com> Reviewed-on: http://git-master/r/95299 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Juha Tukkinen <jtukkinen@nvidia.com>
2012-05-18video: tegra: host: 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: I9a44471dc77d1ed7aa3b6e61a5eca4833fe6dc25 Signed-off-by: Krishna Reddy <vdumpa@nvidia.com> Reviewed-on: http://git-master/r/102721 Reviewed-by: Rohan Somvanshi <rsomvanshi@nvidia.com> Tested-by: Rohan Somvanshi <rsomvanshi@nvidia.com>
2012-05-17video: tegra: host: Do not panic on hardware timeoutTerje Bergstrom
nvhost panics if hardware does not respond within 30 seconds. Remove this behavior, as it causes problems in emulation and simulation. Panic should be used only to prevent corruption. Submits are now given a default timeout of 30 seconds. The clients can still override with their own timeout value. MPE doesn't provide the number of slots for context save/restore. This information is needed to be able to use the submit timeout for MPE. Bug 982946 Change-Id: I0f54d639df0fb726cc3163b317bf9c90bf56798b Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com> Reviewed-on: http://git-master/r/100246 Reviewed-by: Rohan Somvanshi <rsomvanshi@nvidia.com> Tested-by: Rohan Somvanshi <rsomvanshi@nvidia.com>
2012-05-17video: tegra: host: remove nvhost_channel from nvhost_masterMayuresh Kulkarni
- nvhost_master holds a reference to all the channels for a chip architecture - however, nvhost_master is a private data of host1x hardware device. so it should contain only members needed by host1x hardware device - add chip specific apis to allocate and free channels - this will also help to remove the static binding between nvhost_device and a channel per SoC in future Bug 871237 Change-Id: I2148db57b995b4cb60954ebb6e670f588552eca4 Signed-off-by: Mayuresh Kulkarni <mkulkarni@nvidia.com> Reviewed-on: http://git-master/r/91687 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
2012-05-11video: tegra: host: move chip_support out of nvhost_masterMayuresh Kulkarni
- currently, nvhost_master holds the reference to struct chip_support - the struct chip_support hides the chip specific implementation for channel submit, cdma, push buffer operations etc. so it exposed all the internal structures through nvhost_master - move chip_support to be a part of nvhost_bus since it only has function pointers to chip specific api implementations - nvhost_master is host1x device specific private data so ideally it should not hold reference to chip specifics Bug 871237 Change-Id: I4f3f48ee5fc47a90288d110ea8eef905150275a0 Signed-off-by: Mayuresh Kulkarni <mkulkarni@nvidia.com> Reviewed-on: http://git-master/r/94421 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com> GVS: Gerrit_Virtual_Submit
2012-05-10video: tegra: host: Add context switch to trace dumpTerje Bergstrom
Add context switch to the ftrace dump. Change-Id: I5df032273982b919fb94263cff38d8b8b6b6be45 Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com> Reviewed-on: http://git-master/r/101523 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Mayuresh Kulkarni <mkulkarni@nvidia.com> Reviewed-by: Juha Tukkinen <jtukkinen@nvidia.com>
2012-05-08video: tegra: host: Iterate devices without nb_channelsTerje Bergstrom
Do not use nb_channels to find out the number of client devices. Instead, allocate devno regions when they are needed and find a device by module id by iterating over nvhost bus. Bug 871237 Change-Id: I53fd0d8e5874422ef9877430c0a170db2660118a Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com> Reviewed-on: http://git-master/r/99067 Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit Reviewed-by: Juha Tukkinen <jtukkinen@nvidia.com>
2012-05-04video: tegra: host: Clean up includesTerje Bergstrom
Clean up #includes. Replace #includes with forward declarations where possible, and remove extraneous #includes. Bug 871237 Change-Id: I6942e0c632b42ad7009589ebdd78def88ae4baa4 Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com> Reviewed-on: http://git-master/r/99046 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-04-10video: tegra: host: move resources to devicesMayuresh Kulkarni
- as of now the resources needed by all the host1x modules are part of resource list of host1x device - now that each module is a nvhost_device of its own, so it should hold the resources it needs instead of host1x device holding it for them - each device that needs its resources gets it in its _probe() using a helper API in bus_client.c Bug 871237 Change-Id: Ia7c63fcf40cbc5db76d4d8339294a0e9ce75e352 Signed-off-by: Mayuresh Kulkarni <mkulkarni@nvidia.com> Reviewed-on: http://git-master/r/94166 Reviewed-by: Simone Willett <swillett@nvidia.com> Tested-by: Simone Willett <swillett@nvidia.com>
2012-04-03video: tegra: host: api clean-upMayuresh Kulkarni
- remove redundant 2nd argument to nvhost_module_suspend() - also remove the debug_not_idle() as it redundant after refactor of host1x code - debug_not_idle() iterates through host1x's private instance of channels to find out which client module is active (along with host1x itself). we are going to remove these instances of channels from host1x's device private data - reduce the prints during suspend Bug 871237 Change-Id: I66c7c4d8f35c157b1626784a6a27166442a50557 Signed-off-by: Mayuresh Kulkarni <mkulkarni@nvidia.com> Reviewed-on: http://git-master/r/92550 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
2012-03-30video: tegra: host: do not assume 3d channel opened by user spaceMayuresh Kulkarni
- if user space does not open 3d channel, 3d scaling algorithm is not initialized. so return safely when 3d scaling is disabled - also do not call nvhost_module_suspend() explicitly for host1x client modules. nvhost_channel_suspend() takes care to suspend the module if ref count = 0 - call nvhost_module_suspend() only for host1x device as it does not use actual hardware channel Bug 953451 Change-Id: Iba2b771b71d9b41c8ed978112566181872c56259 Signed-off-by: Mayuresh Kulkarni <mkulkarni@nvidia.com> Reviewed-on: http://git-master/r/92506 Reviewed-by: Automatic_Commit_Validation_User Tested-by: Peer Chen <pchen@nvidia.com> Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com> Reviewed-by: Emily Jiang <ejiang@nvidia.com>
2012-03-23video: tegra: host: Split submit into subfunctionsTerje Bergstrom
Split host1x_channel_submit() into subfunctions. Bug 926690 Change-Id: I8be55cbc9d25ee76c758a918de4a9bb27e2ea846 Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com> Reviewed-on: http://git-master/r/90626 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Mayuresh Kulkarni <mkulkarni@nvidia.com> Reviewed-by: Juha Tukkinen <jtukkinen@nvidia.com>
2012-03-21video: tegra: host: refactor for upstreamingMayuresh Kulkarni
- split the nvhost clients into their own directories - each client is a nvhost_device and nvhost_driver - all the code related to host1x control node is centralized at single place in dev.c - all the code related to host1x modules nodes is centralized at single place in bus_client.c - update the copyright notice & year for new files Bug 871237 Change-Id: Ief85064699e35ad02b48a7e54496928d7f085af4 Signed-off-by: Mayuresh Kulkarni <mkulkarni@nvidia.com> Reviewed-on: http://git-master/r/83491 Reviewed-by: Rohan Somvanshi <rsomvanshi@nvidia.com> Tested-by: Rohan Somvanshi <rsomvanshi@nvidia.com>
2012-03-15video: tegra: host: Replace license informationTerje Bergstrom
Replace license information in nvhost with GPLv2. Also adds copyright year 2012 in files which have been changed in 2012. Change-Id: I86e8ed27095df13d99e0250e57e244d531fdacec Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com> Reviewed-on: http://git-master/r/89735 Reviewed-by: Rohan Somvanshi <rsomvanshi@nvidia.com> Tested-by: Rohan Somvanshi <rsomvanshi@nvidia.com>
2012-01-30video: tegra: host: CPU reg read to use power managementTerje Bergstrom
CPU register read did not have access to nvhost power management. Due to this only modules that were powered on previously are actually accessible via the API. This patch refactors CPU access to: * Move mutexes to sync point, as they're sync point operations * Move register address spaces to nvhost_device * Call register read with access to the respective nvhost_device * Initialize module completely at boot-up so that register reads can be done without an initialized channel. Reviewed-on: http://git-master/r/75275 Change-Id: I0db38cef7b2cd92dc64e7f55d227bdd2fdb8f752 Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com> Signed-off-by: Varun Wadekar <vwadekar@nvidia.com> Reviewed-on: http://git-master/r/77764 Reviewed-by: Automatic_Commit_Validation_User