msm: kgsl: Do not return invalid power stats when the device is off

adreno_power_stats() was returning unitialized data when the device
state was not active. Leave early from the function if the device
is not active and return 0s instead.

Change-Id: Ic0dedbadf6201cadb4472327c4ce7f9d9d32b82d
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
Signed-off-by: Prabhat Awasthi <pawasthi@codeaurora.org>
qseecom: Add support to handle multiple app load & unload

Media server is associated with multiple apps on TZ-side.
Unloading a single app for clean up is not enought. QSEECOM
needs to handle the app load & unload of multiple apps
associated with the client. During app_load & app_unload
along with app_id, app_name should also be checked. Besides,
keymaster will not be unloaded and app search execution
during app unload is optimized.

Change-Id: Ie92e97b9154851b713a8c3394b8ed10fdbdebd2f
Signed-off-by: Zhen Kong <zkong@codeaurora.org>
Signed-off-by: William Clark <wclark@codeaurora.org>
qseecom: change the number of bytes to compare app names

keymaster app has two names with different length: "keymaster" and
"keymaste". To compare the app names correctly, the shorter name
length is choosen for memcmp in __qseecom_send_cmd.

Change-Id: I5f0dff7f9756362be40cc64985b65bc2268d734f
Signed-off-by: Zhen Kong <zkong@codeaurora.org>
Signed-off-by: William Clark <wclark@codeaurora.org>
msm: mdss: synchronize recovery handler access

The recovery handler is used in the dsi event thread, and
the recovery handler variable was configured from a different
thread.  Earlier, there is no synchronization between the two
threads accessing the recovery handler, causing kernel panics.

Change-Id: Iee990276fdabd65e2e1f2e3c21ad574fc0d8a7bc
Signed-off-by: Xiaoming Zhou <zhoux@codeaurora.org>
Signed-off-by: Shivaraj Shetty <shivaraj@codeaurora.org>
msm: mdss: apply BW fudge factor to all controllers when video mode present

If there is a video mode controller enabled and other
controllers non-video mode, current display driver apply
the bw fudge factor only to the controller that it is
video mode.
This change will apply the fudge factor to all the
controllers enabled if any of those it is video mode to
fix some of the underruns observed in the video interfaces.

Change-Id: I0d01477dc45edbef2a25ccd540aa06b3c43073a4
Signed-off-by: Ingrid Gallardo <ingridg@codeaurora.org>
Signed-off-by: Siddhartha Agrawal <agrawals@codeaurora.org>
msm: mdss: ensure retire fences are signaled during panel off

When turning off command mode panel, if retire fences are still active
and suspend sequence goes through some fences may remain active.
If fences remain active command panel off sequence would stop signaling
vsyncs and would throw off the timeline. To fix this clear the retire
timeline when turning panel off.

Change-Id: I32a5fe0f81b16fa2ef959c7f05e484fb9f9f8598
Signed-off-by: Adrian Salido-Moreno <adrianm@codeaurora.org>
ARM: dts: msm: Add flash_wa regulator support for msm8226 flash

Add the DT property flash-wa-supply to flash device node and assign
pm8226_chg_chgr regulator to it. This enables the flash_wa regulator
support for the flash driver.

CRs-Fixed: 697457
Signed-off-by: Chunmei Cai <ccai@codeaurora.org>
Change-Id: Icdf489f41898dc759c397625514f41188c612d6c
leds: leds-qpnp: Add flash_wa regulator support in flash led driver

Add flash_wa regulator support in flash led driver. The regulator raise
the SMBB over temperature threshold before flash enabled, and restore to
default setting after flash disable.

CRs-Fixed: 697457
Change-Id: I66f8189f62a875dd549377b552bf4a8f40798f31
Signed-off-by: Chunmei Cai <ccai@codeaurora.org>
power: qpnp-charger: Add a regulator device to control flash led WAs

Flash led relies on SMBB to supply the 5V drive voltage. Add a regulator
device in qpnp-charger driver to support flash related workarounds in
SMBB.

While at it, add a SMBB temperature threshold workaround in the
regulator device. On certain devices SMBB/SMBBP over temperature
happened at default settings before flash module start thermal derating.
Raise the SMBB over temperature threshold when regulator enabled, and
restore to default setting when regulator disabled.

CRs-Fixed: 697457
Change-Id: I7b6003caebf23ea8662a21bb16f9095d1db0e7bb
Signed-off-by: Chunmei Cai <ccai@codeaurora.org>
msm: mdss: Prevent modification to image roi when scaling

If pixel extension is enabled by scaler, and layer content is
deinterlaced, the modifications to the layers region of interest
to be used by mdp hw has already been modified. We should not
further changing these values.

Change-Id: I2c528b54ce07e90b66b56ef008b73b78e4227c9d
Signed-off-by: Terence Hampson <thampson@codeaurora.org>
Merge "ARM: dts: msm: Add flash_wa regulator support for msm8226 flash"
Merge "power: qpnp-charger: Add a regulator device to control flash led WAs"
Merge "leds: leds-qpnp: Add flash_wa regulator support in flash led driver"
Merge "msm: mdss: synchronize recovery handler access"
Merge "msm: mdss: ensure retire fences are signaled during panel off"
Merge "qseecom: Add support to handle multiple app load & unload"
leds: leds-qpnp: provide pwm period when leds are set to LPG mode in DT

In the current design, if MPP-controlled leds or RGB leds are configured
to LPG mode in the device tree, the PWM period value is not provided.
This will result in "pwm_cfg->pwm_period_us" being assigned to zero
since no PWM period value will be read from device tree. As a result,
qpnp_pwm_init() returns error, which in turn results in failure of
qpnp_mpp_init() or qpnp_rgb_init() and finally resulting in failure of
qpnp_leds_probe().

So "qcom,pwm-us" property should be provided in DT for the above case and
the property parsing needs to be implemented in the leds-qpnp driver.

Change-Id: Ic32833ea4e685939148e38cdba078391936f8efb
CRs-Fixed: 667825
Signed-off-by: Abinaya P <abinayap@codeaurora.org>
Merge "leds: leds-qpnp: provide pwm period when leds are set to LPG mode in DT"
Merge "msm: mdss: Prevent modification to image roi when scaling"
v4l2: vb2: replace VIDEO_MAX_FRAME with VB2_MAX_FRAME

- vb2 drivers to rely on VB2_MAX_FRAME.

- VB2_MAX_FRAME bumps the value to 64 from current 32

Change-Id: I3d7998898df43553486166c44b54524aac449deb
Signed-off-by: Balamurugan Alagarsamy <balaga@codeaurora.org>