Commit Graph

1642 Commits

Author SHA1 Message Date
Sakari Ailus 0daf8a201b media: v4l: event: Prevent freeing event subscriptions while accessed
commit ad608fbcf166fec809e402d548761768f602702c upstream.

The event subscriptions are added to the subscribed event list while
holding a spinlock, but that lock is subsequently released while still
accessing the subscription object. This makes it possible to unsubscribe
the event --- and freeing the subscription object's memory --- while
the subscription object is simultaneously accessed.

Prevent this by adding a mutex to serialise the event subscription and
unsubscription. This also gives a guarantee to the callback ops that the
add op has returned before the del op is called.

This change also results in making the elems field less special:
subscriptions are only added to the event list once they are fully
initialised.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Hans Verkuil <hans.verkuil@cisco.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: stable@vger.kernel.org # for 4.14 and up
Fixes: c3b5b0241f ("V4L/DVB: V4L: Events: Add backend")
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-07-27 21:51:55 +02:00
LuK1337 4e71469c73 Merge tag 'LA.BR.1.3.6-03510-8976.0' into HEAD
Change-Id: Ie506850703bf9550ede802c13ba5f8c2ce723fa3
2017-04-18 12:11:50 +02:00
LuK1337 fc9499e55a Import latest Samsung release
* Package version: T713XXU2BQCO

Change-Id: I293d9e7f2df458c512d59b7a06f8ca6add610c99
2017-04-18 03:43:52 +02:00
VijayaKumar T M 15ebca59d1 msm: camera: sensor: Validate eeprom_name string length
Validate eeprom_name string length before copying into
the userspace buffer.
If more data than required is copied, userspace has the access to
some of kernel data which is not intended.

This change will fix this issue.

CRs-Fixed: 1090007
Change-Id: Id40a287e0b1a93cc15d9b02c757fe9f347e285f2
Signed-off-by: Rajesh Bondugula <rajeshb@codeaurora.org>
Signed-off-by: VijayaKumar T M <vtmuni@codeaurora.org>
2016-11-24 23:17:43 -08:00
VijayaKumar T M 40c8eed53a msm: camera: Change MAX_CID_CH macro to 3
Modify macro MAX_CID_CH to 3 as vfe can support maximum 3
CID_CH at an instance.

CRs-Fixed: 1064689
Change-Id: Ibb993839c1057fb62f43e99df3bee8328a4c702f
Signed-off-by: Trishansh Bhardwaj <tbhardwa@codeaurora.org>
Signed-off-by: VijayaKumar T M <vtmuni@codeaurora.org>
2016-10-06 17:09:32 +05:30
Abhishek Kondaveeti 4ebd1b1f5f msm: isp: Add mono camera support
Add mono camera pixel pattern to configure
ISP for mono sensor.

Change-Id: I285941bdf3181155315508a98254f2b99e4415d5
Signed-off-by: Abhishek Kondaveeti <akondave@codeaurora.org>
2016-01-28 15:59:40 +05:30
Venu Yeshala 1fcc980000 msm: camera: isp: Add checks for list updates
Add changes to track buffer being added to list. Add error
messages if buffer is found to be added twice.

Change-Id: I1e10324710e9d6bc0eb594d289b123d78b035d3e
Signed-off-by: Venu Yeshala <vyeshala@codeaurora.org>
2015-11-18 00:41:20 -08:00
Abhishek Kondaveeti 2d9584c8a8 msm: isp: Fix offline isp
Issue reg update before starting fetch
engine.

Change-Id: If5667abe2f708e3187a0c97016f295fd8516b489
Signed-off-by: Abhishek Kondaveeti <akondave@codeaurora.org>
2015-11-08 01:40:59 -08:00
Linux Build Service Account 691251103e Merge "msm: camera: isp: Use HAL sent frameid for offline buffer" 2015-10-30 22:19:32 -07:00
Linux Build Service Account 1045df8582 Merge "msm📷isp: Sync Raw & Pixel frame IDs in case of offline ISP" 2015-10-30 22:19:32 -07:00
Linux Build Service Account 4ab01b3ffb Merge "msm: isp: Add offline stats stream bit" 2015-10-30 22:19:31 -07:00
Linux Build Service Account 71a4beebff Merge "msm: camera: isp: Provision to read svs freq for VFE" 2015-10-30 22:19:30 -07:00
Sagar Gore f968ac8bc6 msm: camera: isp: Use HAL sent frameid for offline buffer
In Offline reprocess, HAL sends reprocess frame id, which is
tagged with each offline request. When offline ISP sends
buffer to CPP/HAL they rely on tagged frame id to asssociate
the frame with meta/settings buffer. Change takes care of
using HAL sent frame id in offline request.

Change-Id: I138f0d2ad7350cc613f222b11b5cfb492166fb3e
Signed-off-by: Sagar Gore <sgore@codeaurora.org>
2015-10-30 14:52:46 -07:00
Sagar Gore 141828ec06 msm: camera: isp: Offline reprocess mode support
Adding support to map buffer in fetch engine driver on the fly.
This is needed for Offline reprocess mode of offline ISP.
Added ioctl to unmap buffer after fetch read done, which are
not part of any bufq/stream.

Change-Id: I25eb7e3fe6218b51f94a7f835393aa40eb1ad611
Signed-off-by: Sagar Gore <sgore@codeaurora.org>
2015-10-30 14:52:02 -07:00
Rajeev Kulkarni 062e988276 msm📷isp: Sync Raw & Pixel frame IDs in case of offline ISP
Incase of offline isp Raw frame ID need to synchronized  with
pixel frame id.

Change-Id: I95280fd96855a4dedb9cb0c64014e08beb4661f0
Signed-off-by: Rajeev Kulkarni <krajeev@codeaurora.org>
2015-10-29 17:13:57 -07:00
Sagar Gore 4be9ab573b msm: isp: Add offline stats stream bit
To distinguish between offline/online vfe stats
set a unique bit in offline stats stream id.

Change-Id: I960a63a19e5c65ba71e5bf53a0381213c1ad541d
Signed-off-by: Sagar Gore <sgore@codeaurora.org>
2015-10-29 14:26:45 -07:00
Rajeev Kulkarni 4d87ce58bc msm: camera: isp: Provision to read svs freq for VFE
This change gives way to read svs freq for certain targets
for which VFE's have svs freq defined.

Change-Id: I749327861e4392c6f3f24235c1e9b47b684f1362
Signed-off-by: Rajeev Kulkarni <krajeev@codeaurora.org>
2015-10-29 13:37:34 -07:00
Rajesh Bondugula bffab98c63 Revert "Revert "msm: camera: Add eeprom multi module design""
This gerrit adds the MM eeprom implementation.
This reverts commit 36dae9889b.

Change-Id: I6befeb4b6dc05dbea6de29db5aada102d1018ce8
Signed-off-by: Rajesh Bondugula <rajeshb@codeaurora.org>
2015-10-29 12:55:07 -07:00
Manikandan Anbu 36dae9889b Revert "msm: camera: Add eeprom multi module design"
This reverts commit 79bc4df814

Change-Id: I28a95665f609c2e458708d87d2c36448ab3d5f3f
Signed-off-by: Manikandan Anbu <manbu@codeaurora.org>
2015-10-26 22:50:35 -07:00
Viswanadha Raju Thotakura 79bc4df814 msm: camera: Add eeprom multi module design
Add eeprom slave related information in userspace driver
and propagate it to kernel for device probe. Probe happens
from camera daemon. This helps in reducing the boot time.

Change-Id: I92ab450cedece2b145f6c180009dcb7bcce85964
Signed-off-by: Viswanadha Raju Thotakura <viswanad@codeaurora.org>
2015-10-22 12:07:03 -07:00
Alok Kediya 4955a45b6b msm: isp: update stats AB/IB value
Calculate the AB/IB values in userspace and update in kernel.

Change-Id: I13c83e5e98f61a0552408e641b774a147a395baf
Signed-off-by: Alok Kediya <kediya@codeaurora.org>
2015-09-26 05:03:51 -07:00
Linux Build Service Account 337fc6295d Merge "msm: camera2: isp: KPI opt for bundling ioctls" 2015-09-05 21:56:50 -07:00
Senthil Kumar Rajagopal ac8e56a409 msm: camera2: isp: KPI opt for bundling ioctls
iface was doing multiple ioctls during camera preview start;
Changed to bundle all ioctl subscription into one single call

Change-Id: I60cbf9d957608ec1f437b42ec3a671c77280aa0c
Signed-off-by: Senthil Kumar Rajagopal <skrajago@codeaurora.org>
Signed-off-by: Alok Kediya <kediya@codeaurora.org>
2015-09-03 12:27:16 +05:30
Harsh Shah 64162a6b71 msm: camera: isp: Use only pingpong_bit instead of status
In Dual VFE mode, the 2 VFE can assign different WM to same user stream.
So when updating ping pong address, the pingpong_status can be different
for the 2 VFE. Use just the pingpong_bit along with each VFE WM number
to config ping pong to resolve the split in such a scenario.

Change-Id: I41a1ea8d443d061c5c2ee40d4ea0922456021192
Signed-off-by: Harsh Shah <harshs@codeaurora.org>
2015-08-24 21:17:20 -07:00
Maheshwar Ajja 0768bffc4c msm: vidc: free registered buffers when closing session
Free the registered buffers when closing instead of stopping
session to avoid NULL pointer access error if client tries to
dequeue buffer while stopping session.

Change-Id: Iecce727fe7f5afc0287e38904beb5855a6e11e02
Signed-off-by: Maheshwar Ajja <majja@codeaurora.org>
2015-08-24 00:00:07 -07:00
Harsh Shah 048cddf412 msm: camera: isp: Move delta info to sof_info structure
delta_info and output_info are both structures in a union that
are piggybacked to SOF event. Combine them so we can send all the info.
Add additional comments to the header files. Move the dual_vfe_res
to common_data as it is also shared resource between 2 VFE.

Change-Id: I6289625336fe4486508c2d32fb42bbd55214b941
Signed-off-by: Harsh Shah <harshs@codeaurora.org>
2015-08-03 17:43:50 -07:00
Mayank Parashar 4780943775 msm: camera: Add actuator deinit params for standby
Call deinit to put actuator in standby mode before
actuator power down which helps in reducing power
consumption.

Change-Id: I13b996b2aedff69ba9380629ff29f536bfe0b9a7
Signed-off-by: Mayank Parashar <mayankp@codeaurora.org>
2015-07-31 14:45:29 -07:00
Linux Build Service Account f0c0a455cb Merge "msm: camera: isp: Use max stream src based on VFE output" 2015-07-23 02:41:23 -07:00
Srinu Gorle ed8577e7e3 Revert "msm: vidc: Increase extradata size to 16k"
This reverts commit I6dbaf74a7f7939ae6aa516d01ede3d7119307818.

In new firmware version extn_userdata size has adjusted from 8240 bytes
to 7728 bytes. Hence decreasing default extradata size to 8k.

Change-Id: Id6965cc74b3b1d22e3a4240aad7fc8cb7bac9222
Signed-off-by: Srinu Gorle <sgorle@codeaurora.org>
2015-07-20 00:32:28 -07:00
Harsh Shah 69a87fe898 msm: camera: isp: Use max stream src based on VFE output
Stream info holds information about various axi outputs
but maximum streams VFE can output is limited by write masters.
Use correct macros to differentiate between two.

Change-Id: I264e8ef6b77e0f5a1fff1c7114d53d017375aa78
Signed-off-by: Sagar Gore <sgore@codeaurora.org>
Signed-off-by: Harsh Shah <harshs@codeaurora.org>
2015-07-16 01:35:45 -07:00
Harsh Shah 50628b59df msm: camera: isp: Update Slave frame_id based on Master
In master-slave mode, set Slave frame id = master frame id,
if the delta between the timestamp is < Threshold. If delta is
higher than threshold, slave frame_id = master + 1.

Change-Id: I68f1c5354334bc11795739836a9a75436bde38be
Signed-off-by: Harsh Shah <harshs@codeaurora.org>
2015-07-16 01:33:32 -07:00
Harsh Shah aac0e2cc58 msm: camera: isp: Add master-slave capability to vfe driver
Add dual_hw MASTER and SLAVE tags to vfe_src.
Add info to src on ioctl and remove it during stop_axi.
Also maintain the same info in common_data.
This change adds the framework needed to use VFE src in
Master-Slave mode.

Change-Id: I41b210ed1ff7a7d26510a78590e62f46f4a3ca1c
Signed-off-by: Harsh Shah <harshs@codeaurora.org>
2015-07-16 01:33:14 -07:00
Linux Build Service Account 9a271c5b53 Merge "msm: camera: isp adding variable to pix cfg for dual vfe" 2015-06-25 20:41:25 -07:00
Senthil Kumar Rajagopal c9b466b29d msm: camera: isp adding variable to pix cfg for dual vfe
Adding header changes for passing dual vfe info from userspace to
kernel.

Change-Id: I0fa03a4b87847d19ea63df4b7a188cc110801c4a
Signed-off-by: Senthil Kumar Rajagopal <skrajago@codeaurora.org>
2015-06-24 14:31:48 +05:30
Linux Build Service Account f54619af62 Merge "camera_v2: actuator: bivcm_set with infinity direction register value" 2015-06-18 07:09:01 -07:00
Soundrapandian Jeyaprakash da12887214 camera_v2: actuator: bivcm_set with infinity direction register value
correct the direction register for the reset_lense

Change-Id: Iebe362c514602247bced18d994cce41288f34565
Signed-off-by: Soundrapandian Jeyaprakash <jsoundra@codeaurora.org>
2015-06-16 11:10:45 -07:00
Krishnankutty Kolathappilly f1b0fa5de5 msm: cpp Remove the striping algorithm header from kernel
The striping algorithm header does not need to have kernel dependency.
The striping code / headers can be enclosed in camera backend.

Change-Id: I35b99ec1dad5f9591ca5e5bdc1d44a991de47036
Signed-off-by: Krishnankutty Kolathappilly <kkolatha@codeaurora.org>
2015-06-16 00:46:58 -07:00
Linux Build Service Account f9eb7f736d Merge "msm: camera: add support for frame drop" 2015-06-13 16:06:33 -07:00
Konstantin Motov 54f4f3d9f7 msm: camera: add support for frame drop
Drop frame request and report error to user space if
reg update is missing.

Change-Id: Ie5b1bf265e12e8e5da676ac93de8b044fd63cc17
Signed-off-by: Konstantin Motov <kmotov@codeaurora.org>
2015-06-12 13:06:52 -07:00
Seemanta Dutta 7cda08880a msm: camera: Return correct code when camera open fails
There can be situations when opening camera will fail, not
due to an error but due to the fact that the current hardware
configuration can only support either the front or back camera
and can't support opening another the camera at the moment.

In such cases, rather than returning -EFAULT to user space, camera
should return -EBUSY so as to distinguish between a genuine failure
to open the camera and a failure due to current configuration which
precludes from opening another instance of the camera.

So, correct the return code in the camera open failure handling code.

Change-Id: Ib99ed919be44b40a1b0270a3d2a8a1794a0373cb
Signed-off-by: Seemanta Dutta <seemanta@codeaurora.org>
2015-06-11 18:08:30 -07:00
Harsh Shah 9ce607a788 msm: camera: isp: Add VFE Parent probe and common data
Make header changes for structures/defines to enable unified probe.
Make provision for shared data between 2 HW.
Define IOCTL for setting master and slave HW.
Create separate probe methods for parent and child nodes.
Link common_data to all child nodes.
Create module and driver in msm_ispxx.c files.
This framework enables the parent device to control both HW
to achieve better sync and the common data enables sharing of data
between 2 HW.

Change-Id: Ic3ac8151ed6a89e3934b1cd2429261beec6f0c04
Signed-off-by: Harsh Shah <harshs@codeaurora.org>
2015-06-03 13:27:25 -07:00
Rajesh Bondugula a4f3d9480c msm: camera: sensor: Remove is_flash_supported flag
Remove is_flash_supported flag. This flag is redundant
existence of flash is cheked with flash_name variable.

Change-Id: I91c34cd3b78be225f751a47356ad7f0dc1db9bdf
Signed-off-by: Rajesh Bondugula <rajeshb@codeaurora.org>
Signed-off-by: Xu Han <hanxu@codeaurora.org>
2015-05-29 12:32:22 -07:00
Linux Build Service Account ff258583b4 Merge "msm: camera: add support to update sensor output format" 2015-05-23 01:11:17 -07:00
Linux Build Service Account 266b5868b9 Merge "msm: camera: sensor: Add client specific I2C frequency" 2015-05-22 20:28:43 -07:00
Linux Build Service Account e4c03c52a7 Merge "msm: camera: sensor: copy all ringing parameters" 2015-05-22 20:28:43 -07:00
Mayank Parashar 7fdd6b33e0 msm: camera: add support to update sensor output format
Add support to get sensor output info as a part of
slave info.

Change-Id: I821c76d42fc91bcdd9b5f8df7f64a85f36fc4a51
Signed-off-by: Mayank Parashar <mayankp@codeaurora.org>
2015-05-21 19:43:06 +05:30
Rajesh Bondugula 0fbf0f988b msm: camera: sensor: Add client specific I2C frequency
Each slave can have a different I2C frequency.
The frequency is configured for each write / read if changed.

Change-Id: I6ae71686d41e85c8686d6871d7870b178da5905d
Signed-off-by: Rajesh Bondugula <rajeshb@codeaurora.org>
Signed-off-by: Xu Han <hanxu@codeaurora.org>
2015-05-20 11:24:32 -07:00
Rajesh Bondugula 784b376ae5 msm: camera: sensor: copy all ringing parameters
Copy all ringing parameters for all regions of actuator.
Region can be changed in kernel.

Change-Id: Iad2484ffb5a498b03db655193bd8344a40973858
Signed-off-by: Rajesh Bondugula <rajeshb@codeaurora.org>
Signed-off-by: Xu Han <hanxu@codeaurora.org>
2015-05-20 11:19:52 -07:00
Wei Ding c1aa5f2974 msm: camera: add logic for sensor compatibility issue
Add logic to fix same sensor at one board compatibility
issue.

Change-Id: I6c6721e8ff890feaf2d618c8170e346367a68c28
Signed-off-by: Wei Ding <weiding@codeaurora.org>
2015-05-19 19:40:50 +08:00
Linux Build Service Account 6264118e2a Merge "msm: vidc: Increase extradata size to 16k" 2015-05-12 10:24:49 -07:00