msm: mdss: Fix under run on interlace clip play in landscape (squash)

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

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

msm: mdss: Avoid variable overloading

A particular variable is overloaded and used in 2 different
contexts. This causes overwriting of original value and leads
to incorrect error handling. This code adds a new variable to
avoid such condition.

Signed-off-by: Shalabh Jain <shalabhj@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.

Signed-off-by: Pawan Kumar <pavaku@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.

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.

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

msm: mdss: Check extra mmb allocated to a pipe

If set call to a pipe changes smp configuration such that
calculated no. of  mmb blocks are less than allocated mmb
blocks, fail this set call. This ensures pipe disconnection
and smp configuration is possible in next commit cycle.
Also, check that no extra mmb is left allocated to any plane
when pipe's format changes. If so, fail the set call to let
correct smp configuration happen in next commit cycle.

Change-Id: I9cef6129142a71ea12037de9d7379a1a9fe97305