drm/msm: add multiple CRTC and overlay support

MDP5 currently support one single CRTC with its private pipe.
This change allows the configuration of multiple CRTCs with
the possibility to attach several public planes to these CRTCs.

Signed-off-by: Stephane Viau <sviau@codeaurora.org>
drm/msm/mdp5: don't use void * for opaque types

For example, use 'struct mdp5_smp *' everywhere instead of 'void *', but
only declare it as 'struct mdp5_smp;' in common headers, so the struct
body is still private.  The accomplishes the desired modularity while
still letting the compiler provide some type checking for us.

Signed-off-by: Rob Clark <robdclark@gmail.com>
WIP: drm/msm/mdp5: partially remove global mdp5_ctl_mgr
WIP: drm/msm: atomic fixes
WIP: drm/msm/mdp5: atomic

Still needs few rough edges cleaned:
1) we need to request CTL earlier (when enabling, but not when
disabling).. by the time we get to ->modeset_nofb() any step that
might fail should already be done

2) actually need to checkk for valid # of planes and no conflicting
mixer stages
drm/atomic: check mode_changed *after* atomic_check

The intention is that drivers can set crtc_state->mode_changed in their
atomic_check() fxns if they encounter a scenario that requires full
modeset.

Signed-off-by: Rob Clark <robdclark@gmail.com>
drm/atomic: shutdown *current* encoder

In disable_outputs() we need to shut down the outgoing encoder, not the
incoming one (we have already swapped-state at this point).  Without
this, we end up telling the driver to crtc->dpms(OFF) without first
encoder->dpms(OFF), and that makes some hw quite unhappy.

Reviewed-by: Daniel Vetter <daniel.vetter@intel.com>
Signed-off-by: Rob Clark <robdclark@gmail.com>
WIP: drm/msm/mdp5: dpms(OFF) cleanups

When disabling the interface (INTF), the change doesn't latch until next
vblank, so we need to wait for vblank.

Also, to be pedantic, in the crtc, set all the mixer stages to unused.
It shouldn't really matter, since at this point we have already disabled
the INTF and waited for necessary vblank.
WIP: drm/msm/mdp5: set rate before enabling clk

Set a "safe" rate at first, in order to read out the hw revision.  And
then after set the optimal value.