msm_fb:hdmi:Video playback failure issue

OEM reported Video playback failure
(before Video, Audio fails actually) issue,
because hdmi_msm_power_off() skips
SWITCH_SET_HDMI_AUDIO, hdmi_msm_audio_off()

Change-Id: I4db61a62217bc49741571f23703361d273648fee
Signed-off-by: Nirmal Abraham <nabrah@codeaurora.org>
msm: hdmi: NUL-terminate spd data

NUL-terminate SPD Vendor name and SPD
Product description data stored in the
control structure of hdmi driver. This
avoids overflows in print messages and info
frames.

Change-Id: Ib3fcf35c6e82af18089ebea213e20b0bc0182661
CRs-Fixed: 520148
Signed-off-by: Manoj Rao <manojraj@codeaurora.org>
msm: hdmi-cec: bounds check cec frame size

Ensure that the frame size for the HDMI-CEC message
frame size doesn't exceed the maximum size when
reading message from userspace through sysfs interface.
This avoids potential overflow in cec send msg routine.

Change-Id: I09eb8f7a6dee64be2b504c6448b49e1da902aa47
CRs-Fixed: 520140
Signed-off-by: Manoj Rao <manojraj@codeaurora.org>
mm: Update is_vmalloc_addr to account for vmalloc savings

is_vmalloc_addr current assumes that all vmalloc addresses
exist between VMALLOC_START and VMALLOC_END. This may not be
the case when interleaving vmalloc and lowmem. Update the
is_vmalloc_addr to properly check for this.

Change-Id: I5def3d6ae1a4de59ea36f095b8c73649a37b1f36
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
msm_fb: hdmi: proper vic for 576p

Corrected the AVI info data with right VIC for 576p@50 16:9

CRs-Fixed: 457252
Change-Id: I8536c141823e9d8436bdd8df0038d3e203ec0c4b
Signed-off-by: Ajay Singh Parmar <aparmar@codeaurora.org>
msm_fb: hdmi: Proper HPD state update

On switching off the HPD, we need to update the HPD state
after the polarity has been done to set the HPD state in
hardware properly.

CRs-Fixed: 465476
Change-Id: Ic0ba7fac72b8188c86a034ba9a45107689809028
Signed-off-by: Ajay Singh Parmar <aparmar@codeaurora.org>
msm_fb: hdmi: Return proper clock get error code

This change returns the proper error code while in probe and trying
to get the required clock and fails. This is required for probe deferral
support.

Change-Id: Ief91b1f634c06d3679157313506b56e5948aa79c
Signed-off-by: Ajay Singh Parmar <aparmar@codeaurora.org>
Signed-off-by: Padmanabhan Komanduru <pkomandu@codeaurora.org>
msm_fb: hdmi: Check for stale HDCP variables

Check for stale HDCP variables like An from previous authentication
failure. In case of stale data, wait for some time to make sure HDCP
has has fresh data.

Change-Id: I37685a0246f3b60c383e3bf8d024c2b13fb3e5f6
Signed-off-by: Ajay Singh Parmar <aparmar@codeaurora.org>
Signed-off-by: Sridhar Gujje <sgujje@codeaurora.org>
msm_fb: hdmi: Update frame rate on resolution change

On resolution change, we need to update the frame rate as well.
Video mode programming in HDMI can also be based on frame rate.

CRs-Fixed: 461486
Change-Id: I4cf1192796482ec0aa7aa130297f740c96115e08
Signed-off-by: Ajay Singh Parmar <aparmar@codeaurora.org>
msm_fb: hdmi: change sysfs node permissions

Change the write permissions of sysfs nodes from UGO to USR + GRP

Change-Id: Ided5351669eb0f3cdf9ae1a0c1607ef6e76f6852
Signed-off-by: Ajay Singh Parmar <aparmar@codeaurora.org>
msm_fb: hdmi: Proper intialization of mhl resolutions

This change adds missing video format intialization

CRs-Fixed: 481049
Change-Id: Ic14eaba7fefcb8b7f9240cae8c179e3dbeef72a5
Signed-off-by: Ajay Singh Parmar <aparmar@codeaurora.org>
Signed-off-by: Padmanabhan Komanduru <pkomandu@codeaurora.org>
msm: Update the kernel log messages

After reclaiming vmalloc and adjusting lowmem, the two regions
are no longer contiguous. Update the messages printed during
bootup to list all regions corresponding to low memory and vmalloc
respectively.

Change-Id: Ib3e25b530b3dfbd1f9796cdc580fb79da484e850
Signed-off-by: Neeti Desai <neetid@codeaurora.org>
msm: Make CONFIG_STRICT_MEMORY_RWX even stricter

If CONFIG_STRICT_MEMORY_RWX was set, the first section (containing
the kernel page table and the initial code) and the section
containing the init code were both given RWX permission, which is
a potential security hole.

Pad the first section after the initial code (which will never
be executed when the MMU is on) to make the rest of the kernel
text start in the second section and make the first section RW.

Move some data which had ended up in the "init text"
section into the "init data" one, as this is RW, not RX.
Make the "init text" RX.

We will not free the section containing the "init text",
because if we do, the kernel will allocate memory for RW data there.

Change-Id: I6ca5f4e07342c374246f04a3fee18042fd47c33b
CRs-fixed: 513919
Signed-off-by: Larry Bassel <lbassel@codeaurora.org>
msm_fb: display: add mdp master port1 bandwidth request

mdp bus traffic go through both mdp port0 and port1, but now mdp
bandwidth request is only for port0.

Change-Id: Ie902de6362cd9225abf6e9c42f260b5af7c3c6f8
Signed-off-by: Huaibin Yang <huaibiny@codeaurora.org>
msm_fb: display: balance bus bandwidth on mdp axi port0 and port1

mdp read and write clients are connected on both mdp port0 and port1,
however, the bus bandwidth request is made on only port0. This change
divides mdp bw requests to port0 and port1 based on pipe connections
to mdp ports.
ab - no scaling factor - port0 and port1 split
ib - scaling factor - port 0 and port1 split

Change-Id: I9050d1178f634ca908675fa826d08bee09e2a2f3
Signed-off-by: Huaibin Yang <huaibiny@codeaurora.org>
msm_fb: display: add scaling factor for mdp ab

system profiling found that mdp downscaling needs larger bandwidth
that is related to mdp ab request, so adding scaling factor to mdp ab
calculation reduces the chance of underruns.

ab - scaling factors - port0 and port1 split
ib - 1.5 x ab - no split and same on both ports

Change-Id: I4fde87fce1cd292e317a8261e4700cf98662d09d
Signed-off-by: Huaibin Yang <huaibiny@codeaurora.org>
msm: display: change mdp default ib_factor to 150

system profiling found that mdp downscaling needs larger bandwidth
that is related to mdp ab request, so adding scaling factor to mdp ab
calculation reduces the chance of underruns.

ab - scaling factors - port0 and port1 split
ib - 1.5 x ab - no split and same on both ports

This is board file change for ib = 1.5 x ab

Change-Id: Ic267c6eb1a92e974e5f94f1a72b95433c73b11ae
Signed-off-by: Huaibin Yang <huaibiny@codeaurora.org>
msm_fb: display: keep a minimum mdp ib bandwidth request

The calculated ab and ib bandwidth requests are very small which cause
underruns if mdp composites only very small layers. For these use
cases keeping a minimum ib request based on the baselayer size can
prevent underruns and no power impact is observed.

CRs-fixed: 472444
Change-Id: I08e77610aafdfa84c5c2a882a0c95a51950aa069
Signed-off-by: Huaibin Yang <huaibiny@codeaurora.org>
msm_fb: Make sure MDP clock is ON during register access

Change to make sure that MDP clock is ON while accessing
MDP fixed arbitration read and write selection
registers. This avoids target freeze due to unclocked
register access.

CRs-fixed: 505154
Change-Id: I1d2e654c7b97ca51e42611a5bd3aefd65421bcf4
Signed-off-by: Padmanabhan Komanduru <pkomandu@codeaurora.org>
msm: display: Handle mixer stage commit for wfd correctly

If no dequeue buffer is present, do not return early as commit
call still needs to take care of  mixer staging and stage commit.
Early return of commit, results in pipe still staged errors since,
mixer stage and commit gets bypass.

Change-Id: I1aa7dc9e95d183b22739daae123cf7818afbeadd
CRs-Fixed:523959
Signed-off-by: Mayank Chopra <makchopra@codeaurora.org>