OSDN Git Service

drm/msm/mdp5: dynamically assign hw pipes to planes
authorRob Clark <robdclark@gmail.com>
Tue, 1 Nov 2016 15:56:54 +0000 (11:56 -0400)
committerRob Clark <robdclark@gmail.com>
Sun, 27 Nov 2016 16:32:33 +0000 (11:32 -0500)
commit4a0f012da3e21174f34637ae3b6818c0da60f2f9
treeed8e3069eb1f86883032bab6c5f0a12c72d0cebb
parentac2a3fd35b48b7fb5a9e08a6d6f83147178b833d
drm/msm/mdp5: dynamically assign hw pipes to planes

(re)assign the hw pipes to planes based on required caps, and to handle
situations where we could not modify an in-use plane (ie. SMP block
reallocation).

This means all planes advertise the superset of formats and properties.
Userspace must (as always) use atomic TEST_ONLY step for atomic updates,
as not all planes may be available for use on every frame.

The mapping of hwpipe to plane is stored in mdp5_state, so that state
updates are atomically committed in the same way that plane/etc state
updates are managed.  This is needed because the mdp5_plane_state keeps
a pointer to the hwpipe, and we don't want global state to become out
of sync with the plane state if an atomic update fails, we hit deadlock/
backoff scenario, etc.  The use of state_lock keeps multiple parallel
updates which both re-assign hwpipes properly serialized.

Signed-off-by: Rob Clark <robdclark@gmail.com>
drivers/gpu/drm/msm/mdp/mdp5/mdp5_crtc.c
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