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>
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>
This change adds Long Term Reference picture
selection feature for H264 video encoder.
Change-Id: Ida957df244d8715c955afe8d809708123a94e999
Signed-off-by: Maheshwar Ajja <majja@codeaurora.org>
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>
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>
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>
Makesure the number of buffers count is less than
the maximum limit to avoid structure overflow errors.
Bug: 28598515
Change-Id: Ia19481c42610ecf1f395bb94138495a848b1eb28
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>
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>
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>
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>
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>
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>
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>
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>
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>
To support dual VFEs the configuration pataremer entries size
need to be doubled
Change-Id: I16f877ce207f093a60228da23434efe08c88840c
Signed-off-by: Mingcheng Zhu <mingchen@codeaurora.org>
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>
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>
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>
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>
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>
When dual ISP is running, the bit for different ISP is needed
Change-Id: I48486e1feba85fe85faf52b09d3ff987cc23bf7e
Signed-off-by: Peter Liu <pingchie@codeaurora.org>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
Expand supported framedrop pattern to support
high frame rate features.
Change-Id: I1e8b7837985ac7be6d794eb36033e0f20c06c0a2
Signed-off-by: Kevin Chan <ktchan@codeaurora.org>
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>
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>
This change adds a subdev for buffer management.
Change-Id: I94c9aaa0560497c9d15299f30d0b4887e244d986
Signed-off-by: Jignesh Mehta <jigneshm@codeaurora.org>
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>