Commit Graph

1105 Commits

Author SHA1 Message Date
Shiju Mathew 1ecc53d36d msm: vidc: Add support for Picture Order Count Type
This patch adds POC type support for video core that
enables low-latency encoding.

Change-Id: I1fe8ea38c7ed8d203a3ef99febb4001165a856fe
Signed-off-by: Shiju Mathew <shijum@codeaurora.org>
2018-08-27 14:52:37 +00:00
Deepak Verma 889ead1155 msm: vidc: Validate input data before processing
User controlled data needs to be validated before
processing, otherwise it may corrupt existing data
and other programming variables which may further
lead to crash in kernel space.
This change validates user specified buffer's data,
such as offset and data length, before performing
any operations in kernel.

Change-Id: Idb2a5c4c270cdbb55adfc0c22b9296b7dd359de9
CRs-fixed: 547695
Signed-off-by: Deepak Verma <dverma@codeaurora.org>
2018-08-27 14:52:35 +00:00
Maheshwar Ajja 3c4ccf282e msm: vidc: Add LTR feature for H264 encoder
This change adds Long Term Reference picture
selection feature for H264 video encoder.

Change-Id: Ida957df244d8715c955afe8d809708123a94e999
Signed-off-by: Maheshwar Ajja <majja@codeaurora.org>
2018-08-27 14:52:32 +00:00
Maheshwar Ajja 6a9440707a msm: vidc: Get the current performance level
This change supports client to get the current
performance level of the video driver via
IOCTL_GET_PERF_LEVEL. The current performance
level indicate the number of MBs per second
is being processed by video hardware.

Change-Id: Ic6f5b2b14e0d77bf801c4f857f8a0e20339c199f
Signed-off-by: Maheshwar Ajja <majja@codeaurora.org>
2018-08-27 14:52:25 +00:00
Maheshwar Ajja a094b332dc msm: vidc: Remove kernel mapping on input/output buffers
This change will remove the kernel mapping of input and
output buffers for both video encoder and decoder to
avoid the errors resulting from ion_map_kernel() for
high resolution video concurrency use cases due to the
limited vmalloc space. It also removed the metadata
processing in kerner video driver as kernel virtual
address is removed. The metadata processing can be
done in user space video component.

Change-Id: I3f2c9b7c13b3e09097ce07ca7b59154b97401052
CRs-fixed: 471135
Signed-off-by: Maheshwar Ajja <majja@codeaurora.org>
2018-08-27 14:52:18 +00:00
Artem Borisov d7992e6feb Merge remote-tracking branch 'stable/linux-3.4.y' into lineage-15.1
All bluetooth-related changes were omitted because of our ancient incompatible bt stack.

Change-Id: I96440b7be9342a9c1adc9476066272b827776e64
2017-12-27 17:13:15 +03:00
guyang 612813a5e6 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.

CRs-Fixed: 1090007
Change-Id: Id40a287e0b1a93cc15d9b02c757fe9f347e285f2
Signed-off-by: Rajesh Bondugula <rajeshb@codeaurora.org>
Signed-off-by: VijayaKumar T M <vtmuni@codeaurora.org>
Signed-off-by: Yang Guang <guyang@codeaurora.org>
2017-06-26 21:24:23 +03:00
Steve Kondik f28f477d40 Fix header list when building with Android
Change-Id: Ib0088b428bd2d8138ca4273e11ec494aeef06b3c
2016-10-29 23:12:09 +08:00
Pachika, Vikas Reddy d9100422e2 msm: vidc: Validate userspace buffer count
Makesure the number of buffers count is less than
the maximum limit to avoid structure overflow errors.

Bug: 28598515
Change-Id: Ia19481c42610ecf1f395bb94138495a848b1eb28
2016-05-13 13:23:58 -07:00
Nick Desaulniers 2021b895cb msm: camera: Fix various small issues in cci driver
Remove some unused ioctl exposed, Also add
some bound checks for ioctl user params.

Bug: 28441831
Change-Id: Ifdd441fdb25fd20b005c4e4e1ebe4e203f1216ac
CRs-Fixed: 511382
Signed-off-by: Hariram Purushothaman <hpurus@codeaurora.org>
Signed-off-by: Shuzhen Wang <shuzhenw@codeaurora.org>
2016-05-04 11:19:02 -07:00
Hariram Purushothaman 451ba15d80 msm: camera: Fix various small issues in Actuator driver
Bound check and validate userspace parameters direction,
number of steps and direction sign. Also fix possible
memory leak in certain error cases.

Bug: 28431531
CRs-Fixed: 511349
Change-Id: Icaa324468574494fb40f2de78e522090806744cb
Signed-off-by: Hariram Purushothaman <hpurus@codeaurora.org>
2016-05-02 22:48:16 -07:00
Andrzej Hajda 28f9d08417 media: v4l2: added missing mutex.h include to v4l2-ctrls.h
commit a19dec6ea9 upstream.

This patch fixes following error:
include/media/v4l2-ctrls.h:193:15: error: field ‘_lock’ has incomplete type
include/media/v4l2-ctrls.h: In function ‘v4l2_ctrl_lock’:
include/media/v4l2-ctrls.h:570:2: error: implicit declaration of
	function ‘mutex_lock’ [-Werror=implicit-function-declaration]
include/media/v4l2-ctrls.h: In function ‘v4l2_ctrl_unlock’:
include/media/v4l2-ctrls.h:579:2: error: implicit declaration of
	function ‘mutex_unlock’ [-Werror=implicit-function-declaration]

Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-09-26 17:15:49 -07:00
chiayi_wu 50b5d7c960 camera: Support setting MWB and EV for yuv sensor.
MBW: auto, incandescent, daylight, flourescent, and cloudy.
EV: +2, +1, 0, -1, -2

Bug: 9492735

Change-Id: Ic12cfc85741dc9472374eb2073eef31dea654780
Signed-off-by: chiayi_wu <chiayi_wu@asus.com>
2013-06-24 10:55:26 -07:00
chiayi_wu fdd3956c35 camera: Support setting fix frame rate for front camera
Fix: 30fps, 25fps, 24fps, 20fps, and 15fps
Auto: 30fps to 7.5fps

Change-Id: I285e5b9a6df8a1dd1f483b0d44d17c766cf1979f
Signed-off-by: chiayi_wu <chiayi_wu@asus.com>
Signed-off-by: Iliyan Malchev <malchev@google.com>
2013-06-19 15:37:48 -07:00
Shuzhen Wang 9d96cdaae3 mm-camera2: Rename white balance mode macro name
This is to avoid name collision with user space bayer WB modes.
The WB modes macro exposed by kernel is only for YUV sensor.

Signed-off-by: Shuzhen Wang <shuzhenw@codeaurora.org>
2013-05-22 20:02:28 +00:00
Shuzhen Wang c170c195fb msm: camera: AD5823 actuator tuning and OTP calibration
The AD5823 actuator tuning for OV5693 sensor. The autofocus
calibration is added

Signed-off-by: Shuzhen Wang <shuzhenw@codeaurora.org>
2013-05-22 20:01:42 +00:00
Shuzhen Wang bacc7e77c9 msm: camera2: Add monotonic timestamp for SOF
In Camera3, SOF (start of frame) event indicates the time imager
starts to expose. Its timestamp is used for frameworks to do AV
sync for video recording, which needs to use kernel monotonic
clock source. Hence add a new field in the event structure to pass
this along.

Signed-off-by: Shuzhen Wang <shuzhenw@codeaurora.org>
2013-05-21 23:31:41 +00:00
Sunid Wilson cec93430d6 msm: gemini: Support upto 64mp encoding
Redesign the output ping pong mechanism to support
upto 64mp encoding using gemini hardware.

Remove the MSM_GMN_IOCTL_TEST_DUMP_REGION ioctl,
because it's unsafe.

Change-Id: Id7801861e0fe119f61a02fb3409155f312a85d21
Signed-off-by: Sunid Wilson <sunidw@codeaurora.org>
2013-05-08 14:00:10 -07:00
Evgeniy Borisov e229b21867 msm: camera2: Swap CSID and CSIPHY sensor sub modules.
Swap modules in sensor sub module enum.
Reverse the order of csid init and csiphy init
modules calls. Between csid and icsphy have a
resource dependency (regulator, clocks).

Change-Id: I0b7f8873e664f6ee06a4200710bc76b5c69827aa
Signed-off-by: Evgeniy Borisov <eborisov@codeaurora.org>
2013-05-08 14:00:09 -07:00
Kevin Chan 53b70b42af msm: Add support for composite ISP statistics
ISP image statistics done interrupt
 for each stats can be fired at different
time, the timing is based on the statistics
window. For high frame rate camera, the number
of interrupts will be significantly higher if
statistics are collected for each frame. This
change add the support to change the interrupt
policy and configure the hardware to generate
one interrupt when all the image statistics are
collect.

Change-Id: Ib2d103bcd46da6c52de246b1245d8928f37be0c5
Signed-off-by: Kevin Chan <ktchan@codeaurora.org>
2013-05-08 14:00:06 -07:00
Jeyaprakash Soundrapandian c935d24183 msm: camera: eeprom driver support for target 8974
The eeprom may hold the data for calibration of autofocus,
whitebalance, lens shading and defect pixel correction.
The eeprom driver is supported with read write functionality.

Change-Id: I952bf1972bac9747ae4f0ea09c4dd6b8937c3f98
Signed-off-by: Jeyaprakash Soundrapandian <jsoundra@codeaurora.org>
Signed-off-by: Junjie Wu <junjiew@codeaurora.org>
2013-05-08 14:00:02 -07:00
chiayi_wu 6ab36d58be camera: mi1040 driver
Add the driver module for mi1040 in camera_v2

Change-Id: I21f2cf6d6ce0ccc16b1acf929edbc10e06ce33e3
Signed-off-by: chiayi_wu <chiayi_wu@asus.com>
Signed-off-by: Iliyan Malchev <malchev@google.com>
2013-05-01 22:42:43 -07:00
Mingcheng Zhu 3a857a934e msm: camera_v2: Add a macro
To support dual VFEs the configuration pataremer entries size
need to be doubled

Change-Id: I16f877ce207f093a60228da23434efe08c88840c
Signed-off-by: Mingcheng Zhu <mingchen@codeaurora.org>
2013-04-22 18:27:43 -07:00
Kevin Chan e2e669ee54 msm: camera: Add support for dynamic clock scaling
ISP clock rate is determined by camera sensor output
pixel clock. Add support to pass information from
userspace and update the clock rate for different
camera sensors.

Change-Id: I2a40fef3f36c6bb843ab2373e457070b4ee80164
Signed-off-by: Kevin Chan <ktchan@codeaurora.org>
2013-04-22 18:27:43 -07:00
Rajakumar Govindaram 999f30e946 msm: camera2: Add support to send error status in cpp driver
The error status need to be sent as part of the payload so
that userspace can identify and do frame skip if needed.

Change-Id: I02e42439e84d71dc34e90ebb76f7da75c3f3c180
Signed-off-by: Rajakumar Govindaram <rajakuma@codeaurora.org>
2013-04-22 18:27:42 -07:00
Rajakumar Govindaram 192a7e7614 msm: camera2: Enhance cpp driver
The cpp driver is enhanced to store the buffer mapping info. This
helps to get vb2 buffers directly from vb2 queue in kernel space.
The redundant queues in cpp kernel driver is removed as because
the userspace streamlines the priority based queue.

Change-Id: I304c1b929f73331f89b7ac666222156b9f3e9063
Signed-off-by: Rajakumar Govindaram <rajakuma@codeaurora.org>
2013-04-22 18:27:42 -07:00
Rajakumar Govindaram b5a0e8bd06 msm: camera2: Add v4l2 subdev call to generic buffer manager.
The generic buffer manager needs to provide v4l2 subdevice call
interface for other kernel subdevices. Change the mutex to
spinlock so that other kenel subdevices can use.

Change-Id: I54b16328c5401710c0972dad7c8b9c9235f54906
Signed-off-by: Rajakumar Govindaram <rajakuma@codeaurora.org>
2013-04-22 18:27:41 -07:00
Mingcheng Zhu b209dd4e75 msm: camera: Add crop support in ISPIF
Ispif crops sensor input for dual VFE to use.
Sensor will still output only one big frame, and
ispif needs to split a whole frame into two part
for dual ISP to use.

Change-Id: I42ae48bc3b070625e91f3cc5003339ba8035d6b9
Signed-off-by: Peter Liu <pingchie@codeaurora.org>
Signed-off-by: Mingcheng Zhu <mingchen@codeaurora.org>
2013-04-22 18:27:40 -07:00
Peter Liu 304a5f84c0 msm: camera: define ISP0 and ISP1 bit to seperate 2 ISP
When dual ISP is running, the bit for different ISP is needed

Change-Id: I48486e1feba85fe85faf52b09d3ff987cc23bf7e
Signed-off-by: Peter Liu <pingchie@codeaurora.org>
2013-04-22 18:27:40 -07:00
Mingcheng Zhu 311afe3953 msm: camera: Improved dual-ISP support in ISPIF and reset timeing fix
fix ispif reset timing so ISP will get correct reset from ispif.
or after streamon, isp will wait for ispif reset and never streamon.
Only to enable clock when it is needed.
After ispif configuration, the clock is disabled.

Change-Id: Ieb316c5d587a0777fe226507dfb32e1d25f521a7
Signed-off-by: Peter Liu <pingchie@codeaurora.org>
Signed-off-by: Mingcheng Zhu <mingchen@codeaurora.org>
2013-04-22 18:27:40 -07:00
Kevin Chan 3a3e248865 msm: camera: Add statistics support for concurrent ISP
For image statatistics for concurrent ISP, we
collect statistics for a single camera sensor from
two ISP hardware. A single buffer is passed from userspace
and share between two ISP hardware using different buffer
offset. When both hardware are done with the buffer,
a stats done event will be send to userspace.

Change-Id: Ia129fbfc082c8d348db0d2765dddeb8d442c931f
Signed-off-by: Kevin Chan <ktchan@codeaurora.org>
2013-04-22 18:27:40 -07:00
Ankit Premrajka 67d91cbed3 msm: camera: pass control value with event
This change makes sure that the control value coming
with the s_ctrl ioctl is passed along to the back-end
along with the rest of the event. Also, the return value
is copied back into the v4l2_control structure for HAL's
usage.

Change-Id: I2e1df270bff0cd1ce67da4490dff57d9bce6dc16
Signed-off-by: Ankit Premrajka <ankitp@codeaurora.org>
2013-04-22 18:27:39 -07:00
Vladislav Hristov 795f6d4816 msm: camera: Use info about VFEs in ISPIF
There can be SoCs which have different amount of VFEs connected to
ISPIF, while the CSID version is kept the same. For such cases there is
a need to have additional information about the number of VFEs connected
to each ISPIF interface, and its capabilities.

As there is no way for the ISPIF to guess this information on its own,
this change introduces a new ISPIF ioctl cmd, called ISPIF_SET_VFE_INFO.
This command will store the information for the number of VFEs connected
and also VFEs capabilities.

The above information is used where number of VFEs information is
required. Such places are vfe clock request, ISPIF irq handling and
others.

Change-Id: I0177470b3965c8a83349c367716d9006c1f49630
Signed-off-by: Vladislav Hristov <vhrist@codeaurora.org>
2013-04-22 18:27:39 -07:00
Kevin Chan 67fd4b5857 msm: camera: Add support for concurrent ISP
For concurrent ISP operation, a single camera image is
split and feed into two ISP. Each ISP will process
the image independently and output to different location in
one single buffer. This change add support to synchronize
the buffer used in each ISP. When the first ISP dequeue
a buffer, the buffer will be store in a separate queue.
The second ISP will first check the intermediate queue
and then check the main queue for buffer. When ISP is done
processing the image, the buffer will be send out only
when both ISPs are done with the buffer.

Change-Id: I8c8616d5255748328cc9b26aff97e9a83c49d5b8
Signed-off-by: Kevin Chan <ktchan@codeaurora.org>
2013-04-22 18:27:39 -07:00
Rajakumar Govindaram 8e504d82b1 msm: camera2: Fix to flush the queue in cpp driver
The kernel driver supports flush interface to allow flusing
the queue.

Change-Id: I4f71a53cf9d384a1ce3b27d6bd10874ca9f45189
Signed-off-by: Rajakumar Govindaram <rajakuma@codeaurora.org>
2013-04-18 16:08:40 -07:00
Rajakumar Govindaram 4350f3254d msm: camera2: Add support for HW information based FW load
This change adds support to read the HW information and use it
to select FW version.

Change-Id: I8ce11341f87b61668f907e969e07bdde5601c066
Signed-off-by: Rajakumar Govindaram <rajakuma@codeaurora.org>
2013-04-18 16:08:39 -07:00
Rajakumar Govindaram 2b020310a8 msm: camera2: Fix ION memory release in cpp driver
The ION handles were not properly released. This change releases
the ION handle after hardware acknowledgement.

Change-Id: Ie3a86e23837a94a1b15d6e2cf2029da3e1c4e1ec
Signed-off-by: Rajakumar Govindaram <rajakuma@codeaurora.org>
2013-04-18 16:08:38 -07:00
Kevin Chan 907518561f msm: camera: Use montonic clock for buffer divert event
Post proc module needs monotonic clock for buffer done.
Change to send monotonic clock when buffer is diverted
to userspace.

Change-Id: I2a973e66dc06a629290b14ca071c980d8a164ab2
Signed-off-by: Kevin Chan <ktchan@codeaurora.org>
2013-04-18 16:08:35 -07:00
Kevin Chan a0c22441f3 msm: camera: Add stream based event subscribe
ISP send V4L2 events to userspace for processing,
buffer divert events are stream based and image statistics
events on based on statistics type.
Add support to allow events subscription based on
stream index or statistics type.

Change-Id: I2a3399754b746acf105612a048e1b6a121f652b2
Signed-off-by: Kevin Chan <ktchan@codeaurora.org>
2013-04-18 16:08:35 -07:00
Kevin Chan 7fd1781e21 msm: camera: Refactor ISP RDI pipeline control
Split raw dump interface configuration from stream
configuration to align with other ISP input configuration.
Add image formats to differentiate MIPI raw format and
Qualcomm raw format.

Change-Id: Ieefc4401ff5142682d7891debfe041ae6bd44145
Signed-off-by: Kevin Chan <ktchan@codeaurora.org>
2013-04-18 16:08:34 -07:00
Kevin Chan ffd5f1cc04 msm: camera: Use wall clock for event timestamp
Certain camera features need realtime clock for
calculation. This change add support to store realtime
clock and send the timestamp for userspace notification.

Change-Id: Ifa565a0d888e34a47c5e6e9e0a849c767e0e7e09
Signed-off-by: Kevin Chan <ktchan@codeaurora.org>
2013-04-18 16:08:34 -07:00
Rajakumar Govindaram d269011a00 msm: camera2: Enhance cpp driver.
This change adds necessary state and IOCTL interface for correct
sequence of firmware loading. This also helps to avoid redundant firmware
loading.

Change-Id: I1aff000b36bfe0fbe2fabb01b9a23e1f86bf1a88
Signed-off-by: Rajakumar Govindaram <rajakuma@codeaurora.org>
2013-04-18 16:08:34 -07:00
Sreesudhan Ramakrish Ramkumar f24bcddcc0 msm: camera2: Add driver for cpp module
Add driver for Camera Post Processing hardware. This
module is responsible for supporting scaling, cropping,
rotation, flip, wavelet denoise and Sharpening features.

Change-Id: I4b130a5e53d40f96186992d540b93bbf4f8e628f
Signed-off-by: Sreesudhan Ramakrish Ramkumar <srramku@codeaurora.org>
2013-04-18 16:08:33 -07:00
Jignesh Mehta 8e21db46e1 msm: camera: Add timestamp for vb2 buffers
In recording, timestamp is checked by video layers,
to validate frame. Add support for timestamp in
vb2 buffers.

Change-Id: I6f93dd89f39b8f5db26c100c3838cb479f23a8cc
Signed-off-by: Jignesh Mehta <jigneshm@codeaurora.org>
2013-04-18 16:08:33 -07:00
Jignesh Mehta 0bdf6241a9 msm: camera2: Fix for buffer manager driver
There can be more than one buffer get from VB2 buffer.
Add list to the driver. All get buffer add to list and
search for buffer done.

Change-Id: I364241e2b03b8386ba68606337776c3ec2478558
Signed-off-by: Jignesh Mehta <jigneshm@codeaurora.org>
2013-04-18 16:08:32 -07:00
Kevin Chan b6b7d76153 msm: camera: Enhance framedrop control
Expand supported framedrop pattern to support
high frame rate features.

Change-Id: I1e8b7837985ac7be6d794eb36033e0f20c06c0a2
Signed-off-by: Kevin Chan <ktchan@codeaurora.org>
2013-04-18 16:08:32 -07:00
Kevin Chan afeee25f1a msm: camera: Improve ISP configuration APIs
Change command structure to improve readablity
Replace write and clear mask function with config mask
Add DMI table support

Change-Id: I4efb78ddbf88cdbd1a7defcbdac3d591c725e1c1
Signed-off-by: Kevin Chan <ktchan@codeaurora.org>
2013-04-18 16:08:30 -07:00
Sreesudhan Ramakrish Ramkumar 5a0b69c19a msm: camera: Add LED flash driver for 8974
Add LED flash driver for 8974 as part of LED flash feature for
camera.

Change-Id: Ic4e2990d4f89a0f3f4933a19e0546f70dab20e19
Signed-off-by: Sreesudhan Ramakrish Ramkumar <srramku@codeaurora.org>
2013-04-18 16:08:29 -07:00
Jignesh Mehta 54cf5354c5 msm: camera: Add buffer manager driver.
This change adds a subdev for buffer management.

Change-Id: I94c9aaa0560497c9d15299f30d0b4887e244d986
Signed-off-by: Jignesh Mehta <jigneshm@codeaurora.org>
2013-04-18 16:08:28 -07:00
Kevin Chan 906272a3f1 msm: camera: Add support to update stream configuration
ISP buffers can be sent to userspace for post processing
before the buffers are sent to HAL layer.
This change add logic to support buffer divert and
to process buffer after it is queued back from userspace.

Change-Id: I05cc9850c3d33e4cd280f938e0ffea5352eeb03f
Signed-off-by: Kevin Chan <ktchan@codeaurora.org>
2013-04-18 16:08:27 -07:00