msm: mdss: remove YUV upscale limitation

Parameters check for YUV upscaling when doing chroma upsampling is not
required, hardware is able to support up to 40x up scaling for chroma
components so this check is not needed.

Change-Id: I700282c4627df5a630def6072b8deba38bb58b41
Signed-off-by: Adrian Salido-Moreno <adrianm@codeaurora.org>
msm8974: mhl: set hpd, tmds based on path_en bit

Set HPD and TMDS pass-through only after receiving
PATH_EN from the sink and reading all device
capability bytes from the sink.
Making MHL wait until the PATH_EN bit has been set by the
sink/dongle is in conformance with the MHL spec.
This change prevents incorrect behavior in usecases
such as meeting timing requirements in test 1A-02 HDCP
compliance test suite, disabling hpd when TV is powered off
with MHL cable connected to the TX.

CRs-Fixed: 504737
CRs-Fixed: 481930
Change-Id: Id2c1fb9d2dbe10b1310958021cca3533790e7394
Signed-off-by: Abhishek Kharbanda <akharban@codeaurora.org>
Signed-off-by: Manoj Rao <manojraj@codeaurora.org>
msm: mdss: Do not call set rate for handoff enabled clocks

When continuous splash screen is enabled, DSI branch clocks
are never turned off in the bootloader and are handed off
during kernel bootup. When the DSI controller is probed, it
needs to vote for keeping these clocks enabled. However,
calling set rate may result in a screen blink. Remove the
set rate call to fix this issue.

CRs-Fixed: 506037
Change-Id: I46074ff93456899de6b0e36a185d00d16f5f762e
Signed-off-by: Aravind Venkateswaran <aravindh@codeaurora.org>

Conflicts:
	drivers/video/msm/mdss/msm_mdss_io_8974.c
msm: mdss: Fix order of DSI clocks operations

For DSI branch clocks, set rate should be called
before calling the prepare and enable ops. This is
the recommended order for clock operations and is
required before moving the DSI pll enable sequences
to the prepare op.

Change-Id: I5f53f424a6665e2ce41076734eb6379596fa1d00
CRs-Fixed: 513361
Signed-off-by: Aravind Venkateswaran <aravindh@codeaurora.org>

Conflicts:
	drivers/video/msm/mdss/mdss_dsi_host.c
	drivers/video/msm/mdss/msm_mdss_io_8974.c
mdss: display: add edp aux channel support toward link training

Edp aux channel is the communication channel between host and
client (panel). Host reads edid back from panel and issues dpcd
command to panel through aux channel. This patch adds aux channel
support so that edp link training can be done.

CRs-Fixed: 486135
Change-Id: If29dc8257ecc555296c043f2ebcc6dc5cb400d49
Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>
mdss: hdmi: Correct CEA format check

This change corrects the CEA format check to include all the supported
resolutions through which the audio should be routed to HDMI TV.

CRs-Fixed: 517950
Change-Id: Icd5c7503b2dc3a184bbf52205b0386eee9daca62
Signed-off-by: Ajay Singh Parmar <aparmar@codeaurora.org>
msm: mdss: Change the Aplha scaling type to bilinear

Currently, for Alpha plane the filter used is nearest due to which
there is an aliasing effect. Using the same filter as graphics core
which is bilinear, the aliasing effect is avoided.

CRs-fixed: 517627
Change-Id: Ifb4629ddcea1ac447d151469b1f56e3400b7fac0
Signed-off-by: Sree Sesha Aravind Vadrevu <svadrevu@codeaurora.org>
msm: mdss: keep reference of rotator output buffer

Change logic to free buffer for previous rotation call. This will make
sure to keep a ref count on the buffer secure lock before it's picked up
by MDP for displaying to panel. It will also allow for asynchronous calls
to rotator to be supported by not freeing the source and destination
buffers within same call.

Change-Id: I389d6a4523bdc79a5dfe76e3603e43325d63b82c
Signed-off-by: Adrian Salido-Moreno <adrianm@codeaurora.org>
msm: mdss: Make wait_for_complete calls uninterruptible

The wait_for_complete calls in the MDSS driver are associated
with an acceptable timeout value which would remove the need for
making them interruptible. Also, this prevents unwanted signal
interrupts before the call is finished.

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

Conflicts:
	drivers/video/msm/mdss/mdss_mdp_wb.c
msm: mdss: Change vsync dispatch mechanism

Notify the userspace when to read vsync instead of userspace
blocking on the vsync show event. Use a work queue to call
sysfs_notify to accomplish this.

Change-Id: I2d6ea6a6c4683cbd4c3ed9ca355546282e375194
Signed-off-by: Naseer Ahmed <naseer@codeaurora.org>

Conflicts:
	drivers/video/msm/mdss/mdp3_ctrl.c
	drivers/video/msm/mdss/mdss_mdp_overlay.c
msm: mdss: Introduce error checks for rotator sessions

When there are more virtual rotator sessions allocated than
DMA pipes available, rotator pipe allocations might fail and
corresponding error messages are printed which can lead to a
watchdog bark. This change silences those error messages and
also implements an extra check to avoid null pointer
dereference when a session is dequeued without a pipe.

CRs-fixed: 523701
Change-Id: I128ab85aac9e091b13a8772a43342d655c6f736f
Signed-off-by: Sree Sesha Aravind Vadrevu <svadrevu@codeaurora.org>
msm: mdss: copy gamut conf tables from kernel mem

Read the gamut config data from hardware into kernel's
memory and copy back to user space address using copy_to_user
API. This prevents MDP PP driver from writing directly into
userspace virtual address to copy gamut config data.

CRs-Fixed: 516720
Change-Id: Ib1f53e949696f7d4a45410c529fe9375c502090f
Signed-off-by: Manoj Rao <manojraj@codeaurora.org>
mdss: display: add mdp core clock to dsi clock control

Since mdss interrupts are generated in mdp core clock domain,
mdp clock need to be enabled to have dsi interrupt be delivered
during dsi dcs command send and receive. Request of bus bandwidth
also needed to allow dsi controller to fetch dcs commands over
AXI bus.

CRs-fixed: 516172
Change-Id: I6e10cc5a193c9eb06803637e0432ec72f069377b
Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>

Conflicts:
	drivers/video/msm/mdss/mdss_mdp.c
msm: mdss: update bandwidth  requests on clock switches

Bandwidth requests to the bus need to be cleared when clock
is turned off for command panel to save power.

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

Conflicts:
	drivers/video/msm/mdss/mdss_mdp.c
msm: mdss: Introduce timeout on wb task complete

Implement timeout on writeback kickoff for cases where interrupt is not
received and avoid possible MDP hang. For such cases, even though
they're not expected, ignore the error and continue in order to recover.

CRs-fixed: 495554
Signed-off-by: Sree Sesha Aravind Vadrevu <svadrevu@codeaurora.org>
(cherry picked from commit 82d94721401b94e2c09d5b1ee90520364ef27da8)

Change-Id: I576b77b05af7a858688b0ab2c1e00ed1e8fa1435
Signed-off-by: Sridhar Nelloru <nellos@codeaurora.org>

Conflicts:
	drivers/video/msm/mdss/mdss_mdp.h
	drivers/video/msm/mdss/mdss_mdp_wb.c