Commit Graph

10 Commits

Author SHA1 Message Date
Frank Chen
be31fa8edb nvidia-oot: Fix sparse errors for camera
Fix below sparse errors:
1. Unused variable.
2. Defined but not used function.
3. Symbol was not declared, should set it to static.
4. No newline at end of file.

Bug 3954363

Change-Id: I3395b66f9acfbf5206713e87063d0e70ad28b4d0
Signed-off-by: Frank Chen <frankc@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2878138
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-03-30 10:32:18 -07:00
Ankur Pawar
6b9c2cd8cc camera: oot: unmap buf in non atomic context
Call dma_buf_unmap_attachment from non atomic context.
This will resolve the kernel BUG warning that appears
when running argus tests, scf function tests and fusa
capture tests.

Bug 3953333

Change-Id: I9042b375856556fe5829981cb8aefd81e45b749b
Signed-off-by: Ankur Pawar <ankurp@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2875756
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Frank Chen <frankc@nvidia.com>
Reviewed-by: Ajith Kumar <ajithk@nvidia.com>
Reviewed-by: Sudhir Vyas <svyas@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-03-24 17:22:34 -07:00
Ankur Pawar
79aa81a101 camera: oot: sensor kernel test and tegracam log
The sensor kernel tests module is a simple test runner whose
responsibility is to dispatch tests and communicate with the
companion userspace binary over Generic Netlink sockets. Tests
may choose to register themselves with this module where they
then can be executed from userspace.

The sensor DT test asserts DT compliance of a given sensor node
with respect to a given TVCF version

A small set of logging utilities have been added to allow
tests the ability to log their results to the kernel log
or to some other handle (typically injected via the sensor
kernel tests module) through a common interface.

Bug 3583587

Change-Id: I22acf9c90fc82fbbdad8ba271dcdbbd6a5898eda
Signed-off-by: Ankur Pawar <ankurp@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2857293
Reviewed-by: Frank Chen <frankc@nvidia.com>
Reviewed-by: Semi Malinen <smalinen@nvidia.com>
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-03-24 17:07:38 -07:00
Ashish Mhetre
70f974fb19 camera: fusa-capture: Zero out dma_buf_map struct
UBSAN is reporting "invalid-load include/linux/dma-buf-map.h".
This is because non-boolean value loaded to bool variable is_iomem
of dma_buf_map struct. Zeroing out this struct at declaration time
make sure that there is no garbage value which will be non-boolean.

Bug 3994163

Change-Id: I3d20563f4e5ce28e2684bfb1be6f0fe8600dfc19
Signed-off-by: Ashish Mhetre <amhetre@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2869266
Tested-by: Bitan Biswas <bbiswas@nvidia.com>
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-03-11 19:21:36 -08:00
Ajith Kumar
a010f20be9 tegra: camera: fix iova address calculation
On SIPL stack, VI engine status memory which
is allocated by SIPL span across multiple memory
pages. IOVA calculations in KMD as per pinned
pages did not taken to account the multiple pages and
calculated IOVA based on first page base address.
This lead to VI falcon access the passed incorrect
iova address which caused Kernel OOPS at random places.

To fix this, calculate the IOVA based on adjusting
offset with respect to right page by traversing the
scatterlist. For older kernel versions(4.9) being used
in some android packages, the existing IOVA mappping is
kept as it is, as it doesn't support scatterlist.

Bug 3770879

Change-Id: I27d6850aaecbb1e095e836adee041f3f4747e2b7
Signed-off-by: Ajith Kumar <ajithk@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2800018
(cherry picked from commit d27f901f5e21380441f3d1afd19f1fdbd160b06f)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2799843
(cherry picked from commit 2856d6a5aa5a56f0a1c543ad6c2ba8373282c2c5)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2864345
Reviewed-by: Vincent Chung <vincentc@nvidia.com>
Reviewed-by: Bhushan Rayrikar <brayrikar@nvidia.com>
Reviewed-by: Igor Mitsyanko <imitsyanko@nvidia.com>
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
Reviewed-by: Frank Chen <frankc@nvidia.com>
Reviewed-by: Shiva Dubey <sdubey@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
Tested-by: Frank Chen <frankc@nvidia.com>
2023-03-09 03:19:42 -08:00
Ankur Pawar
5957f061b3 Camera: OOT: misc code fixes for drivers
1. Sensor deep power down and mclk enable
   and disable code.
2. Assign pads member in v4l2_subdev_state
   struct passed to v4l2_subdev_call.
3. emc and iso.emc clock are not available
   in K5.15. Disable clock get function.

Bug 3898807

Change-Id: If9e24ccd837af00df250571e6fc4c907886faf93
Signed-off-by: Ankur Pawar <ankurp@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2835934
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-02-15 23:54:02 -08:00
Ankur Pawar
8b04ed92cb camera: set CSI port-index when preparing graph
When preparing graph, device tree endpoints are
are found to be in reverse order. This leads to
incorrect csi port index associated with video
nodes. Read csi port while preparing graph and
assign it to tegra_channel struct.

Bug 3898807

Change-Id: I39af68386d85bc6299b164864e4503850d606e69
Signed-off-by: Ankur Pawar <ankurp@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2855852
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Frank Chen <frankc@nvidia.com>
Reviewed-by: Sudhir Vyas <svyas@nvidia.com>
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-02-15 15:56:41 -08:00
Jon Hunter
c86c642f5b media: camera: Fix build for Linux v5.16+
Building the Tegra camera drivers with Linux v5.16+ kernels fail because
the driver does not use the correct kernel version for handling various
API changes in upstream. Update ther kernel version appropriately so
that the camera drivers can build with Linux v5.16+ kernels.

Change-Id: I4c110d12f554fd4aa757a1aa9a42a81be5a87ae6
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2831219
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-01-04 06:51:52 -08:00
Frank Chen
ed8b9ea701 media: camera: update kernel config checks
kernel drivers can be built as built-in (=y) or module
(=m). The old ways of checking a driver is enabled or
not is to use "#if define(CONFIG_XXX)" for built-in and
"#if defined(CONFIG_xxx_MODULE)" for module.

Switch to the new IS_ENABLED() macro which can check
a driver is configured as built-in or module.

Jira CAMERASW-10141

Change-Id: I9b7e3e911a587da19ca56cdc5ef610d9b4c52850
Signed-off-by: Frank Chen <frankc@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2828089
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Igor Mitsyanko <imitsyanko@nvidia.com>
Reviewed-by: Ankur Pawar <ankurp@nvidia.com>
Reviewed-by: Matti Ryttylainen <mryttylainen@nvidia.com>
Reviewed-by: Shiva Dubey <sdubey@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2022-12-16 03:34:49 -08:00
Frank Chen
92ac7bc35a media: camera: Build tegra-camera as OOT module
Port camera drivers below from /kenrel/nvidia to
/kernel/nvidia-oot as OOT modules:
- Fusa-capture driver
- Tegra V4L2 framework driver
- vi/csi driver
- tegra camera platform driver

Change-Id: I390af27096425bb11e0934201dd1a90f001bb3fa
Signed-off-by: Frank Chen <frankc@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2780698
Reviewed-by: FNU Raunak <fraunak@nvidia.com>
Reviewed-by: Ankur Pawar <ankurp@nvidia.com>
Reviewed-by: Shiva Dubey <sdubey@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2022-12-13 06:15:42 -08:00