There were variations in the time taken to
return from each write. This was due
to the delay in switching in and out of
power collapse. To manage this set QOS
value to 1ms so that the core has enough
time to wake up from power collapse
Signed-off-by: Alexy Joseph <alexyj@codeaurora.org>
Signed-off-by: Mekala Natarajan <mekalan@codeaurora.org>
When factory reset is almost done, the backlight would be turned
on again after backlight off sequence in mipi_JDI_lcd_shutdown().
Only set backlight once in recovery mode to fix this issue.
Change-Id: I7243b85697aee0355ca34f1d560d571eaf8101e2
Signed-off-by: yetta_wu <yetta_wu@asus.com>
key chord driver is accessible at /dev/keychord. This driver can
be used for receiving notifications when client specified key
combinations are pressed.
Bug: 8733741
Change-Id: I901e24fe6f317daf97822a09de31a32bed415011
Signed-off-by: paris_yeh <paris_yeh@asus.com>
From Cortex-A15 MPCore TRM, L2 cache is able to recover single-bit
soft error when ECC configured. For better user experiences and L2
cache is configured to support ECC in default, we disable kernel
panic when single-bit soft error was detected.
Change-Id: I1991ae2b8b55a01d36c020fdc758aa1266ca9684
Signed-off-by: paris_yeh <paris_yeh@asus.com>
Priority is : 1. AC, 2. wireless charging, 3. USB.
Charger default setting is that wireless charger has higher priority,
so disable wireless charging when AC is plugged in since hardare rev_c.
Bug: 8411313
Change-Id: I6da25d1d6fbdf683421918229babba0ab97afebc
Signed-off-by: Hank_Lee <Hank_Lee@asus.com>
If there is no charging source, we should not report "Full"
battery status or it will show charging icon
Bug: 8728645
Change-Id: If74cedaca272428208c536e647094cf81af20619
Signed-off-by: Hank_Lee <Hank_Lee@asus.com>
When wakeup interrupt fires, gpio-keys driver kicks the timer
function to perform debouncing. Upon timer expiration, schedule
work to detect GPIO line changes.
Original debounce timer, 15 ms, makes a chance to let latter
rising interrupt to reset kernel timer activated by previous
falling interrupt for power key. When issue happens,
gpio_get_value() only detects released event and missed previous
pressed event generated by falling interrupt.
Issue is observed more easily when device comes out suspend mode.
Try to adjust doubounce timer to alleivate this issue
Change-Id: Idcd166fcbcfb7c91804ea2ab9017ed4dbdb87ec6
Signed-off-by: paris_yeh <paris_yeh@asus.com>
This reverts commit f4b3e8bfb2.
The following patches called WA#3B are used to address instability
issues so that workaround of keeping GFX3D footswitch on should
be reverted to avoid additional power hit.
f834455 msm: footswitch-8x60: Skip GFX memory power collapse on 8064.
38116f7 msm: footswitch-8x60: Update 8064 footswitch_enable() sequence for GFX3D
667dd0a msm: footswitch-8x60: Allow specification of per-fs reset delays
547218f msm: clock-8960: Add 1.8MHz rate to 8064's gfx3d_clk plan
Bug: 8333617
Change-Id: I448d49349ebcc711855071b62d70bfde367fa536
Signed-off-by: paris_yeh <paris_yeh@asus.com>
Update footswitch_disable to skip GFX memory power collapse on 8064 to avoid
any voltage droop on vddmx during GFX3D footswitch toggling.
As per hardware designer recommendations this would help to improve system
stability when responding to the inrush current event.
Change-Id: Ifa2f62629f0639d29f882d009dc5f4c10da46ca8
Signed-off-by: Shashank Mittal <mittals@codeaurora.org>
Signed-off-by: Ed Tam <etam@google.com>
This change fixes the how the gpu_sched_switch timestamp field is formatted.
Signed-off-by: Jamie Gennis <jgennis@google.com>
Change-Id: I273234935254ed15772c9e561c9af20e480004ae
This feature will enforce the security policies as configured by the
user-space security script.
Signed-off-by: Mekala Natarajan <mekalan@codeaurora.org>
With the fine-grained access control in place for QMI clients, default
security check in socket create operation is redundant. Update the
IPC Router to perform the default security check only for the
bind operation, which is used during QMI service registration.
Change-Id: I967dbc3d414d39d307c071ff49c319828b5ed19e
Signed-off-by: Karthikeyan Ramasubramanian <kramasub@codeaurora.org>
Signed-off-by: Mekala Natarajan <mekalan@codeaurora.org>
This feature will enforce the security policies as configured by the
user-space security script.
Change-Id: I641df5b996c7774c1a1c96bc554846360f2863a3
Signed-off-by: Karthikeyan Ramasubramanian <kramasub@codeaurora.org>
Signed-off-by: Mekala Natarajan <mekalan@codeaurora.org>
Currently there exists a small time interval during initialization
where QMI clients in user-space can communicate with QMI services
before the IPC Router Security Configuration(IRSC) is complete.
Only allow clients to communicate after IRSC is complete.
Change-Id: I773ad5b3cb02c51a725cd60a77466876c1498b64
Signed-off-by: Karthikeyan Ramasubramanian <kramasub@codeaurora.org>
Signed-off-by: Mekala Natarajan <mekalan@codeaurora.org>
In order to provide fine-grained access control to QMI services,
a security script from user-space will feed the security rules to
IPC Router. The security rule implies that in order to send a QMI
message to a service, a client process should belong to a specific
Linux/Android group. IPC Router, after receiving the security rules,
will enforce the access control rules.
Change-Id: I49f8d7c0067fc37cb0b4de2ccb46a575905ef64f
Signed-off-by: Karthikeyan Ramasubramanian <kramasub@codeaurora.org>
Signed-off-by: Mekala Natarajan <mekalan@codeaurora.org>
When a message is looped back to the user-space, sometimes the
receiver acts quickly, reads the contents of the packet and frees
the buffer. This leads to a scenario where the sender is trying to
dereference the packet length info of a freed packet. Hence a garbage
packet length gets returned to the user-space.
Fix this race condition by storing the packet length of the packet
being looped back into a variable and return the value of that variable
when the loopback operation is complete.
Change-Id: I595a562bfa12151b2f9154df681ce23c965dfff5
Signed-off-by: Karthikeyan Ramasubramanian <kramasub@codeaurora.org>
Signed-off-by: Mekala Natarajan <mekalan@codeaurora.org>
As part of processing HELLO message, IPC Router does not check the status
of a subsystem before trying to advertise the services hosted in that
subsystem. During the subsystem restart scenario, sometimes two or more
subsystems get reset together. When one of the subsystems come up, IPC
Router ends up accessing the data structures of the other subsystems that
are still in shutdown stage. This causes the IPC Router to trigger invalid
pointer dereference.
Check the status of the subsystem before trying to advertise the services
hosted in that subsystem.
CRs-Fixed: 447217
Change-Id: I50bc2bc21fcfd31ba23f6ebba5728f13268a76e5
Signed-off-by: Karthikeyan Ramasubramanian <kramasub@codeaurora.org>
Signed-off-by: Mekala Natarajan <mekalan@codeaurora.org>
When the server port is closed, only REMOVE_SERVER message is sent. If
the same port is used as a client port prior to the server registration,
then the IPC Router in the remote subsystem does not clean up the client
information associated with that port. This leads to memory leak in the
remote subsystem.
When the server exits and closes the port, IPC Router has to send both
REMOVE_SERVER and REMOVE_CLIENT messages. This ensures that the
IPC Router in the remote subsystem cleans up both the client and server
information associated with that port.
CRs-Fixed: 434981
Change-Id: I1d59aa773398d10dd5c648969b9da2e1cf481d24
Signed-off-by: Karthikeyan Ramasubramanian <kramasub@codeaurora.org>
Signed-off-by: Mekala Natarajan <mekalan@codeaurora.org>
IPC Message Router while processing the HELLO message, sends a server list
information registered locally to the remote subsystem which has sent the
HELLO message. IPC Message Router does this operation by locking mutexes
in the following order:
1) routing_table_lock
2) server_list_lock inside msm_ipc_router_send_server_list
IPC Message Router while processing the NEW_SERVER message, accesses the
server list information to check if the server information advertised by
the remote subsystem is already known before adding that information to
the server list. IPC Message Router does this operation by locking mutexes
in the following order:
1) server_list_lock
2) routing_table_lock inside msm_ipc_router_lookup_remote_port
This leads to a deadlock if the IPC message router processes HELLO message
from one subsystem and NEW_SERVER message from another subsystem. Fix this
out of order locking scenario by locking the server_list_lock before
accessing the msm_ipc_router_send_server_list function.
CRs-Fixed: 417155
Change-Id: Ie38c1c21dccefac7a9b36ad107b13feccd986ed2
Signed-off-by: Karthikeyan Ramasubramanian <kramasub@codeaurora.org>
Signed-off-by: Mekala Natarajan <mekalan@codeaurora.org>
QMI server(<service_id:instance_id>) info is maintained using a hash
table. The server's instance_id is used as the key to index into that
hash table to perform maintenance operations(add, lookup, delete).
The service_id values are well distributed than the instance_id values
and hence the operations on the hash table are not optimized. Optimize
the hash table operations by using server's service_id as the key to
index into the hash table.
While accessing the server hash table, the mutexes are locked and
unlocked inside the access functions. This introduces some race
conditions once the access functions return. So lock and unlock the
server hash table mutex outside the access functions.
CRs-Fixed: 415158
Change-Id: Id1ce6bbfc677df26ff209fd62dca8553c7d2b4a5
Signed-off-by: Karthikeyan Ramasubramanian <kramasub@codeaurora.org>
Signed-off-by: Mekala Natarajan <mekalan@codeaurora.org>
When IPC Router receives a HELLO message from a remote IPC Router, the
protocol is to send a list of servers registered locally and registered
outside the mesh network where the HELLO message is received. Currently
the implementation does not follow this protocol strictly and hence
correct the implementation.
CRs-Fixed: 414147
Change-Id: I75aa089b152baea0925d127b1d9deb6684677cfa
Signed-off-by: Karthikeyan Ramasubramanian <kramasub@codeaurora.org>
Signed-off-by: Mekala Natarajan <mekalan@codeaurora.org>
IPC Router Routing table is organized as a hash table. The routing
table information is dumped based on the index into that hash table.
Update the logic to dump the routing table information based on the
subsystem's node id.
Change-Id: Ideaf24934b93349e2f2cf1d695d08841c04aa5f9
Signed-off-by: Karthikeyan Ramasubramanian <kramasub@codeaurora.org>
Signed-off-by: Mekala Natarajan <mekalan@codeaurora.org>
Not to use the same workqueue as the ACOK pin.
Change-Id: I4f06f9992d08825250841ba7e05a638db1ea7cce
Signed-off-by: yi-hsin_hung <yi-hsin_hung@asus.com>
Update 8064's GFX3D enable sequence per hardware designer recommendations
to improve system stability when responding to the inrush current event.
Differences from the standard footswitch_enable() sequence include:
- Decreasing the reset_rate from 27MHz to 1.8MHz, and increasing
reset_delay_us from 1us to 10us to compensate for the slower clock.
- Enable clocks for reset propagation only after the core has been
powered on.
- Forcefully limit the AFAB and EBI1 clocks to a low value (decided
by the RPM) by means of a write to the RPM_CTL RPM resource.
- Removal of the reset toggle after powering on the core, which (while
harmless) is not applicable to 8064.
Change-Id: I943842b56ff96b2e6077a419566d91ac184a6fda
Signed-off-by: Matt Wagantall <mattw@codeaurora.org>
Custom reset rates can be specified for clocks via fs_clk_data. If
these rates are very low, then the default reset delay of 1us may
not be sufficient. Address this by allowing custom reset delays to
be specified on a per-footswitch bases.
Change-Id: Id9b9377d79436a7fe5007a8f37216a456d66ce1a
Signed-off-by: Matt Wagantall <mattw@codeaurora.org>
This rate will be used by the 'footswitch-8x60' driver when
controlling GFX3D power.
Change-Id: Ib796114dc90b468f1c0aa014a9db699f3b854adf
Signed-off-by: Matt Wagantall <mattw@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 bus vector should be calculated based on input
data rate and output dimensions. The vectors will
be dynamically changed based on the ISP output
enabled.
Change-Id: I7cbbf8fc5231b64a91c61cc7a2136bf8c09a730a
Signed-off-by: Kevin Chan <ktchan@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>
Ioctl to start/stop ISP hardware streams need to
block until the configuration is done and settings
are applied to the hardware register. This will ensure
race conditions where memory get unmapped while the
hardware is still accessing memory and result in page faults.
This change ensure start and stop commands blocks until
ISP register update ack irq gets fired in the next frame.
Change-Id: Iced2bd7b40af3e11f4270c9d18fcfc7c08d3ceb6
Signed-off-by: Kevin Chan <ktchan@codeaurora.org>
For burst stream, image buffers are not queued back
for processing. When ISP ping pong address is updated,
we need to check for the remaining burst count to see
if we need to fetch and new buffer and update the address.
Add change to update the burst count in order to check if
we have free buffers.
Change-Id: I683889d6e04de59ef610a5abb771b103fd4669f2
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>
When ISPIF is not in ISPIF_POWER_UP state, this means that it will not
have register base ioremapped, will not have IRQs reqested and so on. In
this case ISPIF must not be used as it will result in an kernel panic
with the following symptoms:
------------[ cut here ]------------
Unable to handle kernel paging request at virtual address f0d0e248
....
[<c0435738>] (msm_camera_io_w_mb+0x2c/0x44) from [<c044407c>] (msm_ispif_intf_cmd+0x138/0x178)
[<c044407c>] (msm_ispif_intf_cmd+0x138/0x178) from [<c0444f64>] (msm_ispif_subdev_ioctl+0x88c/0x9e0)
[<c0444f64>] (msm_ispif_subdev_ioctl+0x88c/0x9e0) from [<c04648f4>] (subdev_do_ioctl+0x490/0x530)
[<c04648f4>] (subdev_do_ioctl+0x490/0x530) from [<c0459c94>] (video_usercopy+0x360/0x4dc)
[<c0459c94>] (video_usercopy+0x360/0x4dc) from [<c0458edc>] (v4l2_ioctl+0x68/0x114)
[<c0458edc>] (v4l2_ioctl+0x68/0x114) from [<c0154734>] (do_vfs_ioctl+0x4d8/0x54c)
[<c0154734>] (do_vfs_ioctl+0x4d8/0x54c) from [<c01547dc>] (sys_ioctl+0x34/0x54)
[<c01547dc>] (sys_ioctl+0x34/0x54) from [<c000e000>] (ret_fast_syscall+0x0/0x30)
Code: e1a00000 eaffffff e1a00000 e3500000 (e5845000)
---[ end trace 90991692f8caa754 ]---
The above panic can happen when the device have been opened and there
were no ISPIF_INIT cmd, before calling one of the following ISPIF cmds:
- ISPIF_CFG
- ISPIF_START_FRAME_BOUNDARY
- ISPIF_STOP_FRAME_BOUNDARY
- ISPIF_STOP_IMMEDIATELY
Or there were call to msm_ispif_relese with one of the above commands
called after this.
The only case when the above commands can be issued is between
ISPIF_INIT and ISPIF_RELEASE (or close of the device) calls with
success. In order to prevent usage of the above commands in this
situation, just provide a check for the ISPIF and return -EPERM error
when the ISPIF is not in the correct state.
Change-Id: Ic02794382b301e555a7e9f897ee9c6f67b5818fd
Signed-off-by: Vladislav Hristov <vhrist@codeaurora.org>
When enable dual VFE crop, the VFE0's PIX interface's line buffer
needs to be enabled.
Change-Id: I64fed15d0326ba40d2ad84d04e9f7270a0a07d75
Signed-off-by: Mingcheng Zhu <mingchen@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>
CCI can only support 15 bytes read per transaction. If read
sequential count is greater than 15, read iteratively.
Change-Id: I8b927ab8dfde6f7f8d93095a05495d5ce895dd62
Signed-off-by: Sreesudhan Ramakrish Ramkumar <srramku@codeaurora.org>
Real time ioctls such as buffer operations and registers
configuration updates are timing critical. Other ioctls
such as ISP stream start/stop could take longer time to
finish because the ioctl blocks until the hardware
start/stop streaming completely. Using a separate mutex
will prevent real time operations from starving and
results in framedrop.
Change-Id: I3421b596bde53198ba4df7da9636441762c739db
Signed-off-by: Kevin Chan <ktchan@codeaurora.org>
The bottom half for cpp driver is handled by tasklet. This
enhancement enables cpp driver to interface with buffer manager
subdevice for vb2 buffer operations.
Change-Id: I2905af64e4afa251e53a346185e3f4dcbeb1f834
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>
This change makes sure that the command ack queue is properly
removed from the session's list of command ack queues. This ensures
that there aren't any outdated queues in the list.
Change-Id: I54424a8189fb2477be540cecd8277a6d4df58aa0
Signed-off-by: Ankit Premrajka <ankitp@codeaurora.org>
CSID SOT (Start of Transmission) bit is enabled by default. This
causes lot of unnecessary interrupts. Disable CSID SOT mask, disable
DBG_CSID macro so that none of debug interrupts are triggered.
Remove unwanted logs.
Change-Id: Ib23da7d7b972dd61eb4df255d65b2954f953bffd
Signed-off-by: Sreesudhan Ramakrish Ramkumar <srramku@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>
Add support for ISP AXI to output images with formats of NV16 and NV61.
This file formats are similar to NV12 and NV21 so they reuse mainly the
same switch-cases, with the only major difference being the output
dimensions for the CbCr plane, which are the same as Y plane for NV16
cases.
Change-Id: I017f7fc5503fe086a94afb5f250651e774db5536
Signed-off-by: Vladislav Hristov <vhrist@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>
Add lock to provide synchronization when two ISPs
are sharing the same buffer queue during single
camera dual ISP usecase.
Change-Id: Iede4a326da7506e7554dcc00b42fff1f47416b8f
Signed-off-by: Kevin Chan <ktchan@codeaurora.org>