Sean Paul a796ba2cb3 drm/msm: dpu: Separate crtc assignment from vblank enable
Instead of assigning/clearing the crtc on vblank enable/disable, we can
just assign and clear the crtc on modeset. That allows us to just toggle
the encoder's vblank interrupts on vblank_enable.

So why is this important? Previously the driver was using the legacy
pointers to assign/clear the crtc. Legacy pointers are cleared _after_
disabling the hardware, so the legacy pointer was valid during
vblank_disable, but that's not something we should rely on.

Instead of relying on the core ordering the legacy pointer assignments
just so, we'll assign the crtc in dpu_crtc enable/disable. This is the
only place that mapping can change, so we're covered there.

We're also taking advantage of drm_crtc_vblank_on/off. By using this, we
ensure that vblank_enable/disable can never be called while the crtc is
off (which means the assigned crtc will always be valid). As such, we
don't need to use modeset locks or the crtc_lock in the
vblank_enable/disable routine to be sure state is consistent.

...I think.

Changes in v2:
- Changed crtc check in toggle_vblank to != (Jeykumar)

Cc: Jeykumar Sankaran <jsanka@codeaurora.org>
Reviewed-by: Jeykumar Sankaran <jsanka@codeaurora.org>
Signed-off-by: Sean Paul <seanpaul@chromium.org>
[dpu_crtc.c change needed to be manually applied b/c of the dpu_crtc_reset change]

Signed-off-by: Rob Clark <robdclark@gmail.com>
2018-12-11 13:10:15 -05:00
..
2018-09-09 14:19:18 +02:00
2018-11-29 10:34:03 +10:00
2018-11-22 12:54:38 +10:00
2018-11-29 10:28:49 +10:00
2018-10-28 17:49:53 -07:00
2018-11-28 09:31:07 -08:00
2018-11-22 12:54:38 +10:00
2018-09-28 09:47:31 +10:00
2018-11-20 14:56:18 +01:00
2018-11-29 10:28:49 +10:00
2018-11-29 10:34:03 +10:00
2018-11-20 14:56:18 +01:00
2018-11-19 10:40:33 +10:00
2018-10-04 11:03:34 +10:00