drm/msm/mdp5: handle SMP block allocations "atomically"
authorRob Clark <robdclark@gmail.com>
Tue, 1 Nov 2016 20:35:32 +0000 (16:35 -0400)
committerRob Clark <robdclark@gmail.com>
Sun, 27 Nov 2016 16:32:34 +0000 (11:32 -0500)
commit49ec5b2e5acb8174a4418c67a3ce4e4cf9be2790
treea215d5dfd383d36c62b7fec7d2ea2f4b524c78bb
parent4a0f012da3e21174f34637ae3b6818c0da60f2f9
drm/msm/mdp5: handle SMP block allocations "atomically"

Previously, SMP block allocation was not checked in the plane's
atomic_check() fxn, so we could fail allocation SMP block allocation at
atomic_update() time.  Re-work the block allocation to request blocks
during atomic_check(), but not update the hw until committing the atomic
update.

Since SMP blocks allocated at atomic_check() time, we need to manage the
SMP state as part of mdp5_state (global atomic state).  This actually
ends up significantly simplifying the SMP management, as the SMP module
does not need to manage the intermediate state between assigning new
blocks before setting flush bits and releasing old blocks after vblank.
(The SMP registers and SMP allocation is not double-buffered, so newly
allocated blocks need to be updated in kms->prepare_commit() released
blocks in kms->complete_commit().)

Signed-off-by: Rob Clark <robdclark@gmail.com>
drivers/gpu/drm/msm/mdp/mdp5/mdp5_kms.c
drivers/gpu/drm/msm/mdp/mdp5/mdp5_kms.h
drivers/gpu/drm/msm/mdp/mdp5/mdp5_pipe.c
drivers/gpu/drm/msm/mdp/mdp5/mdp5_pipe.h
drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c
drivers/gpu/drm/msm/mdp/mdp5/mdp5_smp.c
drivers/gpu/drm/msm/mdp/mdp5/mdp5_smp.h