msm: mdss: Make mdp sync point generic to use

Currently mdp sync point supports buf sync ioctl for
normal mdp overlay operation. So making it more generic
such that it can be used for rotator also.

Change-Id: I04c5f29a5259238ef1de26f6e801269b89cf5fed
Signed-off-by: Jayant Shekhar <jshekhar@codeaurora.org>

Conflicts:
	drivers/video/msm/mdss/mdss_fb.c
Revert "msm: mdss: delay freeing buffers for additional vsync"

This reverts commit 2fd63a0dc5a5674a2ee87b9fd40a09837b0c9376.
video: msm: mdss: insert panel parameters for width and height

for calculating dpi on HAL,FB should check panel physical size.
so, this patch make panel driver parse dt and fill panel's width
and height. and provide the information to FB.

Change-Id: I0fbe12470c903e90c50e06ae2fbbe786187cc133
Signed-off-by: darren.kang <darren.kang@lge.com>
Signed-off-by: Devin Kim <dojip.kim@lge.com>
msm: mdss: Prevent non-zero backlight following display blank

Force the backlight to zero before entering powerdown state to prevent
backlight from staying on during blank/suspend.

Change-Id: I2a078833c414d6b51d4e6eb64fd37b616164948a
Signed-off-by: Carl Vanderlip <carlv@codeaurora.org>

Conflicts:
	drivers/video/msm/mdss/mdss_fb.c
msm_fb: mdss: register mdss devices for system shutdown

When device is restarted it is necessary to power down display panel
in order to avoid any residue gliches for the next session. And in order
to power down display devices, respective drivers need to support
shutdown sequence. Implement driver shutdown for fb and mdp devices.

CRs-Fixed: 504751
Change-Id: I80acbdbb8eb9bb4999617698f7314fd8482f4403
Signed-off-by: Ujwal Patel <ujwalp@codeaurora.org>

Conflicts:
	drivers/video/msm/mdss/mdss_fb.c
msm: mdss: support uneven framebuffer split

The default split ratio is 50 percent if buffer resolution width is
greater than the max width that mixer can support. This even split may
not be desired for optimal smp allocation or other usecases.

CRs-fixed: 491728
Change-Id: I8ff3f7c1bd79daf1da9ebded0c561cf96db08b73
Signed-off-by: Huaibin Yang <huaibiny@codeaurora.org>
msm: mdss: only the main display can update the bl_updated flag

The backlight brightness setting might be rejected due to bl_updated flag
status was wrong

Bug: 10032778

Change-Id: Ic07251bff5db39dcb9e48c6daf5485044d73e0fc
Signed-off-by: shihhao.feng <shihhao.feng@lge.com>
Signed-off-by: Devin Kim <dojip.kim@lge.com>

Conflicts:
	drivers/video/msm/mdss/mdss_fb.c
msm: mdss: Initial calibration mode implementation

Enable calibration mode to be set via framebuffer ioctl.

Change-Id: I50e7f652b23180553e1706975e7cbffce68ddf55
Signed-off-by: Carl Vanderlip <carlv@codeaurora.org>

Conflicts:
	drivers/video/msm/mdss/mdss_fb.c
msm: mdss: Update notify returns notify state

Change update notify ioctl to return a value describing
the state that caused the update.

Change-Id: I407c73c7b5c24e36410545175cb8723b4c10971e
Signed-off-by: Carl Vanderlip <carlv@codeaurora.org>
msm: mdss: Add read/write buffer support for calibraiton tool

This change allows to process read/write operation through
buffer instead of single IOCTL call. It is part of
optimization to save DIAG packet processing time.

Change-Id: Iffaab2dd160959f8c7950ebca043b1e0cf25877c
Signed-off-by: Arpita Banerjee <cabane@codeaurora.org>
msm: mdss: support enter/exit DCM for calibration

This change supports the enter/exit DCM for calibration tool.
It blocks the unblank operation if target is in DCM (Display
Calibration Mode).

Change-Id: If65449b9863bb1f9ca0346d736b6939261d1394e
Signed-off-by: Arpita Banerjee <cabane@codeaurora.org>
Revert "msm_fb: mdss: register mdss devices for system shutdown"

This reverts commit a097c1e761fca6eedee1554dc0c068880716d824

Original patch was vulnerable to race condition of system restart task
and other task opening frame buffer devices. This race condition was
introduced because kernel framework of device shutdown adds a fake
ref-count to pm_runtime of the device. This fake ref-count causes
unexpected regressions when device is opened after it was shutdown.
Reverting original patch until proper fix is identified.

CRs-Fixed: 515199
Change-Id: I14324f9875e960a922c5b2b773b086c79a82b09a
Signed-off-by: Shashank Babu Chinta Venkata <sbchin@codeaurora.org>
Signed-off-by: Tirtha Kanti Ghosh <tirtha@codeaurora.org>
Signed-off-by: Ujwal Patel <ujwalp@codeaurora.org>

Conflicts:
	drivers/video/msm/mdss/mdss_fb.c
msm_fb: mdss: register framebuffer devices for device shutdown

Many display panels mandate that when device is powered down, it is
necessary to execute panel power-off sequences. Register framebuffer
devices for shutdown event so that power-off sequences of display panel
can be executed.

Change-Id: I1adbd38affa83a2f8887f8dab90907b6465de3cd
CRs-Fixed: 517260
Signed-off-by: Ujwal Patel <ujwalp@codeaurora.org>

Conflicts:
	drivers/video/msm/mdss/mdss_fb.c
msm: mdss: validate fb backlight inputs

Ensure backlight level is less than the max backlight
brightness and the backlight scaling factor is at most
1.

Change-Id: I424ed22af48ecae46371291fe88a114cf3fc7c31
CRs-Fixed: 516699
Signed-off-by: Manoj Rao <manojraj@codeaurora.org>
Revert "msm: mdss: only the main display can update the bl_updated flag"

This reverts commit cd344456bdd28255b9596447dda1123c84dc34a5.
Replaced with another change from CAF
msm: mdss: maintain backlight-related variables in mfd structure

Backlight status are framebuffer specific and should be maintained in
mfd data structure. Otherwise, the release of one fb (e.g. fb1)
prevents backlight updates of another fb (e.g. fb0).

CRs-fixed: 520695
Change-Id: I7baaebda22a6ae0c7c391d5898c5a7e2467be0be
Signed-off-by: Huaibin Yang <huaibiny@codeaurora.org>

Conflicts:
	drivers/video/msm/mdss/mdss_fb.c
Revert "msm: mdss: Prevent non-zero backlight following display blank"

Patch broke assumption that blank/unblank does not modify backlight value.
This reverts commit 3d4c5574f8284df4b29b4bdbe31fc2b6c4aef079.

Change-Id: I5dfeb0504d23089e7a9dca423726185eddb40d7e
Signed-off-by: Carl Vanderlip <carlv@codeaurora.org>
msm: mdss: Fix FB base layer pipe allocation failure

At boot time when RGB pipe is used as frame buffer base
layer, it is failing in kickoff as pipe's front buffer
has zero planes. Add check for front buffer's number
of plane in kickoff.

Change-Id: I67cefedac3ca272012eb41812caa0bce5cca637e
Signed-off-by: Pawan Kumar <pavaku@codeaurora.org>
msm: mdss: Add runtime writeback output format configuration

Set writeback output format using metadata_ioctl before
queuing buffer for write back from mdp. Default output
format is VENUS. Writeback support RGB_565, RGB_888,
ARGB_8888, XRGB_888 and VENUS as output format.

Change-Id: I788b7f54d80a592ac8da07d10f6b292c4650e46c
Signed-off-by: Beeresh Gopal <gbeeresh@codeaurora.org>
Signed-off-by: Pawan Kumar <pavaku@codeaurora.org>
msm: mdss: Avoid used pipe list corruption

Since a pipe can be freed through an overlay release call or during
kickoff, the !list_empty check is needed before deleting the
used_list head to avoid corruption by attempting to delete the
same head twice.

Change-Id: I80ecce7bddbdf443e3570d408652a35a99758b07
Signed-off-by: Sree Sesha Aravind Vadrevu <svadrevu@codeaurora.org>

Conflicts:
	drivers/video/msm/mdss/mdss_mdp_overlay.c