OSDN Git Service

sagit-ice-cold/kernel_xiaomi_msm8998.git
8 years agoASoC: msm-lsm-client: free lsm client data in msm_lsm_close
Vidyakumar Athota [Wed, 16 Dec 2015 23:42:39 +0000 (15:42 -0800)]
ASoC: msm-lsm-client: free lsm client data in msm_lsm_close

Currently lsm client data is deallocated when q6lsm_open() fails
which can cause memory corruption if lsm client data is accessed
after freed. Fix this issue by deallocating the client data only
in msm_lsm_close().

Change-Id: If048c26a0ffd8a346a28622183cbf2ba1e7e5ff3
Signed-off-by: Vidyakumar Athota <vathota@codeaurora.org>
8 years agonetfilter: nf_conntrack_sip: Dynamically enable/disable SIP ALG
Ravinder Konka [Mon, 13 Oct 2014 06:36:59 +0000 (12:06 +0530)]
netfilter: nf_conntrack_sip: Dynamically enable/disable SIP ALG

When SIP ALG is disabled, SIP packet should not be parsed by
SIP ALG module. Make change to Check nf_ct_disable_sip_alg flag
before parsing the SIP packet to bypass SIP ALG processing
when SIP ALG is disabled.

Change-Id: I863c93f418b694bc0e9101c31d2da12e761091a6
Signed-off-by: Ravinder Konka <rkonka@codeaurora.org>
8 years agoARM: dts: msm: add dba property to adv panels
Sandeep Panda [Thu, 17 Dec 2015 05:48:11 +0000 (11:18 +0530)]
ARM: dts: msm: add dba property to adv panels

ADV7533 chip is used as DBA (Display Bridge Abstraction)
in MDSS driver. So adding the dba property to panel dt files.

Signed-off-by: Sandeep Panda <spanda@codeaurora.org>
Change-Id: Ideda14930a9025b105880021440fd84baf3343c3

8 years agoARM: dts: msm: remove backlight control type from adv panel
Sandeep Panda [Thu, 19 Nov 2015 16:34:27 +0000 (22:04 +0530)]
ARM: dts: msm: remove backlight control type from adv panel

ADV7533 is a DSI to HDMI bridge chip, it does not need any backlight
control to be defined. So removing this property from panel dt files.

Change-Id: I3ca7290ce324d9385da8b13d9c141de0730d8535
Signed-off-by: Sandeep Panda <spanda@codeaurora.org>
8 years agoARM: dts: msm: Set camera config for 8996 mojave platform
Terence Ho [Thu, 10 Dec 2015 19:21:57 +0000 (14:21 -0500)]
ARM: dts: msm: Set camera config for 8996 mojave platform

Configure csi0 camera to use cci master 1 to reflect
hardware on 8996 mojave automotive plaftorm.

Change-Id: I38d2a8499e6f1916aad7dfbc36d03e36a8fbd47b
Signed-off-by: Terence Ho <terenceh@codeaurora.org>
8 years agoARM: dts: msm: disallow use of VDD_GFX CPR retention corner for msm8996
David Collins [Tue, 15 Dec 2015 18:57:39 +0000 (10:57 -0800)]
ARM: dts: msm: disallow use of VDD_GFX CPR retention corner for msm8996

Disallow use of the 400 mV VDD_GFX CPR retention corner since it
has been found that 400 mV is not a sufficiently high retention
voltage across all parts.  Additionally, no power benefits have
been found when using the retention state during graphics
hardware operation.  Also, there is a minor performance penalty
when the retention corner is allowed as software reconfigures
the VDD_GFX supply to the retention voltage during GPU power
collapse and resume before transitioning to an active voltage.

Change-Id: I374d7620373d7fea17818009bec3d171a6072cdc
Signed-off-by: David Collins <collinsd@codeaurora.org>
8 years agoclk: msm: Add support to control MEM_PERPIH_OFF bit of branch clock
Devesh Jhunjhunwala [Fri, 18 Dec 2015 00:57:48 +0000 (16:57 -0800)]
clk: msm: Add support to control MEM_PERPIH_OFF bit of branch clock

Update cbcr_set_flags method to add support for controlling the
MEM_PERPIH_OFF bit for branch clocks.

Change-Id: I87451b02cb9000dc850fdfaa52a5a9f9fd2893a1
Signed-off-by: Devesh Jhunjhunwala <deveshj@codeaurora.org>
8 years agosoc: qcom: glink: Signal the waiter for rx_intent ack under error
Karthikeyan Ramasubramanian [Sat, 12 Dec 2015 01:58:06 +0000 (18:58 -0700)]
soc: qcom: glink: Signal the waiter for rx_intent ack under error

During subsystem restart, if a transmit operation is waiting for a remote
receive intent acknowledgment, signal the waiter that the receive intent
request will not be acknowledged. Also check the transport and channel
state before waiting for the acknowledgment. This will prevent the
transmit operation from blocking indefinitely under error scenario.

CRs-Fixed: 952184
Change-Id: I29b8215841f7dcca52137f451665eaf339a6f78e
Signed-off-by: Karthikeyan Ramasubramanian <kramasub@codeaurora.org>
8 years agoASoC: wcd_cpe_core: Perform irq cleanup once the bus is up
Bhalchandra Gajare [Tue, 15 Dec 2015 23:28:24 +0000 (15:28 -0800)]
ASoC: wcd_cpe_core: Perform irq cleanup once the bus is up

During subsystem restart, it is possible that while the underlying bus
is down, the irq driver has already performed its cleanup. In such case,
when CPE driver requests to cleanup its own irq, the irq driver attempts
to hold an lock that is already freed. Fix this issue by performing the
CPE driver irq cleanup after bus is up rather than when bus is down.

CRs-fixed: 948899
Change-Id: I2772e89bbdc855baa9fcf7a34a9c16f2f5c05c32
Signed-off-by: Bhalchandra Gajare <gajare@codeaurora.org>
8 years agonet: tcp: check for SOCK_DEAD again in tcp_nuke_addr
Lorenzo Colitti [Mon, 9 Nov 2015 13:36:10 +0000 (22:36 +0900)]
net: tcp: check for SOCK_DEAD again in tcp_nuke_addr

Liping Zhang spotted a race between tcp_nuke_addr and tcp_close
that can cause a crash. If a userspace process calls tcp_close
on a socket at the same time that tcp_nuke_addr is closing it,
and tcp_close wins the race to call lock_sock, it will call
sock_orphan before releasing the lock. sock_orphan sets the
SOCK_DEAD flag on the socket and proceeds to close it, eventually
calling inet_csk_destroy_sock. When tcp_nuke_addr gets the socket
lock, it calls tcp_done. But if tcp_done sees the SOCK_DEAD flag,
it calls inet_csk_destroy_sock as well, resulting in a double
free.

Fix this by checking for SOCK_DEAD again after lock_sock
succeeds. Eric had already pointed out that this could be a
problem in b/23663111, so there was already a TODO in the code
for this.

Change-Id: I0c87c3fd0598384d957b69734366bd4e2fd7e8d7
Git-commit: 61469ddc534f255c709349a1a611216ecd07e13d
Git-repo: https://android.googlesource.com/kernel/common/
Signed-off-by: Subash Abhinov Kasiviswanathan <subashab@codeaurora.org>
8 years agoFix NULL pointer dereference in tcp_nuke_addr.
Lorenzo Colitti [Mon, 14 Sep 2015 15:14:23 +0000 (00:14 +0900)]
Fix NULL pointer dereference in tcp_nuke_addr.

tcp_nuke addr only grabs the bottom half socket lock, but not the
userspace socket lock. This allows a userspace program to call
close() while the socket is running, which causes a NULL pointer
dereference in inet_put_port.

Bug: 23663111
Bug: 24072792
Change-Id: Iecb63af68c2db4764c74785153d1c9054f76b94f
Signed-off-by: Lorenzo Colitti <lorenzo@google.com>
Git-commit: 74d66ee756afcc3269e4c1341f793c52be629af9
Git-repo: https://android.googlesource.com/kernel/common/
Signed-off-by: Subash Abhinov Kasiviswanathan <subashab@codeaurora.org>
8 years agomsm: camera: isp: fix error report id mask
Peter Liu [Wed, 9 Dec 2015 05:00:00 +0000 (21:00 -0800)]
msm: camera: isp: fix error report id mask

Stream id mask need more than 8 bit,
thus increase bit width for error reporting.

Change-Id: I308a9d3df6024768b07ec49562f3241707566e2a
Signed-off-by: Peter Liu <pingchie@codeaurora.org>
8 years agoASoC: msm: send gain info for all channels mask
vivek mehta [Wed, 16 Dec 2015 01:22:32 +0000 (17:22 -0800)]
ASoC: msm: send gain info for all channels mask

- currently gain is added for only number of channels and clip
  channel count is send to dsp.
- but it is possible that channel mask that driver has is different
  than what dsp discovers after decoding the codec config data
- volume will not be applied to channels that differ between driver
  and dsp and device volume will not apply on these channels
- change is to control multi-channel volume using master gain

Change-Id: Icd8ca4e935d9095dd9ef8b65eff34629326fb563
Signed-off-by: vivek mehta <mvivek@codeaurora.org>
8 years agoASoC: msm: qdsp6v2: Move asm list init before apr registration
Ben Romberger [Sat, 12 Dec 2015 04:24:57 +0000 (20:24 -0800)]
ASoC: msm: qdsp6v2: Move asm list init before apr registration

Move list init for no wait que before apr registration.
If apr registration fails asm free client will free
the no wait que.

Change-Id: I4707dbf4771a1ec313898adb2284c06ef1fb5b3a
Signed-off-by: Ben Romberger <bromberg@codeaurora.org>
8 years agomsm: camera: Fix to enable RDI2
Terence Ho [Thu, 10 Dec 2015 15:54:47 +0000 (10:54 -0500)]
msm: camera: Fix to enable RDI2

Fix incorrect comparison that prevented RDI2 from being enabled.

Change-Id: I4f18a290237f074b6a095d33dcd8429f90c8a1d5
Signed-off-by: Terence Ho <terenceh@codeaurora.org>
8 years agomsm: limits: Add support to handle data greater than PAGE_SIZE
Ram Chandrasekar [Tue, 27 Oct 2015 23:32:09 +0000 (17:32 -0600)]
msm: limits: Add support to handle data greater than PAGE_SIZE

Debug data read was not handling the buffer overflow case when
the data to write is greater than PAGE_SIZE. This resulted in
calling the hardware for new data multiple times.

Returning success when buffer overflowed will cause the sequence
traverse function to call again with a new buffer with increased
size. This process will go on until the buffer size is big enough
to hold the data. But limits data read function couldn't distinguish
if the call is a retry or a new call and will initiate a new data
fetch from hardware and re-populate with new data.

Modify debug read interface to immediately return success when
overflow happens. The debug read function now can distinguish between
a sequence retry call by retaining the data buffer in a static if
overflow happens. When called again, debug read now will avoid
calling the hardware for new data and instead will populate the new
sequence buffer with the previously fetched data.

Change-Id: Icc0eb035047ab734d2eb5366cade4ec187747379
Signed-off-by: Ram Chandrasekar <rkumbako@codeaurora.org>
8 years agomsm: lmh_lite: Remove primary interrupt handler
Ram Chandrasekar [Tue, 29 Sep 2015 18:19:01 +0000 (12:19 -0600)]
msm: lmh_lite: Remove primary interrupt handler

The primary interrupt handler disables the lmh interrupt. But
this is already taken care by IRQF_ONESHOT flag. Remove
the primary interrupt handler and disable the interrupt in the
interrupt thread function.

Change-Id: I6c607e0cdef09ffe4f758f9498ee6241d099ee26
Signed-off-by: Ram Chandrasekar <rkumbako@codeaurora.org>
8 years agomsm: limits: update the snprintf error handling
Ram Chandrasekar [Tue, 8 Sep 2015 21:38:48 +0000 (15:38 -0600)]
msm: limits: update the snprintf error handling

Update the snprintf() error handling in the
available_level_get() function to look for proper error
return value and take appropriate action.

Change-Id: Ifbe6450693a282105d9fddd02a756ae53d8cd892
Signed-off-by: Ram Chandrasekar <rkumbako@codeaurora.org>
8 years agomsm: lmh_lite: Fix configurability for LMH software polling
Ram Chandrasekar [Fri, 4 Sep 2015 21:30:05 +0000 (15:30 -0600)]
msm: lmh_lite: Fix configurability for LMH software polling

Update the lmh hardware driver to get the polling interval
value from the lmh interface driver, instead of using a local
static variable.

LMH interface driver already exposes debug interface to
configure the interval value.

Change-Id: Ie7d91519f197930ca513b30a671d8f6917d636b0
Signed-off-by: Ram Chandrasekar <rkumbako@codeaurora.org>
8 years agomsm: ipa3: Configure IPA RX HPS resources distribution
Ghanim Fodi [Sun, 13 Dec 2015 16:00:35 +0000 (18:00 +0200)]
msm: ipa3: Configure IPA RX HPS resources distribution

IPA RX HPS command queue resources need to be distributed
among the different resource groups (e.g. Uplink group).
The configuration is the maximum and minimum number of
resources that can be used by each group.

Change-Id: I02cf831b6ea6da812b67624fbb48bb829e4684d3
Signed-off-by: Ghanim Fodi <gfodi@codeaurora.org>
8 years agomsm: kgsl: Fix direct references to HZ
Suman Tatiraju [Tue, 15 Dec 2015 14:49:41 +0000 (07:49 -0700)]
msm: kgsl: Fix direct references to HZ

Make the various timeout values HZ agnostic by using the proper
macros and values instead.

Change-Id: I708cd491f593782f0172cd7d2cca058cd41044a5
Signed-off-by: Suman Tatiraju <sumant@codeaurora.org>
8 years agodefconfig: msm: Enable APSS_CORE_EA config for ARM32 and ARM64 systems
Maulik Shah [Tue, 15 Dec 2015 09:11:37 +0000 (14:41 +0530)]
defconfig: msm: Enable APSS_CORE_EA config for ARM32 and ARM64 systems

Enable energy-awareness driver for msmtitanium.

Change-Id: I875fe8c4ae5d84a6ac8311bcc64eca509d689b16
Signed-off-by: Maulik Shah <mkshah@codeaurora.org>
8 years agodma-mapping: Check for valid IOVA address
Susheel Khiani [Tue, 15 Dec 2015 11:17:56 +0000 (16:47 +0530)]
dma-mapping: Check for valid IOVA address

We might fail in alloc_iova if we run out
of virtual addresses in pool. Currently,
if we fail in alloc_iova we are not checking
for return value and directly going ahead
and mapping invalid IOVA address. Fix this
by explicitly checking for return value
from alloc_iova.

Change-Id: I7681d13b75f47a86f0b0b6cbf4b8405a7528ff66
Signed-off-by: Susheel Khiani <skhiani@codeaurora.org>
8 years agonet: wireless: decouple cnss crypto from cnss memory pre-alloc
Sarada Prasanna Garnayak [Thu, 10 Dec 2015 11:35:06 +0000 (17:05 +0530)]
net: wireless: decouple cnss crypto from cnss memory pre-alloc

The cnss crypto add support for wlan host driver for security
Protocol and cipher key generation where cnss memory pre-alloc
feature enable wlan driver to use pre allocated memory
for its internal usage and release it to back to pre-allocated pool.

Decouple cnss crypto from cnss memory pre-alloc and add kernel
config flag for this  crypto module compilation and update
the defocnfig of required targets.

CRs-Fixed: 949992
Change-Id: If34819fd76076ba522a9a42ac41fdae1f541f5c8
Signed-off-by: Sarada Prasanna Garnayak <sgarna@codeaurora.org>
8 years agomm: zcache: clear zcache when low on file pages
Vinayak Menon [Tue, 1 Sep 2015 09:39:35 +0000 (15:09 +0530)]
mm: zcache: clear zcache when low on file pages

When files pages are very low, it is better to clear off
zcache pages, since the freed memory can be used to sustain
an application in foreground. Moreover when file pages
are too low, we don't gain much by holding a few zcache
pages.

Change-Id: I88dd295d24b7de18fb3bc0788e0baeb6bfdb2f6d
Signed-off-by: Vinayak Menon <vinmenon@codeaurora.org>
8 years agomm: zcache: add zero page support
Vinayak Menon [Mon, 13 Jul 2015 08:44:06 +0000 (14:14 +0530)]
mm: zcache: add zero page support

zero pages need not be compressed and stored unnecessarily.
Rather insert a special handle to the radix tree to identify
a zero page.

Change-Id: Ic92321c4753401a90d69a6e8c61b5119168c9df7
Signed-off-by: Vinayak Menon <vinmenon@codeaurora.org>
8 years agoradix-tree: add radix_tree_gang_lookup_index
Vinayak Menon [Mon, 20 Jul 2015 05:23:19 +0000 (10:53 +0530)]
radix-tree: add radix_tree_gang_lookup_index

Add radix_tree_gang_lookup_index to get the radix tree
indices along with the pointers. This will be  helpful,
for e.g. if a radix_tree_delete has to be performed
depending on one of the result values.

Change-Id: Iab83d027968462aa30da5341fa3f60134b6c1137
Signed-off-by: Vinayak Menon <vinmenon@codeaurora.org>
8 years agomm: zcache: do not wake up kswapd for zcache allocs
Vinayak Menon [Fri, 7 Aug 2015 07:27:14 +0000 (12:57 +0530)]
mm: zcache: do not wake up kswapd for zcache allocs

zcache allocations happen during reclaim of pages,
and waking up kswapd at this time hinders system
performance. During tests it was seen that without
this patch, there were a lot of kswapd wakeups and
was resulting in bad launches.

Change-Id: Ic0f0240b8fdad6b3fe142b2bdc0366cfd870635e
Signed-off-by: Vinayak Menon <vinmenon@codeaurora.org>
8 years agomm: zcache: fix accouting of pool pages
Vinayak Menon [Fri, 7 Aug 2015 07:14:48 +0000 (12:44 +0530)]
mm: zcache: fix accouting of pool pages

zcache_pool_pages is supposed to store the total
pages in all the pools used by zcache. But at
present zcache_pool_pages is assigned pages of any
particular pool on a load, store or any operation
which modifies the pool size. And this is more
important for external clients which depend on zcache
pool size, like the lowmemorykiller.

Change-Id: Ifdaab8646c40f1fec71dfa5903658fbdc6b3cce5
Signed-off-by: Vinayak Menon <vinmenon@codeaurora.org>
8 years agomm: zcache: shrink zcache on memory pressure
Vinayak Menon [Thu, 16 Jul 2015 11:46:46 +0000 (17:16 +0530)]
mm: zcache: shrink zcache on memory pressure

When file pages drops down, at a point zcache pages
can be more than the file pages, and even further when
we have to reclaim the maximum number of file pages
possible to launch an application, we need a way to
reclaim even the zcache pages at least to an extend
which makes it match with the number of file pages.
This can help in better foreground headroom.

Change-Id: I481bfb9961ed5cee47ebeae08eb910bb269b644c
Signed-off-by: Vinayak Menon <vinmenon@codeaurora.org>
8 years agomm: zcache: disallow sleep in zcache store
Vinayak Menon [Thu, 25 Jun 2015 08:32:07 +0000 (14:02 +0530)]
mm: zcache: disallow sleep in zcache store

zcache store ops cannot sleep since it is called from
an atomic context. Pass the right flags to alloc functions.

Change-Id: I9c7956e895fb7909932315aa3d85845127aa02e1
Signed-off-by: Vinayak Menon <vinmenon@codeaurora.org>
8 years agomm: zcache: add evict zpages supporting
Bob Liu [Tue, 6 Aug 2013 11:36:16 +0000 (19:36 +0800)]
mm: zcache: add evict zpages supporting

Implemented zbud_ops->evict, so that compressed zpages can be evicted from
zbud memory pool in the case that the compressed pool is full.

zbud already managered the compressed pool based on LRU. The evict was
implemented just by dropping the compressed file page data directly, if
the data is required again then no more disk reading can be saved.

Signed-off-by: Bob Liu <bob.liu@oracle.com>
Patch-mainline: linux-mm @ 2013-08-06 11:36:16
[vinmenon@codeaurora.org: trivial merge conflict fixes]
Signed-off-by: Vinayak Menon <vinmenon@codeaurora.org>
Change-Id: Ia66652475e490f0233547511e80abf7587054e65

8 years agomm: zcache: add core files
Bob Liu [Tue, 6 Aug 2013 11:36:14 +0000 (19:36 +0800)]
mm: zcache: add core files

zcache is a backend for cleancache that takes file pages that are in the
process of being reclaimed and attempts to compress them and store them
in a RAM-based memory pool. This can result in a significant I/O reduction
if system is full with file pages and, in the case where decompressing
from RAM is faster than reading from the disk, can also improve workload
performance.

Signed-off-by: Bob Liu <bob.liu@oracle.com>
Patch-mainline: linux-mm @ 2013-08-06 11:36:14
[vinmenon@codeaurora.org: trivial merge conflict fixes, checkpatch fixes]
Signed-off-by: Vinayak Menon <vinmenon@codeaurora.org>
Change-Id: Id05bcc1946eee22b94a83adeb0134a3f6e357ef8

8 years agoASoC: wcd_cpe_services: delete the redundant worker thread
Walter Yang [Tue, 8 Dec 2015 09:59:04 +0000 (17:59 +0800)]
ASoC: wcd_cpe_services: delete the redundant worker thread

Currently worker thread in cpe service is created twice.
The second thread handler overwrites the first one. The first
thread is not freed  when the service is cleaned up. The fix
prevents creation of the redundant thread.

CRs-Fixed: 949165
Change-Id: Idd76b76d4f7f25d2592ca7c336dbee77b6efc7eb
Signed-off-by: Walter Yang <yandongy@codeaurora.org>
8 years agocan: Add RH850 CAN controller driver
Alex Yakavenka [Thu, 1 Oct 2015 23:29:17 +0000 (16:29 -0700)]
can: Add RH850 CAN controller driver

This driver creates network device of type CAN
and processes tx and rx frames that it sends and
receives over SPI.

Change-Id: I903927d5bb0025c2ad3e9f1dd7cb51de547fc360
Signed-off-by: Alex Yakavenka <ayakav@codeaurora.org>
8 years agotrace: ipc_logging: Increase maximum size of logging context name
Steven Cahail [Wed, 25 Nov 2015 04:14:24 +0000 (21:14 -0700)]
trace: ipc_logging: Increase maximum size of logging context name

The current maximum length of an IPC Logging log context name is 20
characters. Some clients are now using names longer than this.

Increase the maximum length to 32. This change increases the IPC Logging
version to 3.

Change-Id: I9daecb8a7c6c3aea427efd1c75e307456e9c6c21
Signed-off-by: Steven Cahail <scahail@codeaurora.org>
8 years agomsm: sps: support using cached write pointer for BAM-to-Sys mode
Yan He [Sat, 12 Dec 2015 02:47:59 +0000 (18:47 -0800)]
msm: sps: support using cached write pointer for BAM-to-Sys mode

Support using the cached write pointer for a BAM-to-Sys mode BAM
pipe when check if the desc FIFO of that pipe is full.

Change-Id: Ie480ecca9eff76388c504665b496e01bbf3e009f
Signed-off-by: Yan He <yanhe@codeaurora.org>
8 years agosoundwire: Add slave synchronization configuration
Sudheer Papothi [Thu, 10 Dec 2015 21:12:59 +0000 (02:42 +0530)]
soundwire: Add slave synchronization configuration

Slave synchronization is needed to sync frame shape consisting
of different ports with different sample rates. Change sets
the slave synchronization based on the frame shape.

Change-Id: Iae726555b3c158394662c590d1ebc781ff7f54f5
Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
8 years agoARM: dts: apq: enable dual dsi for agave board for APQ8096
Vinu Deokaran [Mon, 14 Dec 2015 17:11:48 +0000 (12:11 -0500)]
ARM: dts: apq: enable dual dsi for agave board for APQ8096

Enable dual DSI for Agave board to support three displays.

Change-Id: I80e0c90e3d039a1777598f4038d9a1d18f23ca1b
Signed-off-by: Vinu Deokaran <vinud@codeaurora.org>
8 years agomsm: isp: Add output format support for camif
Abhishek Kondaveeti [Sun, 13 Dec 2015 13:17:22 +0000 (18:47 +0530)]
msm: isp: Add output format support for camif

Add output format support for camif raw path
in isp.

Change-Id: If8e633175a5488b8da740654c8204b0247d3c408
Signed-off-by: Abhishek Kondaveeti <akondave@codeaurora.org>
8 years agosoc: qcom: socinfo: Add check for subtype id
Zhenhua Huang [Mon, 7 Dec 2015 10:17:09 +0000 (18:17 +0800)]
soc: qcom: socinfo: Add check for subtype id

There's an overflow when subtype id is greater than 3 in current
design. Add a check to ensure returning correct value.

Change-Id: Ie8d234792f7370c95782a86e16affd383ed53c18
Signed-off-by: Zhenhua Huang <zhenhuah@codeaurora.org>
8 years agoARM: dts: msm: Add pinctrl for codec reset and interrupt on 8996
Sudheer Papothi [Mon, 8 Jun 2015 17:20:08 +0000 (22:50 +0530)]
ARM: dts: msm: Add pinctrl for codec reset and interrupt on 8996

Change reset and interrupt lines of codec from gpio to pinctrl
on 8996 target to control the drive strength of the pins.

Change-Id: Ie95b80699f1726c2b2e27c1b8e5f51f7ccdd5417
Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
8 years agosoc: qcom: glink: Fix race condition between tx and close operation
Karthikeyan Ramasubramanian [Mon, 7 Dec 2015 23:05:53 +0000 (16:05 -0700)]
soc: qcom: glink: Fix race condition between tx and close operation

The channel is closed locally by the client either as part of SSR or normal
working scenario. The transmit operation does not check the transport or
channel states before queuing the packet for transmit operation. This
causes the transmit operation to access stale transport or channel context.

Check the transport and channel state before queuing the packet for
transmission.

CRs-Fixed: 947627
Change-Id: Ic6f8350b6b5e51b641794255f8520ff4616343bb
Signed-off-by: Karthikeyan Ramasubramanian <kramasub@codeaurora.org>
8 years agotrace: ipc_logging: Destroy debugfs directories with logging contexts
Steven Cahail [Sat, 12 Dec 2015 01:58:42 +0000 (18:58 -0700)]
trace: ipc_logging: Destroy debugfs directories with logging contexts

IPC Logging currently creates debugfs directories for each of its
logging contexts, but does not remove them when destroying the contexts.
If a user attempts to access a directory associated with a destroyed
context, a crash will result.

Destroy debugfs directories when the logging context is destroyed.

Change-Id: I5a3b1cbf2fb5d9d0ede3d9da0fccd605b9fdf619
Signed-off-by: Steven Cahail <scahail@codeaurora.org>
8 years agoARM: dts: msm: enable bta check for nt35597 panel on msm8996
Dhaval Patel [Mon, 30 Nov 2015 18:39:45 +0000 (10:39 -0800)]
ARM: dts: msm: enable bta check for nt35597 panel on msm8996

Enable bta check for nt35597 dual dsi/single dsi(dsc) and
video/command mode panel on msm8996 target.

Change-Id: I0a4dd466719f973690f996e7a0cbe95de9b88ad7
Signed-off-by: Dhaval Patel <pdhaval@codeaurora.org>
8 years agoRevert "ARM: dts: msm: Enable dynamic refresh for sharp WQXGA panel"
Ingrid Gallardo [Fri, 11 Dec 2015 19:03:57 +0000 (11:03 -0800)]
Revert "ARM: dts: msm: Enable dynamic refresh for sharp WQXGA panel"

This reverts commit 9d9fb803fd88c493bd27f7b3af21358f8b16bfe2
("ARM: dts: msm: Enable dynamic refresh for sharp WQXGA panel")
since the dynamic refresh  method enabled by the change is
causing random touch events to be triggered.

Change-Id: Ibfab4827c53635bd8c399b087a9a699f26c69dbc
Signed-off-by: Ingrid Gallardo <ingridg@codeaurora.org>
8 years agonetfilter: Fix to MT call issue
Ravinder Konka [Tue, 10 Mar 2015 11:07:00 +0000 (16:37 +0530)]
netfilter: Fix to MT call issue

Changes to store forced port only in the original direction.
This resolves the MT call issue where destination port is
incorrectly translated to forced_port.

Change-Id: I1b1c407c4beb8185ada0b005b1cd1034cb975141
Signed-off-by: Ravinder Konka <rkonka@codeaurora.org>
8 years agoARM: dts: msm: Remove obsolete USB 'power-collapse' properties
Jack Pham [Fri, 11 Dec 2015 08:43:56 +0000 (00:43 -0800)]
ARM: dts: msm: Remove obsolete USB 'power-collapse' properties

These properties are no longer used and can be removed.

Change-Id: Iea376798a6a9da5ba5a0a6fa4e24c15c1cfe188d
Signed-off-by: Jack Pham <jackp@codeaurora.org>
8 years agoclk: msm: clock-gcc-8996: Add USB_20_BCR
Jack Pham [Fri, 11 Dec 2015 08:44:53 +0000 (00:44 -0800)]
clk: msm: clock-gcc-8996: Add USB_20_BCR

Add the BCR to reset USB20 block to gcc_usb20_master_clk. This will
allow the driver to correctly call clk_reset().

Change-Id: Ib4f8b73317032c88f5272a530007ff08d14dbd4a
Signed-off-by: Jack Pham <jackp@codeaurora.org>
8 years agoqseecom: Add a new smc cmd to check RPMB key provision status
Zhen Kong [Wed, 9 Dec 2015 22:28:30 +0000 (14:28 -0800)]
qseecom: Add a new smc cmd to check RPMB key provision status

A new smc cmd is added to check RPMB key provision status

Change-Id: I50411bf9ae7f31589be34d7b5aaf48f2c12f0018
Signed-off-by: Zhen Kong <zkong@codeaurora.org>
8 years agoASoC: wcd9335: Change RX disconnect port sequence
Phani Kumar Uppalapati [Tue, 1 Dec 2015 22:10:45 +0000 (14:10 -0800)]
ASoC: wcd9335: Change RX disconnect port sequence

Change RX disconnect port sequence so as to avoid
slimbus underflow and audio mute issues during
playback.

Change-Id: I0260e61b78e3bcfe422896dc60b15af84be424a4
Signed-off-by: Phani Kumar Uppalapati <phaniu@codeaurora.org>
8 years agoASoC: wcd9335: update default VBat Bias current
Banajit Goswami [Sat, 5 Dec 2015 07:45:33 +0000 (23:45 -0800)]
ASoC: wcd9335: update default VBat Bias current

Update default value for VBat Bias current for Front-end.
The increase in current value is needed to increase
robustness of VBat ADC output when the feature is used
at low temparature.

Change-Id: Ic924fa59ce867f9b32c17564f8f55406c6c467ea
Signed-off-by: Banajit Goswami <bgoswami@codeaurora.org>
8 years agoASoC: msm: Enable MBHC 5-pole plug detection
Phani Kumar Uppalapati [Sat, 7 Nov 2015 02:42:04 +0000 (18:42 -0800)]
ASoC: msm: Enable MBHC 5-pole plug detection

Enable MBHC (Multi Button Headset Control) 5-pole
plug detection so as to detect the presence of
second microphone whenever any accessory is inserted
in to the headset jack.

Change-Id: I53dda0d18006109c19a1cd8ce0bc4df45a13f0bf
Signed-off-by: Phani Kumar Uppalapati <phaniu@codeaurora.org>
8 years agosoc: qcom: ipc_router_glink_xprt: Fix receive callback
Karthikeyan Ramasubramanian [Tue, 8 Dec 2015 18:13:48 +0000 (11:13 -0700)]
soc: qcom: ipc_router_glink_xprt: Fix receive callback

G-Link driver notifies IPC Router about receive events in atomic context.
Allocate the memory from atomic pool to cache the information about rx
events for deferred processing.

CRs-Fixed: 948393
Change-Id: I09fb7ffd38b5a36b9ef99b6adb76c7e1f0168457
Signed-off-by: Karthikeyan Ramasubramanian <kramasub@codeaurora.org>
8 years agoARM: dts: msm: Disable VDD_APCC ACC regulator devices for msm8996v2
Osvaldo Banuelos [Thu, 10 Dec 2015 17:52:00 +0000 (09:52 -0800)]
ARM: dts: msm: Disable VDD_APCC ACC regulator devices for msm8996v2

Disable the regulator devices which manage ACC settings for
memories powered by VDD_APCC in the CPUSS. In addition, update
the CPR3 controller and regulator devices which manage VDD_APCC
to ensure CPR corner changes do not result in configuring ACC
regulators.

Change-Id: Ib176c762d12e996e809ee0ccf0bc56d5ae37c0f3
Signed-off-by: Osvaldo Banuelos <osvaldob@codeaurora.org>
8 years agomsm: kgsl: Add missing check for size against lower VA
Rajesh Kemisetti [Thu, 10 Dec 2015 10:30:00 +0000 (16:00 +0530)]
msm: kgsl: Add missing check for size against lower VA

_get_unmapped_area_topdown() subtracts the requested size
from lower entry base without really checking its value.

This leads to overflow while working at boundary conditions.

Add a condition to check entry base with the size and proceed.

Change-Id: Ic695da683b11de35c7c4b8936a35d693dc8fa452
Signed-off-by: Rajesh Kemisetti <rajeshk@codeaurora.org>
8 years agomsm: isp: Initialize buffer spin lock
Abhishek Kondaveeti [Thu, 10 Dec 2015 12:41:56 +0000 (18:11 +0530)]
msm: isp: Initialize buffer spin lock

Initialize buffer manager spin lock before
using it

Change-Id: Icef09e9d40bbbe66e90c162dd0ae2f1733ae9a06
Signed-off-by: Abhishek Kondaveeti <akondave@codeaurora.org>
8 years agomsm: kgsl: Prevent deadlock in cmdbatch timer
Tarun Karra [Thu, 22 Oct 2015 19:22:08 +0000 (12:22 -0700)]
msm: kgsl: Prevent deadlock in cmdbatch timer

Dispatcher can acquire drawctxt->lock if context is pending
and the fence it is waiting on just got signalled.
Dispatcher acquires drawctxt->lock and tries to delete the
cmdbatch timer using delete_timer_sync(). Delete_timer_sync()
waits till timer and its pending handlers are deleted.
But if the timer expires at the same time, timer handler
could be waiting on drawctxt->lock leading to a
deadlock. To prevent this use spin_trylock_bh() instead of
spin_lock_bh(). spin_trylock_bh() does not wait for the lock
if it does not get it and allows the timer handler to finish.
This prevents the deadlock.

Change-Id: Ic2344fed5fccb581b58ec0b66b45ba68af9f1459
Signed-off-by: Tarun Karra <tkarra@codeaurora.org>
8 years agosoc: qcom: msm_rtb: Add support for hotplug RTB logging
Sanrio Alvares [Fri, 4 Dec 2015 20:27:08 +0000 (12:27 -0800)]
soc: qcom: msm_rtb: Add support for hotplug RTB logging

Hotplug events are particularly interesting from system
point of view and tracing around the hotplug events would
provide essential information that could be used to debug
system issues.

Change-Id: I23e9539a76e04e222a0a05f27be51cb726ab6c33
Signed-off-by: Sanrio Alvares <salvares@codeaurora.org>
8 years agomsm: ipa2: add active clients logging
Valery Gorohovsky [Thu, 26 Nov 2015 16:27:15 +0000 (18:27 +0200)]
msm: ipa2: add active clients logging

add framework for IPAv2 active clients history logging
logging is enabled by default
cat /sys/kernel/debugfs/ipa/active_clients in order to view logs
echo anything to /sys/kernel/debugfs/ipa/active_clients in order
to clear the history log buffer

Change-Id: I975271798aee56ac9889d34203a32c99a30fc958
Signed-off-by: Valery Gorohovsky <valeryg@codeaurora.org>
8 years agomsm: dba: add additional audio configuration parameters
Vinu Deokaran [Thu, 23 Apr 2015 17:28:20 +0000 (10:28 -0700)]
msm: dba: add additional audio configuration parameters

Add additional audio configuration parameters to the MSM
DBA(Display Bridge Abstraction) interface driver.

Change-Id: I7fef9b1a192a872c2e89dd9a7d6e942a1b77c6cb
Signed-off-by: Vinu Deokaran <vinud@codeaurora.org>
Signed-off-by: Sandeep Panda <spanda@codeaurora.org>
8 years agomsm: mdss: cleanup auto-refresh implementation
Ingrid Gallardo [Thu, 17 Dec 2015 00:43:03 +0000 (16:43 -0800)]
msm: mdss: cleanup auto-refresh implementation

Auto-refresh is used on smart displays to refresh display without
SW intervention, similar to dumb displays. So when it is on, display
controller will automatically send new frame every time panel TE signal
is received. Now as per the HW implementation, disabling auto-refresh
requires that display controller is idle and there is no frame transfer
on-going. To achieve this, we need to follow certain disable sequence.
To implement this disable sequence, clean up current implementation and
introduce auto-refresh state machine.

Change-Id: Iac5d76b6431f7ef2fcd68114e19c5cb5fb02577d
Signed-off-by: Ingrid Gallardo <ingridg@codeaurora.org>
Signed-off-by: Ujwal Patel <ujwalp@codeaurora.org>
8 years agomsm: mdss: check intr line status before handling isr
Dhaval Patel [Tue, 22 Dec 2015 22:22:33 +0000 (14:22 -0800)]
msm: mdss: check intr line status before handling isr

Hardware might return/call the pending interrupt
on one CPU when same interrupt is disabled from other
core. Such parallel processing may lead to unclocked
register access in interrupt context followed by
panic. It is safe to check the interrupt line status
before handling isr to avoid crash in such race
condition.

Change-Id: I460550cb5188c7f77b9f741682917010f9231a50
Signed-off-by: Dhaval Patel <pdhaval@codeaurora.org>
8 years agomsm: mdss: fix deadlock between display and ESD check thread
Ray Zhang [Mon, 18 Jan 2016 07:31:25 +0000 (15:31 +0800)]
msm: mdss: fix deadlock between display and ESD check thread

Display thread holds ov_lock followed by mutex, while the ESD
check thread for cmd mode panel holds mutex followed by ov_lock.
Fix this deadlock by acquiring mutex before ov_lock in ESD check
thread.

Change-Id: I857f780e14a6ccb679e89ff16b19706d205df4b6
Signed-off-by: Ray Zhang <rayz@codeaurora.org>
8 years agomsm: mdss: hdmi: hdcp2p2: fix hdcp 2.2 compliance issues
Ajay Singh Parmar [Tue, 22 Dec 2015 07:59:57 +0000 (23:59 -0800)]
msm: mdss: hdmi: hdcp2p2: fix hdcp 2.2 compliance issues

Send stream management message to sink after topology update. Poll
for new message or authentication required status after successful
receiver or repeater authentication. Also, DDC hardware polls sink
for a given time. Let the polling complete and do not treat intermediate
DDC errors as failures because DDC transaction can pass in next
iteration. Once polling ends, check for errors and timeouts and reset
polling data. Treat these errors as failure only after polling ends.

Change-Id: I286fb00cf935bff493e108c05df625d5ca3ade26
Signed-off-by: Ajay Singh Parmar <aparmar@codeaurora.org>
8 years agomsm: mdss: maintain AD state through idle power collapse
Ping Li [Thu, 17 Dec 2015 02:46:12 +0000 (18:46 -0800)]
msm: mdss: maintain AD state through idle power collapse

When device enters the idle power collapse mode, the entire
AD HW block is powered down, which will cause the previous
AD settings get lost. So when device exits the idle power
collapse mode, we need to store AD to previous state.

In order to achieve this, we need to switch AD mode to 0x85 first
and manually write the last AD strength value to AD register. Keep
this setting for couple of frames, in the meantime, kick off AD
calculator with t_filter_control value of 0 to ramp up the AD
strength from 0 to current target strength. Then switch the mode
back to auto strength (0x81).

Change-Id: Iddc12dbb0da06675141fa9fe049cfe90110defb9
Signed-off-by: Ping Li <pingli@codeaurora.org>
8 years agomsm: mdss: fix NULL pointer dereferencing issues
Jayant Shekhar [Fri, 8 Jan 2016 11:05:29 +0000 (16:35 +0530)]
msm: mdss: fix NULL pointer dereferencing issues

This change fixes the errors reported in static analysis
of MDSS driver code. These changes include fix for various
potential NULL pointer dereferencing and array index out of
bounds issues in MDP, DSI and PP module of MDSS driver.

Change-Id: I49f65f0b4e5218f9fc90469e9d431a3aec811ee2
Signed-off-by: Jayant Shekhar <jshekhar@codeaurora.org>
Signed-off-by: Sandeep Panda <spanda@codeaurora.org>
8 years agomsm: mdss: update PHY timing calculation logic for resolution change
Sandeep Panda [Wed, 6 Jan 2016 06:21:34 +0000 (11:51 +0530)]
msm: mdss: update PHY timing calculation logic for resolution change

In current implementation we are always overriding the PHY read
from dt entry with the ones we are calculating in driver. Update
the PHY timing only when there is a change in resolution.

Change-Id: I2ba936af6e55b27c7b28d38990b32e896c877e08
Signed-off-by: Sandeep Panda <spanda@codeaurora.org>
8 years agomsm: mdss: Use the correct AD backlight for AD BL filter
Ping Li [Wed, 30 Dec 2015 23:49:20 +0000 (15:49 -0800)]
msm: mdss: Use the correct AD backlight for AD BL filter

Use the last backlight sent to AD core for AD backlight filter
threshold comparison.

Change-Id: I8ea26a8a95c700749aa83d5b70a3b16c44258767
Signed-off-by: Ping Li <pingli@codeaurora.org>
8 years agomsm: mdss: Optimize backlight mapping calculation for AD
Ping Li [Wed, 30 Dec 2015 04:47:41 +0000 (20:47 -0800)]
msm: mdss: Optimize backlight mapping calculation for AD

Reduce the rounding error during AD backlight linearization and
attenuation.

Change-Id: Ibf181414512d457d3341bbccf8cf9338aef8ac76
Signed-off-by: Ping Li <pingli@codeaurora.org>
8 years agomsm: mdss: Correctly reset the ad_events count
Ping Li [Wed, 16 Dec 2015 03:27:57 +0000 (19:27 -0800)]
msm: mdss: Correctly reset the ad_events count

Reset the ad_events count in the AD ioctl instead of ad_setup().
There are some time delay between AD ioctl and ad_setup, which is
part of the display commit path, so if we reset the ad_event count
in ad_setup, then it is possible that user space reads the ad_events
sysfs node after the AD ioctl but before the ad_setup(). In that
case, user space may get the incorrect ad_events count, and cause
the gradual AD off fail.

Change-Id: I13f2043a6a21be7e49b44a964b00b0aa4315dc17
Signed-off-by: Ping Li <pingli@codeaurora.org>
8 years agomsm: mdss: add multiple register support in ESD check
Ray Zhang [Thu, 3 Dec 2015 06:52:58 +0000 (14:52 +0800)]
msm: mdss: add multiple register support in ESD check

Current implementation cannot support multiple registers
in ESD check, and it does not work for many cases. For
example, some panels need check multiple registers to get
its status, and some panels might return several possible
values for one register read.

To support this kind of behaviors, a new property in dtsi
is added as "qcom,mdss-dsi-panel-status-valid-params" which
specifies the valid value length we should check in the
payload returned by panel, and the payload length panel
should return is specified by the property "qcom,mdss-dsi-
panel-status-read-length". "qcom,mdss-dsi-panel-status-value"
is also extended to an array which specifies all the possible
return values from panel.

Change-Id: I098d04281b819581f53c7c509778e7b594aa499a
Signed-off-by: Ray Zhang <rayz@codeaurora.org>
8 years agomsm: mdss: Add support to retain AD RAMs
Ping Li [Fri, 18 Dec 2015 00:54:47 +0000 (16:54 -0800)]
msm: mdss: Add support to retain AD RAMs

Modify the MDP_CBCR bits to retain the AD RAMs through idle power
collapse(IPC).

Bits setting when device enters IPC:
  - MEM_CORE_ON: 1
  - MEM_PERIPH_ON: 0
  - MEM_PERIPH_OFF: 1
Bits setting when device exits the IPC:
  - MEM_CORE_ON: 1
  - MEM_PERIPH_ON: 1
  - MEM_PERIPH_OFF: 0

Change-Id: I10749312d905eb4629e94e396b1604667738e84f
Signed-off-by: Ping Li <pingli@codeaurora.org>
8 years agomsm: mdss: add min vote on the bus before iommu attach
Kalyan Thota [Thu, 7 Jan 2016 09:38:01 +0000 (15:08 +0530)]
msm: mdss: add min vote on the bus before iommu attach

MDSS needs a min vote on sysmmnoc clk to perform TZ and
IOMMU operations. This vote is needed for few low tier
chipsets.

Change-Id: Iff8c775bfc2001f0bae5118427334793bf392bc0
Signed-off-by: Kalyan Thota <kalyant@codeaurora.org>
8 years agoclk: msm: mdss: Read PLL/PHY status once during bootup
Tatenda Chipeperekwa [Fri, 8 Jan 2016 00:32:20 +0000 (16:32 -0800)]
clk: msm: mdss: Read PLL/PHY status once during bootup

Read the PLL/PHY status once during bootup to avoid delays
due to polling. Polling for PLL/PHY status is only required
when handling HDMI use cases in which the cable is connected
after bootup is complete.

Change-Id: Ie1d5983a7784cb5f3472527d1b510f128ae9d325
Signed-off-by: Tatenda Chipeperekwa <tatendac@codeaurora.org>
8 years agomsm: mdss: debug: add xin id to pipe dump
Ingrid Gallardo [Tue, 10 Nov 2015 18:13:17 +0000 (10:13 -0800)]
msm: mdss: debug: add xin id to pipe dump

Add the xin id information on the dump of the
pipes.

Change-Id: I20d63e02d0f36f1d173185c520b7c448ead7409d
Signed-off-by: Ingrid Gallardo <ingridg@codeaurora.org>
8 years agomsm: mdss: make sure backlight is off during suspend
Padmanabhan Komanduru [Wed, 30 Dec 2015 11:45:53 +0000 (17:15 +0530)]
msm: mdss: make sure backlight is off during suspend

The backlight of the display panel will not get turned off during
suspend if there are no display commits between suspend/resume
since allow_bl_update will only be set to 'true' after first
valid display commit after resume. This is possible for power
off charging use-case where there will be only one display
commit initially and later just the content of the buffer gets
updated without anymore display commits across suspend/resume.
Make sure the backlight is turned off during suspend by
explicitly setting allow_bl_update to 'true' before trying to
set the backlight to zero.

Change-Id: I10f39e3913e5b40a61066f0bbce3a7a8f1a9441b
Signed-off-by: Padmanabhan Komanduru <pkomandu@codeaurora.org>
8 years agomsm: mdss: move used pipes to cleanup list on overlay free
Veera Sundaram Sankaran [Tue, 5 Jan 2016 21:32:57 +0000 (13:32 -0800)]
msm: mdss: move used pipes to cleanup list on overlay free

Avoid moving pipes to destroy list during overlay free based on
the pipe play count as it might not give the actual information.
The play count is set to 0 for all new or config changed pipes
during the validate call. And if we get a fb_release_all request
right after the validate, it would indicate an inconsistent state
for the play count. Instead, move the used pipes to cleanup list,
so that the NULL kickoff would handle the pipes to be unstaged
and destroyed.

Change-Id: I0026d512e92d0d59962ee8114873f7804a31c018
Signed-off-by: Veera Sundaram Sankaran <veeras@codeaurora.org>
8 years agomsm: mdss: remove interrupt handler when pingpong is not present
Ray Zhang [Thu, 24 Dec 2015 09:28:51 +0000 (17:28 +0800)]
msm: mdss: remove interrupt handler when pingpong is not present

Remove pingpong interrupt handler when pingpong done interrupt is
not present. This will ensure no unexpected pingpong is reported
which might lead to confliction with the destroying ctx.

Change-Id: I9a7173fb19e55344cedcfeccdaf23efaba11892c
Signed-off-by: Ray Zhang <rayz@codeaurora.org>
8 years agomsm: mdss: set default resolution of DBA driver during boot
Sandeep Panda [Thu, 31 Dec 2015 05:03:31 +0000 (10:33 +0530)]
msm: mdss: set default resolution of DBA driver during boot

In cases of EDID read or parser failures, driver should expose
a default resolution to other modules to continue with the HDMI
initialization. So during bridge chip initialization sequence
update the default resolution.

Change-Id: Ia6a7f8b4d9e3f1650b9c11aafc118a2662801ba0
Signed-off-by: Sandeep Panda <spanda@codeaurora.org>
8 years agomsm: mdss: alter linear_map to incorporate rounding for AD
Krishna Chaitanya Parimi [Tue, 17 Mar 2015 06:41:45 +0000 (12:11 +0530)]
msm: mdss: alter linear_map to incorporate rounding for AD

The helper function linear_map would take the integral part
of the calculated map, thereby causing issues with getting
the same value after consecutive map and inverse map calls.

For ex: linear_map(21, out, 255, 4095) would translate to
        *out = 21 * 4095 / 255 = 337, whereas inverse case
        linear_map(337, out, 4095, 255) would translate to
        *out = 337 * 255 / 4095 = 20

Changing linear_map from ((in * out_max) / in_max) to a more
precise ((2 * (in * out_max) + in_max) / (2 * in_max)) for
incorporating rounding in the integral mapping.

Change-Id: I15cd8aa1326813ce3cb3a426cbb4e78374623c72
Signed-off-by: Krishna Chaitanya Parimi <cparimi@codeaurora.org>
8 years agomsm: mdss: disable auto refresh before configuring tearcheck
Sandeep Panda [Fri, 4 Dec 2015 10:40:37 +0000 (16:10 +0530)]
msm: mdss: disable auto refresh before configuring tearcheck

If auto refresh mode is enabled in LK, then it needs be disabled
when kernel loads. Otherwise it might cause display corruption,
when in kernel display again configures tearcheck block.

Change-Id: I0b4dddee25e39cea4f32b8afd537993ad64ea812
Signed-off-by: Sandeep Panda <spanda@codeaurora.org>
8 years agomsm: mdss: turn on the mdss clocks when enabling vsync
Kalyan Thota [Tue, 29 Dec 2015 10:04:32 +0000 (15:34 +0530)]
msm: mdss: turn on the mdss clocks when enabling vsync

Switch on the mdss clocks while enabling vsync irq.
Since mdss clocks are refcounted and irq is asynchronus
there can be case as clocks are off and irq is triggered.

This change will add a refcount while enabling irq so that
clocks are on when irq is triggered.

Change-Id: I90728f6d94b9d846b2c805a68ee49a6ef2a8ffc3
Signed-off-by: Kalyan Thota <kalyant@codeaurora.org>
8 years agomsm: mdss: ensure rotator clocks on for entire rotator session
Jayant Shekhar [Mon, 21 Dec 2015 04:51:16 +0000 (10:21 +0530)]
msm: mdss: ensure rotator clocks on for entire rotator session

Rotator clock and BW votes are updated on each rotator request
during same session. This is not required because rotator source
and destination does not change during session. Ensure that
rotator clocks are on throughout session such that extra overhead
of rpm calls are avoided.

Change-Id: I7a74aa2b8d8556b1d8ee4c52f871b9ebb149764a
Signed-off-by: Jayant Shekhar <jshekhar@codeaurora.org>
8 years agomdss: fix dynamic FPS mode switch configuration
Chandan Uddaraju [Wed, 23 Dec 2015 19:03:49 +0000 (11:03 -0800)]
mdss: fix dynamic FPS mode switch configuration

For dual DSI panels, DFPS mode switch configuration through
sysfs is not properly enabled for the second DSI interface.
Fix this by initializing the mode switch update variable.

While changing the DFPS mode, idle-time should be disabled
and the device should be configured to default FPS. Add
these checks when DFPS mode switch is initiated.

Change-Id: Ib9e67f20758e2fb1c72a747c31109364db1d1160
Signed-off-by: Chandan Uddaraju <chandanu@codeaurora.org>
8 years agomsm: mdss: read DSI CTRL and PHY revision properly
Sandeep Panda [Thu, 24 Dec 2015 02:52:48 +0000 (08:22 +0530)]
msm: mdss: read DSI CTRL and PHY revision properly

In the current implementation DSI PHY revision is read once
DSI PHY initialization is complete. But this needs to be done
before initializing PHY, so that correct PHY initialization
sequence can be executed.

Change-Id: I6f0cd59d63d0a8c0a5d47284f2e86e72f37d099f
Signed-off-by: Sandeep Panda <spanda@codeaurora.org>
8 years agomsm: mdss: separate out DBA and CEC functionality from DSI
Sandeep Panda [Fri, 6 Nov 2015 19:19:57 +0000 (00:49 +0530)]
msm: mdss: separate out DBA and CEC functionality from DSI

Currently, DBA (Display Bridge Abstract) related functionality
is being used in DSI files. Carve out DBA related functionality
into a new file which serves as a utility module and can be used
by any MDSS driver.

Define CEC on/enable functions in DBA (Display Bridge Abstract) so that
clients can enable disable CEC based on other dependent CEC modules.
Separate out CEC abstract data with CEC driver data and initialize and
release corresponding modules properly.

Change-Id: I84f53d99547dcd4ce0b8275401b03ed8e96e14d5
Signed-off-by: Ajay Singh Parmar <aparmar@codeaurora.org>
Signed-off-by: Sandeep Panda <spanda@codeaurora.org>
8 years agomsm: mdss: configure DSI PHY regulator when coming out of idle collapse
Sandeep Panda [Wed, 16 Dec 2015 10:23:26 +0000 (15:53 +0530)]
msm: mdss: configure DSI PHY regulator when coming out of idle collapse

In command mode static screen usecase if DSI PHY was clamped and
then MDSS was reset by power collapsing it, in that case reconfigure
DSI PHY regulator while coming out of power collapse. This will avoid
DSI PHY stuck issue when there are two independent displays running.

Change-Id: I6c33244c332d97522b66cbb9191fce0a268bf9f4
Signed-off-by: Sandeep Panda <spanda@codeaurora.org>
8 years agomsm: mdss: properly handle dsi phy regulator for dual dsi case
Sandeep Panda [Mon, 10 Aug 2015 08:18:05 +0000 (13:48 +0530)]
msm: mdss: properly handle dsi phy regulator for dual dsi case

In dual dsi case, if we do DSI PHY sw reset for one DSI controller
then it will reset the DSI PHY regulator also. Since DSI PHY
regulator is shared among both the DSI controllers, it might cause
side effects on the other DSI controller if that is active. So only
reset DSI PHY lane and PHY HW as when one of the DSI controller is
still in active state. Also avoid reconfiguring DSI PHY regulator in
dual dsi case if the other DSI controller is active.

Change-Id: I5ad1251c89e8ad3f521c4e5c11607494e14143cf
Signed-off-by: Sandeep Panda <spanda@codeaurora.org>
8 years agomsm: mdss: enable clocks before doing SW reset during recovery
Sandeep Panda [Sat, 19 Dec 2015 03:00:30 +0000 (08:30 +0530)]
msm: mdss: enable clocks before doing SW reset during recovery

There can be unclocked register access during DSI FIFO empty
error recovery case in command mode, so enable DSI core clocks
prior to doing SW reset.

Change-Id: Ic48561b979f1a13304dc2fa29f8008e8ff63c8ca
Signed-off-by: Sandeep Panda <spanda@codeaurora.org>
8 years agomsm: mdss: avoid panel status check when panel is off
Dhaval Patel [Thu, 17 Dec 2015 22:25:17 +0000 (14:25 -0800)]
msm: mdss: avoid panel status check when panel is off

Sending BTA or other panel check status commands to the
panel, when panel is off might lead to abnormal
behavior. Since client can poll for the panel status
anytime, add necessary checks to avoid sending commands
when panel is off.

Change-Id: I95acc3df464d0a4640b79963b5701fcde79646d5
Signed-off-by: Dhaval Patel <pdhaval@codeaurora.org>
8 years agovideo: msm: mdss: Fix error in log message
Naseer Ahmed [Mon, 11 Jan 2016 22:14:32 +0000 (17:14 -0500)]
video: msm: mdss: Fix error in log message

The log message which is only active in modem build is missing
an argument causing build error. This commit fixes it.

Change-Id: I7e66c34c22e13a0063af93cbf725cfd9c24ffb99
Signed-off-by: Naseer Ahmed <naseer@codeaurora.org>
8 years agomsm: mdss: fix 32-bit compilation errors in HDMI driver
Vishnuvardhan Prodduturi [Fri, 18 Dec 2015 11:32:39 +0000 (17:02 +0530)]
msm: mdss: fix 32-bit compilation errors in HDMI driver

HDMI driver has compilation issue in 32-bit mode due to incorrect
type casting. This patche fixes the same.

Change-Id: Ie620b1059f37b858beadf61ff8e100312b1bb988
Signed-off-by: Vishnuvardhan Prodduturi <vproddut@codeaurora.org>
8 years agoclk: msm: mdss: add DT support for SSC frequency and PPM values
Padmanabhan Komanduru [Wed, 16 Dec 2015 12:05:13 +0000 (17:35 +0530)]
clk: msm: mdss: add DT support for SSC frequency and PPM values

The SSC frequency and PPM values are currently hardcoded in the
DSI PLL driver. Add DT properties to specify the SSC frequency
and SSC PPM values for DSI SSC feature.

Change-Id: I0faed9f48694f7407c6855b067ffa4510d7e3fdd
Signed-off-by: Padmanabhan Komanduru <pkomandu@codeaurora.org>
8 years agomsm: mdss: Remove redundant handoff pending check
Jayant Shekhar [Thu, 17 Dec 2015 04:54:48 +0000 (10:24 +0530)]
msm: mdss: Remove redundant handoff pending check

In overlay start, currently there is a check that if
splash handoff is pending then fail the overlay start
for that particular fb. Remove this check as this is
not required anymore. HAL should take care that it
calls fb open (for HDMI) only after splash cleanup is
done.

Change-Id: Ie20bd778ba8df2bd54c3804870ad4e8bb45702b8
Signed-off-by: Jayant Shekhar <jshekhar@codeaurora.org>
8 years agomsm: mdss: Send backlight sysfs notification in all BL update locations
Benet Clark [Tue, 15 Dec 2015 06:24:16 +0000 (22:24 -0800)]
msm: mdss: Send backlight sysfs notification in all BL update locations

There are two places where the backlight can get updated. Currently, the
sysfs notification only happens in mdss_fb_set_backlight. If the backlight
is restored during the first display commit, the backlight update occurs
in mdss_fb_update_backlight. This change adds the sysfs notification in
update_backlight.

Change-Id: Iffa1e4f0aa0cdc8babb1b6683d3175795f4b4d27
Signed-off-by: Benet Clark <benetc@codeaurora.org>
Signed-off-by: Krishna Chaitanya Parimi <cparimi@codeaurora.org>
CRs-fixed: 949146

8 years agomsm: mdss: update mdp capabilites with pipe status
Dhaval Patel [Thu, 15 Oct 2015 21:52:16 +0000 (14:52 -0700)]
msm: mdss: update mdp capabilites with pipe status

Update mdp capabilities with pipe index, type,
handoff status and display interface number information.

Change-Id: I3ff1c66cb20bb1a45a67eb952d7cdaa7e360d377
Signed-off-by: Dhaval Patel <pdhaval@codeaurora.org>
8 years agomsm: mdss: update DSI PHY enable sequence based on PHY revision
Sandeep Panda [Mon, 14 Dec 2015 14:19:01 +0000 (19:49 +0530)]
msm: mdss: update DSI PHY enable sequence based on PHY revision

In the current implementation DSI controller version is used to
determine which PHY enable sequence should be used. But this will
fail in case of platforms where DSI controller version is same as
older platforms but PHY version is new. So change the version check
to be based on PHY version instead for controller version.

Change-Id: I636a6442e84f1bd549b6a125cfb991402e53c796
Signed-off-by: Sandeep Panda <spanda@codeaurora.org>
8 years agomsm: mdss: reset intf_stopped flag for sctl when exiting LP states
Veera Sundaram Sankaran [Fri, 11 Dec 2015 22:22:28 +0000 (14:22 -0800)]
msm: mdss: reset intf_stopped flag for sctl when exiting LP states

When exiting low power state (LP1 of LP2), ensure that the intf_stopped
flag is reset for the secondary ctl as well, otherwise it may result in
the display corruption for that ctl path.

Change-Id: I2ac9cff00e25a3cae6999e33c9f5a7a959413277
Signed-off-by: Veera Sundaram Sankaran <veeras@codeaurora.org>
8 years agomsm: mdss: fix new and used pipe config in layer validation
Dhaval Patel [Fri, 4 Dec 2015 16:14:40 +0000 (08:14 -0800)]
msm: mdss: fix new and used pipe config in layer validation

Pipes present in destroy and cleanup list are considers
as used pipes during layer validation. This assumption
is wrong. Async update should not be supported for such
pipes because they are not stagged in current draw cycle.
These pipes should also go through destroy cleanup process
if any layer validation fails during the atomic ioctl check.

Change-Id: I11ba16db40634e32e7f55af4e19f6cb42530b1f4
Signed-off-by: Dhaval Patel <pdhaval@codeaurora.org>