msm: mdss: Decimation and BWC cannot be enabled together

Hardware cannot support decimation and bwc together.
The use case should be failed.

Change-Id: Ic7547340eb08d542a296aa9cfdd150e7eb0bea4b
Signed-off-by: Sree Sesha Aravind Vadrevu <svadrevu@quicinc.com>
msm: mdss: Program phase factors for QSEED in Dual display mode

When scaling is involved during video playback for dual display
high resolution panels, the scaling factors such as phase step and
initial phase need to be programmed to avoid mismatched textures
and hardware hangs. Also, software pixel extension needs to be
enabled. The data is received from user module through OVERLAY_SET.
This feature is only enabled for YUV formats in VIG pipes.

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

Conflicts:

	drivers/video/msm/mdss/mdss_mdp_pipe.c

Signed-off-by: Pawan Kumar <pavaku@codeaurora.org>

Conflicts:
	drivers/video/msm/mdss/mdss_mdp_overlay.c
	drivers/video/msm/mdss/mdss_mdp_pipe.c
	drivers/video/msm/mdss/mdss_mdp_pp.c
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>

Conflicts:
	drivers/video/msm/mdss/mdss_mdp.h
msm: mdss: fix sw calculation of interlace x offset

Interlacing is handled in software by changing the original height to
half which would become the width after rotation. In cases of 90 degree
rotation the height becomes the displayed width so in that case the
source x offset needs to be updated to half of intended similar to
source width.

CRs-Fixed: 545926
Change-Id: I0de9adb243d6162f5387b1ebc2821141eea4b111
Signed-off-by: Adrian Salido-Moreno <adrianm@codeaurora.org>
Signed-off-by: Pawan Kumar <pavaku@codeaurora.org>
msm: mdss: Fix under run on interlace clip play in landscape

Rotator src rect y co-ordinate is getting odd after de-interlace
calculation but mdss expects even.

Change-Id: I124d059c89c51126208ad1de02a9d34d87b0f553
Signed-off-by: Pawan Kumar <pavaku@codeaurora.org>
mdss: dsi: Add first controller initialization in panel probe

For cont Splash feature for split display panels,
first controller has to be initialized in probe.
Move the first controller initialization from host init
to controller init function that is called during panel
probe.

Change-Id: Ib964877cd345adfc9f52e7ebe5dc59652a2de44e
Signed-off-by: Chandan Uddaraju <chandanu@codeaurora.org>

Conflicts:
	drivers/video/msm/mdss/mdss_dsi_host.c
msm: mdss: Add error handling support for DCS command APIs

Currently there is no error handling done for DSI DCS command
APIs like mdss_dsi_cmdlist_put. So for ESD thread use cases,
the caller functions of these DCS command APIs do not have error
propagated if the panel read/write commands fail. Hence add support
for error handling for these functions.

Change-Id: I0e558fd32fbfd8ae247b60c92fa2756159c3d3c6
Signed-off-by: Padmanabhan Komanduru <pkomandu@codeaurora.org>

Conflicts:
	drivers/video/msm/mdss/dsi_host_v2.c
	drivers/video/msm/mdss/mdss_dsi.h
	drivers/video/msm/mdss/mdss_dsi_host.c
msm: mdss: Add an extra write of zero to clear dsi-ack-err bit

In addition to writing 1 to clear dsi-ack-err bit, an extra write
of 0 is also needed to clear error bit completely.

CRs-fixed: 574066
Change-Id: Ib9df9fe5f993605372ced8766874fa00538f505a
Signed-off-by: Shivaraj Shetty <shivaraj@codeaurora.org>
mondrianwifi: mdss: Remove Samsung's get_lcd_attached

Change-Id: I2b94de6625706aaf293128ba7ffc8502b6556c46
mondrianwifi: mdss: cleanup some Samsung cruft

Change-Id: Ib675fd6d9d9ec304b4e90474720f10d2b276209a
mondrianwifi: Remove unused hardware specific files

Change-Id: I60418a355897975e40ff63be0f8b0edd62404fa6
mondrianwifi: mdss: Remove Samsung's alpm_event hook

Change-Id: Ic8825fa69f58b2a01242b44f727fd21d30e279ae
msm: mdss: allow re-queue of writeback buffers

When a buffer has been properly processed, client may choose to use sync
fence to acknowledge when buffer is complete. In such cases dequeue is
not necessary, allow this use case by allowing client to re-queue
writeback buffers as long as the buffer has been properly processed
already.

Change-Id: Ibac1eb9710477734e1ee2daf8136085d4439b0d4
Signed-off-by: Adrian Salido-Moreno <adrianm@codeaurora.org>
msm: mdss: unmap user writeback buffers after session is terminated

Currently if buffers are provided to writeback driver through user space
ioctl, these are never unmapped and may cause leaks in memory. Also, we
can reuse the nodes which are already mapped until session is
terminated.

Change-Id: Ic786dfa735af529998bfc9467ac872b2badc0e31
Signed-off-by: Adrian Salido-Moreno <adrianm@codeaurora.org>
msm: mdss: Fix mdss iommu detach-attach issue

Move iommu attach logic to rotator play and writeback
queue buffer from overlay_kickoff to make sure iommu is
enable before mapping any buffers.

Change-Id: I92eb3d4686c1641728980d057f2de6c0d324be71
Signed-off-by: Pawan Kumar <pavaku@codeaurora.org>

Conflicts:
	drivers/video/msm/mdss/mdss_mdp_overlay.c
	drivers/video/msm/mdss/mdss_mdp_rotator.c
msm: mdss: initialize write back arguments in kickoff

The kickoff code relies on the fact that write back arguments are zero
initialized to check for available buffer. If it's not zero initialized
it may pick dirty buffer address from stack.

Change-Id: I7309f8fe508640833a182a8ecdb2d3be1797fab7
Signed-off-by: Adrian Salido-Moreno <adrianm@codeaurora.org>
msm: mdss: Add support for BGRA and BGRX as writeback output format

Add support to get and set BGRA_8888 and BGRX_8888
as writeback output format using metadata_ioctl.

Change-Id: I093824229d09b89433aaceffe585fb2d3e2b9e10
Signed-off-by: Pawan Kumar <pavaku@codeaurora.org>

Conflicts:
	drivers/video/msm/mdss/mdss_mdp_wb.c
msm: mdss: synchronize wfd driver iommu mmap/munmap with mdss

Add clocks reference during wfd driver iommu mdp_mmap/mdp_munmap
to ensure iommu is in proper state while wfd driver map/un-map
any buffers.

Change-Id: Id1a24285b81d5047e5e9f002ade9694ea49be59d
Signed-off-by: Pawan Kumar <pavaku@codeaurora.org>
mdp: mdss: Tune bandwidth and clock based on ROI

Calculate bandwidth and MDP clock requirement considering
the ROI submitted for a frame. When doing partial frame update
for smart panels, the data actually fetched for a pipe is not
always the full resolution of the buffer programmed. Use the
ROI passed to find out the region of fetching and calculate the
bandwidth and clock values accordingly.

Change-Id: I01f24f8fd9a42a2c4d705b8eb0a7658e79884175
Signed-off-by: Jeykumar Sankaran <jsanka@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