msm: mdm2: Add delay between subsequent PS_HOLD for 8064 fusion3

This feature was previously added for the 8960 sglte target,
in commit 21274cf2219899ef9b46cf8b9fd8bf4ce52d057b, but it also
applies to the 8064 sglte2 target. The original commit message
follows.

During SSR first a reset of external modem is issued
and mdm_do_soft_power_on() toggles ap2mdm_soft_reset which
in turn toogles the PS_HOLD. Then a part of SSR external
modem is powered up and mdm_do_soft_power_on() again toggles
the gpio. For PMIC register stabilization we need a 1sec delay
between subsequent mdm_do_soft_power_on().
By default the delay is 500msec, so adding another 500msec for
stablization.

Signed-off-by: Joel King <joelking@codeaurora.org>

Conflicts:
	arch/arm/mach-msm/board-8064.c

Change-Id: I8ac22d94205cb309dd5ba4b1f3a20933632298db
msm: msm_fb: Map RGB layers to the max possible size.

IOMMU Page Faults are observed on RGB layers during stability
because MDP is trying to fetch out of mapped area of the buffer.
This patch avoids the issue by overmapping the RGB layers to the
max possible RGB buffer size.

Change-Id: Idc7ac9acad70e351acac5dba2ae43b8731e84d35
Signed-off-by: Vishnuvardhan Prodduturi <vproddut@codeaurora.org>
msm: vidc: estimate min_dpb for smooth streaming mode

In case of smoothstreaming:
[1] get dpb requirement for the firmware
[2] get count in resource resource tracker
Use higher of the above

b/10192531

Change-Id: I9282d0aa5bc60b51599ae3d1920c76df9957c929
Signed-off-by: Deepak Verma <dverma@codeaurora.org>
Signed-off-by: Praveen Chavan <pchavan@codeaurora.org>
msm_fb: display: Program TILE video frame size in dma ISR

Since, video tile frame size register is single buffered, its
value takes effect as soon as it is programmed. Single buffered
registers like this should be configured very close to the vsync
to prevent issues like flicker or artifacts.
Program this register in dma ISR to prevent flickers and IOMMU
page faults.

Change-Id: Ifa770e4b4f29d6e4070e51388043422cc60e5872
Signed-off-by: Mayank Chopra <makchopra@codeaurora.org>
msm_fb: display: update video tile framesize register

The register should not be delayed in the case of
Witeback and command mode pannel

Change-Id: Ia90ccc1bb376ed829bedee131ba600194d471521
Signed-off-by: Justin Philip <jphili@codeaurora.org>
msm: msm_fb: Fix Regressions because of overmap changes.

Previous MDP overmap change is causing issues with HDMI because of
assumptions about overmap. This patch fixes all such issues.

Change-Id: Ifd2f8a0596d9df08538464bdcdd5946cf84db4d9
Signed-off-by: Vishnuvardhan Prodduturi <vproddut@codeaurora.org>
Revert "[ARM] msm: iommu_domains: replace vmalloc with kmalloc"

When overmapping is used, system can request higher order page allocaitons.
this can lead to page allocation failure if kmalloc is used

CRs-Fixed: 571753

This reverts commit 191a48ee7bda08bf88a61b48fd0433627c5918dc.

Change-Id: I4d44bf88d84d96d315f89a1304a2d25b75be79d8
Signed-off-by: Srinivasarao P <spathi@codeaurora.org>
msm: camera: Send VFE_REG_UPDATE_CMD while enabling liveshot.

Sometimes, especially with YUV sensors, snapshot frame is
not received in time when liveshot is triggered.

CRs-Fixed: 501466
Change-Id: Ib92929ebe82eadb92492d899b2077832fab02842
Signed-off-by: Sai Kumar Sanagavarapu <ssanagav@codeaurora.org>
Signed-off-by: Sridhar Gujje <sgujje@codeaurora.org>
msm: camera: Handle locks properly

Update camera drivers to unlock mutex while returning
the function in caseof errors.

Change-Id: Iaac7ae3a0337445ee072c10c69080c24ed6e512c
Signed-off-by: satyavaraprasad yerramsetti <satyav@codeaurora.org>
msm: camera: fix the out of order of frames issue

observed that if the frame processing in the userspace
is delayed, the incoming frames from the hardware are being sent
to user before the diverted frame returns.so dropping the
the delayed postprocessing frame to prevent out of order

Change-Id: I43b0f9ea7a7683a419ce142b7d4fdf9e13d11d95
Signed-off-by: Lakshmi Narayana Kalavala <lkalaval@codeaurora.org>
msm: camera: Enable use of AVTimer, Rotation and Crop for VT

The changes expose parameters for the application to set
the use of AVTimer for TimeStamp information and rotation
angle for video stream along with crop for VT use case.

CRs-fixed: 498762
Change-Id: Icf883f53513ab084f0970e84bbccd8bb9ec64737
Signed-off-by: Alok Kediya <kediya@codeaurora.org>
msm: camera: Recovery through camif stop and overall reset.

Add recovery mechanism in case of bus overflow. As part of the
recovery, stop the CAMIF, reset the VFE and reload the AXI
write masters and then restore the IRQ settings to VFE.

Change-Id: Iba6576777f05135cc13c1ee0c9db764d35c7282a
Signed-off-by: Kevin Chan <ktchan@codeaurora.org>
Signed-off-by: Praveen Ac <praveenac@codeaurora.org>
Signed-off-by: Kiran Kumar H N <hurlisal@codeaurora.org>
msm: camera: Add recovery routine for live snapshot.

During live snapshot, if bus overflow happen, recovery routine will
kick in and reset the hardware. At this point, the live snapshot
might not be completed and application will continue to wait for
the snapshot to complete. This change adds the logic to restart
the snapshot process after recovery is completed.

Change-Id: I9ba0a27ce53eb008a4af8d65a3f37a7cded03559
Signed-off-by: Kevin Chan <ktchan@codeaurora.org>
Signed-off-by: Praveen Ac <praveenac@codeaurora.org>
Signed-off-by: Kiran Kumar H N <hurlisal@codeaurora.org>
msm: camera: Move halt logic in case of overflow to ISR.

Move the halt logic which includes AXI HALT and CAMIF Disable
to ISR to start the recovery mechanism sooner.
Add some protection in case of liveshot.

Change-Id: I28ec462474524c0064cd7ecd4f77801cd494e514
Signed-off-by: Kevin Chan <ktchan@codeaurora.org>
Signed-off-by: Praveen Ac <praveenac@codeaurora.org>
Signed-off-by: Kiran Kumar H N <hurlisal@codeaurora.org>
msm: camera: Add mechanism to stop overflow recovery and handle IOMMU pagefault

CRs-Fixed: 491200

Change-Id: I1e498d87853c4dee8b1821595aad1958cb5341d3
Signed-off-by: Roja Rani Yarubandi <rojay@codeaurora.org>
Signed-off-by: Sridhar Gujje <sgujje@codeaurora.org>
msm: camera: Handle ioctls issued on vfe subdevice properly

In case vfebase is not set by the time ioctl is issued on the
vfe subdevice, it might lead to kernel panic if the arguments
of the ioctl are not set properly. Now handling these ioctls
before checking for vfebase will remove the possibility of a
kernel panic.

CRs-Fixed: 502383
Change-Id: Ib36db26c58acbaef14f1052aed71b7c3701e93a3
Signed-off-by: Aditya Jonnalagadda <ajonnala@codeaurora.org>
msm: camera: Null check added at iommu_attach_device

In case domain has not been initialized before, added a null
check for it inorder to avoid a potential kernel panic.

CRs-Fixed: 502383
Change-Id: I43a173e96415bdaea0968ce6ca37e6c1ee75d666
Signed-off-by: Aditya Jonnalagadda <ajonnala@codeaurora.org>
msm: camera: Enable frame based AXI WM for RDI0

Frame based AXI WM configuration for RDI0 path
Also populate sensor type in the device info structure.

Change-Id: Ib6d65cd8cb1e4655c4f67903a8f329962512115e
Signed-off-by: Sai Kumar Sanagavarapu <ssanagav@codeaurora.org>
msm: camera: Enable CAMIF SOF in case of non dual camera usecase.

When Dual camera usecase is enabled, the ISPIF PIX SOF is enabled
by default to synchronize with the RDI interfaces.
But in non dual camera usecases, use CAMIF SOF IRQ to increment
the frame IDs being embedded inside the output frames.
Sometimes the SOF IRQs of frame 'n' is clubbed along with the
Output IRQs of the frame 'n-1'. Thus although the output IRQs
are supposed for frame 'n-1' it results in a frame ID of 'n' which
will cause incorrect behaviour downstream. Correct this behaviour
by checking the SOF and Output status bits in the IRQ Mask and
adjust the frame ID accordingly.

CRs-Fixed: 481721
Change-Id: If7a9db2337febf10e89d44c58b9d980d874c69b6
Signed-off-by: Sai Kumar Sanagavarapu <ssanagav@codeaurora.org>
Signed-off-by: Kiran Kumar H N <hurlisal@codeaurora.org>
msm: camera: ABCC feature porting in kernel space

Reference - https://review-android.quicinc.com/#/c/141518/
CRs-fixed: 502029

Change-Id: I40ee7349f26cc9d040a9b36cf8cf30020991c381
Signed-off-by: Alok Kediya <kediya@codeaurora.org>