video: msm: Maintain histogram LUT state through suspend resume

Make sure LUT state is maintained after suspend resume. Required to ensure
HistLUT and backlight scale are in sync.

CRs-Fixed: 476491
Change-Id: Icc999aa0b04cad93ceed334426f61b71cbdd0a13
Signed-off-by: Carl Vanderlip <carlv@codeaurora.org>
video: msm: Initialize HistLUT with last saved LUT

Set HistLUT to last value written to LUT when MDP is turned on. Assumes
that last LUT corresponds to last BL scale value sent.

CRs-Fixed: 475149
Change-Id: I7383666c2d1f3d8800c5f25e2ef648568eb33a74
Signed-off-by: Carl Vanderlip <carlv@codeaurora.org>
msm_fb: HDMI: Reset HDCP reauth flag when powering off

The software flag used for storing the HDCP reauthentication state
needs to be reset whenever the HDMI device is powered off. This is
needed to avoid a potential reauthentication attempt upon a
subsequent connection which could lead to device hang as a result
of incorrect sequence of register accesses.

CRs-Fixed: 444312
Change-Id: I6b5b08394dd96ccbc08c4ca72b6dc4b2c4dbf6be
Signed-off-by: Aravind Venkateswaran <aravindh@codeaurora.org>
msm_fb: display: adjust refx100 parameter to avoid tearing

refx100 is used to calculate how many mdp_vsync clocks to complete one
line in the panel. This info is used by mdp h/w to sync data transfer
between mdp h/w and command mode panel to avoid tearing.

CRs-fixed: 379223
Change-Id: I3880a350b77cb8165745ea343b1525e84100a62d
Signed-off-by: Huaibin Yang <huaibiny@codeaurora.org>
Signed-off-by: lakshmi narayana p <lpatib@codeaurora.org>
msm: mdp: Move wfd state signalling into mdp driver

Previously the WFD driver was reponsible for signalling the
online/offline events to userspace listeners.  This led to redundant
notifications due to the manner in which the WFD driver is used. The
signalling is better purposed when done from MDP driver.

Change-Id: I2248de84d57504c2fa9f26e1bfdf0e0d4a02257a
Signed-off-by: Deva Ramasubramanian <dramasub@codeaurora.org>
Signed-off-by: lakshmi narayana p <lpatib@codeaurora.org>
msm_fb: hdmi: update data on resolution change

On changing resolution, all information related to display
needs to be updated which helps in calculating the right mdp
clock for each resolution.

CRs-Fixed: 436151
Change-Id: I1ab6e5859491936a7fa8c62247da9ef5a0ff45ef
Signed-off-by: Ajay Singh Parmar <aparmar@codeaurora.org>
Signed-off-by: lakshmi narayana p <lpatib@codeaurora.org>
msm_fb: hdmi: Do not turn on HDMI if not ready

At bootup, if HPD is not configured, HDMI is not in
the state of getting turned on. This change makes sure
HDMI is not turned on/off unnecessarily which turns on
clocks as well.

CRs-Fixed: 447511
Change-Id: I074d9c463943770775b060c4a93b9120dfe9bcf0
Signed-off-by: Ajay Singh Parmar <aparmar@codeaurora.org>
msm_fb: hdmi: hdmi 3d length check

This change fixes a case where the length of 3d data is not
properly used which could have resulted in wrong 3d data parsing.

CRs-Fixed: 445505
Change-Id: Id285204bdb8c2d881becaa5b07b973eba4240d93
Signed-off-by: Ajay Singh Parmar <aparmar@codeaurora.org>
Merge "msm_fb: HDMI: Reset HDCP reauth flag when powering off"
Merge "msm_fb: display: adjust refx100 parameter to avoid tearing"
Merge "msm: mdp: Move wfd state signalling into mdp driver"
Merge "msm_fb: hdmi: update data on resolution change"
Merge "msm_fb: hdmi: Do not turn on HDMI if not ready"
Merge "msm_fb: hdmi: hdmi 3d length check"
msm : camera : Adding a check in msm_open_config to check if camera is active

This check will ensure that if camera is not active, we will not
proceed further into the steps for which mctl needs to be active.

Change-Id: If255c39b2ec17a7eeccd0739be5007db753c3ccb
Signed-off-by: Aditya Jonnalagadda <ajonnala@codeaurora.org>
msm: camera: Handle improper parameter properly

when length above permissible value is passed through
ioctl, it gets wrapped to a small value.
Then we use this small value for memory allocation and
the actual received value for count.
so, handling this properly in order to avoid a panic.

Change-Id: I6e5713b8a6f7d98b3bf8b96498ea574934507581
Signed-off-by: Aditya Jonnalagadda <ajonnala@codeaurora.org>
Merge "video: msm: Maintain histogram LUT state through suspend resume"
Merge "video: msm: Initialize HistLUT with last saved LUT"
msm: camera: Fix for camera crash

Trying to access certain variables when camera
is not active will cause NULL pointer dereference.
Added some null checks in order to avoid that.

Change-Id: I926d1a64538a06db1ee6a1a592e4e83f14ee295f
Signed-off-by: Aditya Jonnalagadda <ajonnala@codeaurora.org>
Merge "msm: camera: Handle improper parameter properly"