msm: mdss: increase height constraints for panel resolution

MDP is able to support higher resolution and is only limited in height
by the MDP clock rate. There is already check in place for the MDP clock
requirement, however need to update phase step calculation to handle
proper overflow conditions for these higher resolution according to
hardware constraints based on potential overflow while scaling with some
phase steps. At the same time hardware is able to handle some conditions
that are currently failed, so enable these to allow more cases that can
go through MDP.

Change-Id: I4c5a569e115302f05db7c525c0f8a76ed1738521
Signed-off-by: Adrian Salido-Moreno <adrianm@codeaurora.org>
msm: mdss: Returning NOTIFY_SUSPEND while polling NOTIFY_UPDATE

mdss_fb_update_notify does not return Suspend in NOTIFY_UPDATE
case. Daemon polls on NOTIFY_UPDATE but does not get Suspend
notification. Hence Daemon would not stop polling.

Suspend Case is added in UPDATE case.

Change-Id: Iaeaf819a6849acda2eb7eb78f0fc3306866d1b64
Signed-off-by: Krishna Chaitanya Parimi <cparimi@codeaurora.org>
msm: mhl: sii8334: handle MHL discovery failure cases

Reset mhl mode on disconnect and suspend to avoid discovery wait
timeout in case connect interrupt is received before start of wait.

Free IRQ on suspend and reconfigure in discovery to avoid unnecessary
wakups and suspends during PM shutdown.

Notify USB in case discovery is failed and on suspend to take over
the control.

CRs-Fixed: 579997
Change-Id: If0747b067d53563c3eb380e80be1254d38b140d6
Signed-off-by: Ajay Singh Parmar <aparmar@codeaurora.org>
msm: mdss: Fix error cases in AD config

The BL linearity LUT was not being copied correctly. This change allows
AD config to exit with errors correctly if the BL linearity LUT is not
passed correctly.

Change-Id: I491a7cc4b168b7691c65cbc2d2963f8a7a3f804d
Signed-off-by: Benet Clark <benetc@codeaurora.org>
msm: mdss: allow histogram stop operation while display is off

After the display is off, the user space can still call histogram
stop operation.

Change-Id: I5c28b3e7e0529319de9d22ca49bdd606994cf7fd
Signed-off-by: Xiaoming Zhou <zhoux@codeaurora.org>
Signed-off-by: Krishna Chaitanya Parimi <cparimi@codeaurora.org>
msm: mdss: Change eDP backlight pwm_config to use nanoseconds

The eDP panel backlight is now configured using nanosecond duty cycle
and period for PWM. A nanosecond PWM configuration is needed in order to
satisfy the granularity needed for 255 backlight levels and the eDP
period. If the pwm_period is very large, then the microsecond
configuration is used.

Change-Id: I946e6291135f79887bfcc60fb339c4d49c1de11b
Signed-off-by: Benet Clark <benetc@codeaurora.org>
msm: mdss: remove interruptible timeout waits

Currently display driver contexts are not utilizing interruptible
wake-ups while using wait_for_completion_interruptible_timeout. This
can lead to incorrect context wake-up and un-predictable outcome. Since
there is already a timeout attached to these kind of context sleeps, it
is safe to replace them with wait_for_completion_timeout.

Change-Id: Ia528debf34aef0acdda2bea1219a128c200c3651
Signed-off-by: Ujwal Patel <ujwalp@codeaurora.org>
msm: mdss: Use MDP_SOLID_FILL to enable color on pipe

To enable constant color on a pipe, set MDP_SOLID_FILL in pipe
flag. This will do a solid fill on the pipe with the color
specified in bg_color.

CRs-Fixed:592032
Change-Id: I3201e2fa657a6fc6d0e7f51f8585366afc3d29a3
Signed-off-by: Mayank Chopra <makchopra@codeaurora.org>
msm: mdss: Modify SMP requirement for BWC decompression

BWC SMP buffer allocations are different from BWC fetch strides.
The Detile write of BWC is segmented into 16 algined segments for
every line buffer. This has to be taken into account and based on the
format the buffers need to be channeled.

Change-Id: I168014709bd81bfb189ce8cb3d1224f911838ba7
Signed-off-by: Sree Sesha Aravind Vadrevu <svadrevu@codeaurora.org>
msm: mdss: do proper error handling in case of rotator setup fail

When rotator setup fails, the session should only be finished internally
if it hasn't been reported to userspace. At the same time, need to
ensure that proper cleanup of rotator list is happening, through
internal release path.

Change-Id: I7a6f46261bf8783547de1c7f7fd6893916b25827
Signed-off-by: Adrian Salido-Moreno <adrianm@codeaurora.org>
msm: mdss: move rotator SMP reservation to rotator setup

Shared memory pool (SMP) blocks are limited, in some cases where there
are many overlay pipes used, we may not be able to get enough blocks for
rotator sessions. In such cases fall-back solution must be considered,
however for this to happen this would need to be identified during
rotator session setup. Move logic to do pipe resource reservation in
rotator setup if possible.

Change-Id: I223281fb51b81baf852cac415a8c61c0de35c2c4
Signed-off-by: Adrian Salido-Moreno <adrianm@codeaurora.org>

Conflicts:
	drivers/video/msm/mdss/mdss_mdp_rotator.c
msm: mdss: Set correct flush bit for writeback mixer.

Wrong flush bit is being set for writeback mixer which can cause
MDP hang/unexpected behaviour when the mixer is used in line mode.
This patch addresses the issue by setting the correct flush bit.

Change-Id: Ie0c2ee27b1f466164a8fb84f7daae9309b74d1d8
Signed-off-by: Vishnuvardhan Prodduturi <vproddut@codeaurora.org>
mdss: Avoid panel ON commands during boot up for command mode

In command mode, when continuous splash is enabled, we do not
send the panel OFF commands through the SPLASH_BEGIN callback.
Avoid the SPLASH_FINISH callback also for command mode since
panel ON commands are not required to be sent. This avoids
unnecessary warnings during boot up.

Change-Id: Ifc249f259655045ecd799b57e1efb964238c504a
Signed-off-by: Padmanabhan Komanduru <pkomandu@codeaurora.org>
msm: mdss: Add support to halt pipe fetches

Add a utility to halt any pipe fetches and wait on it until all fetches
are completely halted. Use this utility during staging and un-staging
of the pipe.

Change-Id: Id865970063dffc2870be5fd2cf51b9711134dc89
Signed-off-by: Ujwal Patel <ujwalp@codeaurora.org>
msm: mdss: Fix debugfs string overwrite

If more than one display paths are active, like split display or external
mirroring, and stat debugfs node is read then debug data for only one
display is shown. Fix this by using correct offsets.

Change-Id: Ia8b36eb3105f6df8f096ff544b82cc49c9b31a48
Signed-off-by: Ujwal Patel <ujwalp@codeaurora.org>
Revert "posix_types.h: Cleanup stale __NFDBITS and related definitions"

This reverts commit 27cd8f51344dcf4799c7a092c1797402b833126a.