Commit graph

2430 commits

Author SHA1 Message Date
Andrey Markovytch
a15fd37785 qseecom: added small sleep between busy-wait calls to TZ
In case of time penalty coming from TZ side when the wrong password
is entered too many times, there should be sleep between the scm calls
to give other HLOS tasks opportunity to run. Otherwise starvation may
occur.

Change-Id: I345a9b6c82fb5e591d8bdcf48afed48ccaafddc3
Signed-off-by: Andrey Markovytch <andreym@codeaurora.org>
2016-06-09 15:11:59 -07:00
Weiyin Jiang
7966b0d08e ASoC: msm: audio-effects: fix stack overread and heap overwrite
Fix overwrite of updt_params allocated in heap, and stack overread
where param pointer is passed from user space.

CRs-Fixed: 989628
Change-Id: Ida8bdb7da2fcb97023dce3b6eafe4b899a51cb66
Signed-off-by: Weiyin Jiang <wjiang@codeaurora.org>
2016-05-06 12:06:24 -07:00
Vidyakumar Athota
d886b34289 msm: ultrasound: Various static analysis fixes
Remove potential null dereference.
Remove dead code from impossible error check.
Set upper bound for user-provided buffer size.

Change-Id: I212f3edfa31e9168d11e0782da7f3fd8c2b98c5d
Signed-off-by: Vidyakumar Athota <vathota@codeaurora.org>
2016-05-06 12:06:20 -07:00
Zhen Kong
404b7fade5 qseecom: add a new flag commonlib64-loaded-by-uefi
Add flag commonlib64-loaded-by-uefi to indicate commonlib64
is loaded by uefi already.

Change-Id: I9dd3f6bf92e178f1207424b09f39f2e08164df17
Signed-off-by: Zhen Kong <zkong@codeaurora.org>
2016-05-05 15:14:36 -07:00
Weiyin Jiang
9847f9ca84 ASoC: msm: audio-effects: misc fixes in h/w accelerated effect
Adding memory copy size check and integer overflow check in h/w
accelerated effect driver.

Change-Id: I17d4cc0a38770f0c5067fa8047cd63e7bf085e48
CRs-Fixed: 1006609
Signed-off-by: Weiyin Jiang <wjiang@codeaurora.org>
2016-05-03 15:52:37 -07:00
Shiv Maliyappanahalli
8bc5414b74 ASoC: msm: qdsp6v2: use session id for token value
Read commands are currently assigning 64bit physical address
to 32bit token. There is a possibility that this physical address
may have same lower 32bit values which could cause errors. Fix
by assigning session id as the token value.

Change-Id: Ie704e34338201ecec191b2031d20552691aed3ea
Signed-off-by: Shiv Maliyappanahalli <smaliyap@codeaurora.org>
2016-04-12 15:49:49 -07:00
Shiv Maliyappanahalli
6a9927bfd7 ASoC: msm: qdsp6v2: use token for tracking no wait cmd
Use tokens to track all active no wait commands.
In ASM driver, certain commands are waited on to get response
from ADSP. There is a possibility that certain no-wait
commands can be improperly recognized and woken up leading
to time outs.

Change-Id: I2030a354493845b63cf92d35ca4eaadef38cfb79
Signed-off-by: Shiv Maliyappanahalli <smaliyap@codeaurora.org>
2016-04-12 15:49:48 -07:00
Adrian Salido-Moreno
be23185307 Merge branch 'mdss-final-replay' into msm-4.4
This merge brings all display changes from msm-3.18 kernel

* (58 commits)
  msm: mdss: add support for additional DMA pipes
  msm: mdss: refactor device tree pipe parsing logic
  msm: mdss: refactor mixer configuration code
  msm: mdss: add support for secure display on msm8953.
  msm: mdss: disable ECG feature on 28nm PHY platform
  msm: mdss: send DSI command using TPG when in secure session
  msm: mdss: Update histogram and PA LUT in mdss V3
  msm: mdss: validate layer count before copying userdata
  msm: mdss: Fix potential NULL pointer dereferences
  Revert "msm: mdss: Remove redundant handoff pending check"
  msm: mdss: hdmi: Do not treat intermediate ddc error as failure
  msm: mdss: revisit igc pipe enumeration logic
  msm: mdss: Add PA support for mdss V3
  msm: mdss: Add support for mdss v3 ops
  msm: mdss: Update the postprocessing ops using mdss revision
  msm: mdss: update the caching payload based on mdss version
  msm: clk: hdmi: add support for atomic update
  msm: sde: Add v4l2 rotator driver to enable multi-context usecase
  msm: mdss: refactor pipe type checks
  msm: mdss: add proper layer zorder validation
  msm: mdss: stub bus scaling functions if driver is disabled
  msm: mdss: avoid failure if primary panel pref is not enabled
  msm: adv7533: add support for clients to read audio block
  msm: mdss: add lineptr interrupt support for command mode panels
  msm: mdss: update rotator frame rate in the pipe configuration
  mdss: msm: Avoid excessive failure logs in igc config
  msm: mdss: delay dma commands for split-dsi cmd mode panels
  msm: mdss: enable GDSC before enabling clocks in MDP3 probe
  mdss: dsi: turn off phy power supply during static screen
  mdss: dsi: read dsi and phy revision during dsi ctrl probe
  msm: mdss: Fix memory leak in MDP3 driver
  msm: mdss: delay overlay start until first update for external
  msm: mdss: free splash memory for MSM8909w after splash done
  msm: mdss: hdmi: separate audio from transmitter core
  msm: mdss: disable dsi burst mode when idle is enabled
  msm: mdss: remove invalid csc initialization during hw init
  msm: mdss: dsi: increase dsi error count only for valid errors
  msm: mdss: remove HIST LUT programming in mdss_hw_init
  msm: mdss: dsi: ignore error interrupt when mask not set
  msm: mdss: add support to configure bus scale vectors from dt
  msm: mdss: unstage the pipe if there is z_order mismatch
  msm: mdss: squash MDP3 driver changes and SMMU change
  msm: mdss: Read the bridge chip name and instance id from DTSI
  msm: mdss: Enable continuous splash on bridge chip
  msm: mdss: Fix multiple bridge chip usecase
  msm: mdss: Enable export of mdss interrupt to external driver
  msm: mdss: rotator: turn off rotator clock in wq release
  msm: mdss: fix ulps during suspend feature logic
  clk: msm: mdss: program correct divider for PLL configuration
  msm: mdss: fix DSI PHY timing configuration logic
  msm: mdss: hdmi: add support for hdmi simulation
  msm: mdss: handle race condition in pingpong done counter
  clk: qcom: mdss: calculate pixel clock for HDMI during handoff
  msm: mdss: ensure proper dynamic refresh programming for dual DSI
  msm: mdss: Add fps flag and update blit request version
  msm: mdss: initialize fb split values during fb probe
  mdss: mdp: fix rotator compat layer copy
  msm: mdss: handle DSI ctrl/PHY regulator control properly

CRs-Fixed: 1000197
Change-Id: I521519c8abe8eed6924e2fbe3e1a026126582b77
Signed-off-by: Adrian Salido-Moreno <adrianm@codeaurora.org>
2016-04-12 15:49:34 -07:00
Zhen Kong
2afa009826 qseecom: don't release ion share memory if scm_call unload TA failed
If a scm_call request to shutdown a TA fails, the TA is not shut down
and still in use, and the resources aren't necessarily leaked. Since
shared memory are still locked in this situation, ion shared memory
cannot be released, otherwise XPU violation occurs. Only need to
release shared memory if TA is unloaded success or that TA cannot
be found

Change-Id: I971485fb541193f77960cc7ca14b5b09de938a43
Signed-off-by: Zhen Kong <zkong@codeaurora.org>
2016-03-25 16:03:33 -07:00
Zhen Kong
d328092b8d qseecom: move compat_qseecom.h
The uapi directory shouldn't contain compat definitions,
so move this file out of there.

Change-Id: Ieef35ec02157c253a137c1b1bce3c6518c7f1b31
Signed-off-by: Jeremy Gebben <jgebben@codeaurora.org>
Signed-off-by: Zhen Kong <zkong@codeaurora.org>
2016-03-25 16:03:16 -07:00
AnilKumar Chimata
9a11e43908 qseecom: Remove the dead code from driver
For kernel clients, some of the flags are maintained which is not required
as those are specific to userspace clients. So remove the code which is
not required.

Change-Id: If7fb51cc17e9a8c0f3c2632e9c42d84489bda4f6
Signed-off-by: Mallikarjuna Reddy Amireddy <mamire@codeaurora.org>
2016-03-25 16:02:31 -07:00
Devesh Jhunjhunwala
a6d5966010 msm: qpnp-misc: add support to configure PWM source
Add the qcom,pwm-sel and qcom,enable-gp-driver properties to
the MISC device driver to enable configuring the PWM source.
Currently this will be supported only for pmdcalifornium.

CRs-Fixed: 972331
Change-Id: I320edac22b20d748a531a41eaff06162092cfd3d
Signed-off-by: Devesh Jhunjhunwala <deveshj@codeaurora.org>
2016-03-25 16:02:30 -07:00
Devesh Jhunjhunwala
9e52e2e2dd misc: Update the QPNP_MISC Kconfig entry
Let the QPNP_MISC config depend on the SPMI or the
MSM_SPMI configs instead of SPMI only.

CRs-Fixed: 972331
Change-Id: I9a0d53c6cf0aeeaf258cfca5706c68a6a8b7e37a
Signed-off-by: Devesh Jhunjhunwala <deveshj@codeaurora.org>
2016-03-23 21:21:23 -07:00
Andy Gross
7a045fd0fd misc: Add snapshot of QPNP misc driver
This patch adds a snapshot of the QPNP misc driver as of msm-3.14
commit:
e016c39467094409c9c872b02ec619164913054a (Merge "msm: thermal:
Fix compilation issue when THERMAL_MONITOR is disabled")

CRs-Fixed: 972331
Change-Id: I48dc9857379c388ddff86b20320cdfa23bb22af8
Signed-off-by: Andy Gross <agross@codeaurora.org>
Signed-off-by: Devesh Jhunjhunwala <deveshj@codeaurora.org>
2016-03-23 21:21:22 -07:00
Zhen Kong
f6b4ea8dca qseecom: release ION memory if qseecom failed to unload app
To avoid memory leakage, make change to release ION memory if qseecom
failed to unload TZ app, which is allocated when starting app.

CRs-Fixed: 977073
Change-Id: Ic4c9a7d7a118ff5026ce6ce7769a4c053906ed2d
Signed-off-by: Zhen Kong <zkong@codeaurora.org>
2016-03-23 21:20:46 -07:00
AnilKumar Chimata
2f0b2a8d5f qseecom: Fix stack out of bounds issue
While copying the request buffer to temporary buffer large size
of request buffer is copied which leads to accessing stack out
of its size.

<3>[   24.265116] ==================================================================
<3>[   24.271333] BUG: KASAN: stack-out-of-bounds in memcpy+0x28/0x54 at addr ffffffc05890b744
<3>[   24.279388] Read of size 4096 by task vold/362
<0>[   24.283819] page:ffffffba494e3790 count:0 mapcount:0 mapping:          (null) index:0x0
<0>[   24.291800] flags: 0x0()
<1>[   24.294318] page dumped because: kasan: bad access detected
<6>[   24.299884] CPU: 1 PID: 362 Comm: vold Not tainted 3.18.20-g7bb9977 #1
<6>[   24.299895] Hardware name: Qualcomm Technologies, Inc. MSM8937-PMI8950 MTP (DT)
<0>[   24.299904] Call trace:
<6>[   24.302314] [<ffffffc00008c80c>] dump_backtrace+0x0/0x284
<6>[   24.302329] [<ffffffc00008caa0>] show_stack+0x10/0x1c
<6>[   24.302345] [<ffffffc001e7c4ac>] dump_stack+0x74/0xfc
<6>[   24.302362] [<ffffffc0002f8880>] kasan_report+0x3b4/0x504
<6>[   24.302376] [<ffffffc0002f7ae0>] __asan_loadN+0x20/0x14c
<6>[   24.302389] [<ffffffc0002f7fe4>] memcpy+0x24/0x54
<6>[   24.302406] [<ffffffc000bfdf80>] qseecom_scm_call2+0xec0/0x1c94
<6>[   24.302421] [<ffffffc000c00798>] qseecom_scm_call.constprop.41+0x64/0x7c
<6>[   24.302436] [<ffffffc000c0513c>] qseecom_create_key+0x304/0x680
<6>[   24.302450] [<ffffffc000c1084c>] qseecom_ioctl+0x2fb8/0x4944
<6>[   24.302464] [<ffffffc000333f70>] do_vfs_ioctl+0x9c8/0xb0c
<6>[   24.302476] [<ffffffc00033410c>] SyS_ioctl+0x58/0x8c
<3>[   24.302484] Memory state around the buggy address:
<3>[   24.307080]  ffffffc05890b680: f2 f2 f2 f2 00 04 f4 f4 f2 f2 f2 f2 00 00 00 00
<3>[   24.314283]  ffffffc05890b700: 04 f4 f4 f4 f2 f2 f2 f2 00 00 00 00 00 00 00 00
<3>[   24.321488] >ffffffc05890b780: 00 f4 f4 f4 f2 f2 f2 f2 00 00 00 00 00 00 00 00
<3>[   24.328690]                       ^
<3>[   24.332164]  ffffffc05890b800: 00 00 04 f4 f3 f3 f3 f3 00 00 00 00 00 00 00 00
<3>[   24.339369]  ffffffc05890b880: 00 00 00 00 00 00 00 00 00 00 00 00 f1 f1 f1 f1
<3>[   24.346571] ==================================================================
<4>[   24.353777] Disabling lock debugging due to kernel taint
<3>[   24.533597] QSEECOM: __qseecom_process_incomplete_cmd: fail:resp res= -65,app_id = 0,lstr = 12288
<6>[   24.541522] get_ice_device_from_storage_type: found ice device ffffffc05bd61f80
<3>[   24.545296] ==================================================================
<3>[   24.551503] BUG: KASAN: stack-out-of-bounds in memcpy+0x28/0x54 at addr ffffffc05890b7c4
<3>[   24.559558] Read of size 4096 by task vold/362
<0>[   24.563989] page:ffffffba494e3790 count:0 mapcount:0 mapping:          (null) index:0x0
<0>[   24.571966] flags: 0x0()
<1>[   24.574485] page dumped because: kasan: bad access detected
<6>[   24.580050] CPU: 1 PID: 362 Comm: vold Tainted: G    B          3.18.20-g7bb9977 #1
<6>[   24.580060] Hardware name: Qualcomm Technologies, Inc. MSM8937-PMI8950 MTP (DT)
<0>[   24.580069] Call trace:
<6>[   24.582482] [<ffffffc00008c80c>] dump_backtrace+0x0/0x284
<6>[   24.582497] [<ffffffc00008caa0>] show_stack+0x10/0x1c
<6>[   24.582513] [<ffffffc001e7c4ac>] dump_stack+0x74/0xfc
<6>[   24.582529] [<ffffffc0002f8880>] kasan_report+0x3b4/0x504
<6>[   24.582543] [<ffffffc0002f7ae0>] __asan_loadN+0x20/0x14c
<6>[   24.582556] [<ffffffc0002f7fe4>] memcpy+0x24/0x54
<6>[   24.582574] [<ffffffc000bfe128>] qseecom_scm_call2+0x1068/0x1c94
<6>[   24.582588] [<ffffffc000c00798>] qseecom_scm_call.constprop.41+0x64/0x7c
<6>[   24.582603] [<ffffffc000c04c30>] __qseecom_set_clear_ce_key+0xf4/0x2fc
<6>[   24.582616] [<ffffffc000c05334>] qseecom_create_key+0x4fc/0x680
<6>[   24.582630] [<ffffffc000c1084c>] qseecom_ioctl+0x2fb8/0x4944
<6>[   24.582644] [<ffffffc000333f70>] do_vfs_ioctl+0x9c8/0xb0c
<6>[   24.582656] [<ffffffc00033410c>] SyS_ioctl+0x58/0x8c
<3>[   24.582664] Memory state around the buggy address:
<3>[   24.587250]  ffffffc05890b700: 04 f4 f4 f4 f2 f2 f2 f2 00 00 00 00 00 00 00 00
<3>[   24.594453]  ffffffc05890b780: 00 f4 f4 f4 f2 f2 f2 f2 00 00 00 00 00 00 00 00
<3>[   24.601656] >ffffffc05890b800: 00 00 04 f4 f3 f3 f3 f3 00 00 00 00 00 00 00 00
<3>[   24.608860]                          ^
<3>[   24.612596]  ffffffc05890b880: 00 00 00 00 00 00 00 00 00 00 00 00 f1 f1 f1 f1
<3>[   24.619802]  ffffffc05890b900: 04 f4 f4 f4 f2 f2 f2 f2 00 f4 f4 f4 f2 f2 f2 f2
<3>[   24.627001] ==================================================================
<6>[   24.799462] get_ice_device_from_storage_type: found ice device ffffffc05bd61f80
<3>[   24.803065] QSEECOM: qseecom_create_key: Set the key successfully

Change-Id: Id683067d29531686dafe94114ba3329f87292923
Signed-off-by: AnilKumar Chimata <anilc@codeaurora.org>
2016-03-23 21:20:33 -07:00
Ashay Jaiswal
b21df64534 SSM: Integrating the SSM driver code
This patch adds support for SSM driver which is
a framework to which a client can register itself specifying
different attributes and defining various permission levels associated
with different combination of attribute values and mode of the system.

CRs-Fixed: 970190
Change-Id: Ia030ebad56a22ba9103af17f6557c7906b762b76
Signed-off-by: Ashay Jaiswal <ashayj@codeaurora.org>
Signed-off-by: Manoj Prabhu B <bmanoj@codeaurora.org>
2016-03-23 21:19:45 -07:00
Mallikarjuna Reddy Amireddy
1506b57673 qseecom: Get appsbl qseecom load status from bootargs
App region notification has to be sent only once, if appsbl
has already sent then kernel should not send.

Change-Id: Ie1c7bb78be30c723fef6d9b89d488fdac36bc07f
Signed-off-by: Mallikarjuna Reddy Amireddy <mamire@codeaurora.org>
2016-03-23 21:19:03 -07:00
Ajay Singh Parmar
6158a25192 msm: hdcp: proper state sanitization for different versions
The hdcp 2.2 module may or may not be loaded based on source
and sink capabilities. Some of the common functionalities with
hdcp 1.4 may be accessed by different modules depending on which
hdcp version is being used. Check for validity of internal data
structures and variables to guard hdcp functionalities against
illicit calls.

Change-Id: I1383ae77f0b904589bcab571c902b5e3eeef6efa
Signed-off-by: Ajay Singh Parmar <aparmar@codeaurora.org>
2016-03-23 21:19:00 -07:00
Reut Zysman
f3a88b7433 qseecom: Fix MDTP cipher DIP
Enable CE clocks before calling SCM. This is required to
check if MDTP is activated during recovery and to update the DIP
as required in case it is.

Change-Id: I01907d7cebae007c7f6a33d4bf29b3e4fc6e493c
Signed-off-by: Reut Zysman <rzysman@codeaurora.org>
Signed-off-by: Amit Blay <ablay@codeaurora.org>
2016-03-23 21:17:29 -07:00
Zhen Kong
c3a112da96 qseecom: fix an error related to app name comparision
Make changes to use strcmp to compare app name, and
avoid the memcpy comparision error if the first
several chars of an app name is exactly equal to
another app name. Besides, on some targets, keymaster
app may be first loaded as "keymaste" by qseecomd,
and then used as "keymaster". To avoid checking app
name error, register "keymaster" into app_list and
thread private data.

Change-Id: I468b4e5cb1d5d77ac5d687d0bddc8614b972785f
Signed-off-by: Zhen Kong <zkong@codeaurora.org>
2016-03-23 21:17:04 -07:00
Phani Kumar Uppalapati
f6c9eb5139 msm: ultrasound: USF stays awake after each event
Give upper layers enough time to turn on screen before
falling back into SUSPEND.

Change-Id: I162f25dffdbbeb783d0bca673d6e6db8de412aac
Signed-off-by: Phani Kumar Uppalapati <phaniu@codeaurora.org>
2016-03-23 21:15:54 -07:00
Zhen Kong
80a9c6a26b 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>
2016-03-23 21:14:58 -07:00
Ajay Singh Parmar
5fbd0a8b8e 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>
2016-03-23 21:14:46 -07:00
Ajay Singh Parmar
b3e68382ff msm: mdss: hdmi: add dynamic encryption enable support
Implement qseecomm API to send command to TZ to enable/disable
encryption based on hdcp status. Enable encryption when hdcp
part 1 is successful and disable it when cable is disconnected
or authentication fails.

Change-Id: Ia5e1a5927dad36abc3093b16638879be823c84df
Signed-off-by: Ajay Singh Parmar <aparmar@codeaurora.org>
2016-03-23 21:14:11 -07:00
Ajay Singh Parmar
bd9d0784e8 msm: mdss: hdmi: hdcp2p2: add tethered support
Provide user an option to let the HDCP2.2 authentication
run on main thread. Avoid processing on module threads
thus avoiding any scheduling delays. The user may choose
to switch to this mode based on its requirements.

Change-Id: I76ec4a18f0fc52e99bbe76b6707511d3af6151f3
Signed-off-by: Ajay Singh Parmar <aparmar@codeaurora.org>
2016-03-23 21:14:09 -07:00
Zhen Kong
deb62ed21a qseecom: make change to support sg list entry number larger than 512
qseecom_send_modfd_cmd_64 converts non-contiguous ION memory fd to
scatter-gather physical address list, and supports up to 512 SG list
entries. Now, 512 is not enough if client wants to send large data
in a fragmented system. In this change, if SG list entry number is
larger than 512, we will allocate a new contiguous kernel buffer,
then save all SG entries into this new buffer.

Change-Id: Id90eefb98b63bf16db755dae8e1482e448090f47
Signed-off-by: Zhen Kong <zkong@codeaurora.org>
2016-03-23 21:13:51 -07:00
Laxminath Kasam
6d4b0deeb6 ASoC: audio: update API name for populate upper 32bits
In audio ion driver, append msm_audio_ to API
populate_upper_32bits to maintain consistency
across other API names in this driver.

Change-Id: I72aace56bf8e80c6dd83f768876253d2c7f334bb
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
2016-03-23 21:13:03 -07:00
Rohit Vaswani
91a1dd684f drivers: iommu, leds, input, clk, devfreq: fix warnings
Fix some variable initializations which would otherwise cause
forbidden warnings.

Signed-off-by: Rohit Vaswani <rvaswani@codeaurora.org>
Signed-off-by: David Keitel <dkeitel@codeaurora.org>
2016-03-23 20:57:40 -07:00
Ajay Singh Parmar
71a3bc7811 msm: hdcp: do not return error if work is already queued
Apart from authentications start, if any other work is already
queued, do not return any error in that case as the work is
going to run eventually. This doesn't apply for authentication
start as last session should have been closed before new one
is started.

Change-Id: If5f61f05758135d303974f8bd824ffcc9387259d
Signed-off-by: Ajay Singh Parmar <aparmar@codeaurora.org>
2016-03-23 20:47:49 -07:00
Ajay Singh Parmar
d4e9e455d6 msm: mdss: hdmi: hdcp2.2: use strict timeouts as per standard
Implement timers as per HDCP 2.2 standard for every message exchanged
with sink. The standard provides round trip timeout values for each
transaction. Use these timeout values and consider it as authentication
failure if timer expires.

Change-Id: I1fb647b70b8c3aafaeb6e91fd3f636d387247133
Signed-off-by: Ajay Singh Parmar <aparmar@codeaurora.org>
2016-03-23 20:47:36 -07:00
Ajay Singh Parmar
9fc3e2178c msm: mdss: hdmi: proper state validation and buffer handling
Validate current hdcp lib state before starting new hdcp session.
Double buffer the sink message and protect its access with mutex
to handle fast re-authentication requests.

Change-Id: I039b1a0c818a2e66eef583afb15420ce8587a75c
Signed-off-by: Ajay Singh Parmar <aparmar@codeaurora.org>
2016-03-23 20:47:24 -07:00
Ajay Singh Parmar
7f60965397 msm: mdss: hdmi: load hdcp1.x app only at bootup
Do not load hdcp1.x app at runtime and keep the app status for
future use. Whenever cable is connected and hdcp 1.x needs to
be started, just set keys using app. This avoids any possible
app load - unload issues in some corner cases.

Change-Id: Ic7f55ab74d6cb6b9ff654eb32c0bed8a44f70007
Signed-off-by: Ajay Singh Parmar <aparmar@codeaurora.org>
2016-03-23 20:46:30 -07:00
Ajay Singh Parmar
233a722f7f msm: mdss: hdmi: hdcp2p2: check for downstream topology change
Check if a new device is connected to the HDMI network. Repeater
provides new list of receiver IDs when any new device is connected.
Poll to check the same and update topology as per hdcp 2.2 standard.

Change-Id: Icb92dc95a84b0c33e67e7ecd5381a3f966b0f557
Signed-off-by: Ajay Singh Parmar <aparmar@codeaurora.org>
2016-03-23 20:46:29 -07:00
Ajay Singh Parmar
0057829118 msm: mdss: hdmi: propagation of content stream management info
Add support for propagating content stream related information downstream.
Send/receive repeater authentication stream manage/ready messages as per
hdcp2.2 standard.

Change-Id: I8d37f9f6d4cb131b29128222bb43c9c290c78437
Signed-off-by: Ajay Singh Parmar <aparmar@codeaurora.org>
2016-03-23 20:46:27 -07:00
Ajay Singh Parmar
bdb2680679 msm: mdss: hdmi: hdcp2p2: upstream propagation of topology info
Implement upstream topology information of connected repeater
devices to source device as per HDCP2.2 standard.

Change-Id: I375cc2624d5221972a6e4ece2f13dd05e83f7573
Signed-off-by: Ajay Singh Parmar <aparmar@codeaurora.org>
2016-03-23 20:46:27 -07:00
Ajay Singh Parmar
a715804225 msm: mdss: hdmi: cleanup ddc usage
Check for all possible DDC errors and clear the corresponding
acknowledge bit. Properly enable or disable the DDC interrupts
based on the requirements. Optimize DDC data structure by
removing unnecessary variables and keeping different DDC related
data under common structure. Move all DDC implementations to one
place.

Change-Id: If63479d5bc263db63e62d1846ab13a2659a83a68
Signed-off-by: Ajay Singh Parmar <aparmar@codeaurora.org>
2016-03-23 20:46:26 -07:00
Ajay Singh Parmar
38fdd3f630 msm: mdss: hdmi: cleanup wakeup calls
Do not lock in wakeup functions as it may block current thread.
Wakeup can trigger a callback looking to acquire same lock.
Also rename the wakeup command names to properly identify client
and lib commands.

Change-Id: I28411714d2d7f0104364726fc5ce0593e5ccff91
Signed-off-by: Ajay Singh Parmar <aparmar@codeaurora.org>
2016-03-23 20:46:20 -07:00
Ajay Singh Parmar
e8591b7730 msm: mdss: hdmi: create separate environments for hdcp lib and hdmi
Isolate the execution environments for HDMI HDCP2.2 driver and HDCP
library by creating separate threads and executing each work on
dedicated kworker. Do not call each other's functions directly.
Wakeup the other thread when needed and let the independent module
execute their corresponding work and acknowledge by waking up other
thread back.

Change-Id: I67bca61b92c831451ce3482a759a214b1e5d6578
Signed-off-by: Ajay Singh Parmar <aparmar@codeaurora.org>
2016-03-23 20:46:20 -07:00
Tatenda Chipeperekwa
c76b5e3acf msm: mdss: hdmi: check if hdcp2p2 app is present during hpd
Check if the hdcp2p2 app is present every time the hdmi cable
is connected. If the app is not present, then we consider
hdcp-2.2 as not supported on the target. This scenario occurs
on devices that are not hdcp-2.2 provisioned, and with this
change hdmi core continues in non-encrypted mode.

Change-Id: I72ebcc1e6844f46dbbc974efb6ba926948e1bbde
Signed-off-by: Tatenda Chipeperekwa <tatendac@codeaurora.org>
2016-03-23 20:46:07 -07:00
Ajay Singh Parmar
0a6a08aeac msm: mdss: hdmi: separate out hdcp library from hdmi
Define APIs to start or stop authentication from client.
Handle internal states within HDCP library and do not
call HDCP library internal functions directly from client.
Remove unnecessary threads and locks and execute on same
thread as standard requires this to be processed sequentially.

Change-Id: I4cd924fb836e0e01ff1d6eba58d817fe0ca383e1
Signed-off-by: Ajay Singh Parmar <aparmar@codeaurora.org>
[cip@codeaurora.org: Snapshot hdcp.c/hdcp_qseecom.h,
add hdcp Kconfig/Makefile changes]
Signed-off-by: Clarence Ip <cip@codeaurora.org>
2016-03-23 20:46:05 -07:00
Sudheer Papothi
be1a516dcb ASoC: msm: Add Audio drivers for MSM targets
Add snapshot for audio drivers for MSM targets. The code is
migrated from msm-3.18 kernel at the below commit/AU level -

AU_LINUX_ANDROID_LA.HB.1.3.1.06.00.00.187.056
(e70ad0cd5efdd9dc91a77dcdac31d6132e1315c1)
(Promotion of kernel.lnx.3.18-151201.)

Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
2016-03-23 20:11:25 -07:00
Zhen Kong
848e0a86b6 qseecom: add snapshot of qseecom driver
This snapshot is taken as of msm-3.18 commit e70ad0cd
(Promotion of kernel.lnx.3.18-151201.)

Signed-off-by: Zhen Kong <zkong@codeaurora.org>
2016-03-22 11:10:18 -07:00
Amit Pundir
31a3049fb6 android: skip building drivers as modules
Few Android drivers e.g. uid_cputime and PPPoLAC/oPNS,
keyreset/combo, cpufreq_interactive etc.. fail to build
as kernel modules. Instead of fixing the build lets
make these drivers non-modular (switch config to "bool"
from "tristate" in Kconfig) since Android doesn't
support building kernel modules anyway.

Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
2016-02-16 13:54:25 -08:00
Amit Pundir
21b0489251 uid_cputime: skip power reporting per uid for now
AOSP's cpufreq_stats patch to report power/current
per cpufreq is broken at the moment so skip power
reporting for now.

Change-Id: I07779511f51ff3a9303dc98a3b71ac0a5882a4e9
Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
2016-02-16 13:53:55 -08:00
Ruchi Kandoi
d19dc26df6 uid_cputime: Check for the range while removing range of UIDs.
Checking if the uid_entry->uid matches the uid intended to be removed will
prevent deleting unwanted uid_entry.
Type cast the key for the hashtable to the same size, as when they were
inserted. This will make sure that we can find the uid_entry we want.

Bug: 25195548
Change-Id: I567942123cfb20e4b61ad624da19ec4cc84642c1
Signed-off: Ruchi kandoi <kandoiruchi@google.com>
2016-02-16 13:53:54 -08:00
Ruchi Kandoi
75d2d020f7 uid_cputime: Iterates over all the threads instead of processes.
Bug: 22833116
Change-Id: I775a18f61bd2f4df2bec23d01bd49421d0969f87
Signed-off-by: Ruchi Kandoi <kandoiruchi@google.com>
2016-02-16 13:53:54 -08:00
Jin Qian
dbd9fc75c4 uid_cputime: fix cputime overflow
Converting cputime_t to usec caused overflow when the value is greater
than 1 hour. Use msec and convert to unsigned long long to support bigger
range.

Bug: 22461683

Change-Id: I853fe3e8e7dbf0d3e2cc5c6f9688a5a6e1f1fb3e
Signed-off-by: Jin Qian <jinqian@google.com>
2016-02-16 13:53:53 -08:00
Ruchi Kandoi
2244d3438e uid_cputime: Avoids double accounting of process stime, utime and cpu_power in task exit.
This avoids the race where a particular process is terminating and we
read the show_uid_stats. At this time since the task_struct still exists
and we will account for the terminating process as one of the active
task, where as the stats would have been added in the task exit
callback.

Bug: 22064385
Change-Id: Id2ae04b33fcd230eda9683a41b6019d4dd8f5d85
Signed-off-by: Jin Qian <jinqian@google.com>
Signed-off-by: Ruchi Kandoi <kandoiruchi@google.com>
2016-02-16 13:53:53 -08:00
Ruchi Kandoi
82df5f280c uid_cputime: Extends the cputime functionality to report power per uid
/proc/uid_cputime/show_uid_stats shows a third field power for each of
the uids. It represents the power in the units (uAusec)

Change-Id: I52fdc5e59647e9dc97561a26d56f462a2689ba9c
Signed-off-by: Ruchi Kandoi <kandoiruchi@google.com>
2016-02-16 13:53:52 -08:00