OSDN Git Service

drm/msm/mdp5: Add support for legacy cursor updates
authorArchit Taneja <architt@codeaurora.org>
Fri, 16 Dec 2016 06:29:57 +0000 (11:59 +0530)
committerRob Clark <robdclark@gmail.com>
Mon, 6 Feb 2017 16:28:44 +0000 (11:28 -0500)
commit10967a0687b13a27d77b4a77d97010359cb8267f
tree4c40aac0185f29d9ca1b6e15462385fd583fb1fe
parent9142364e4666835e53586c21fe4e8983a8b09bb2
drm/msm/mdp5: Add support for legacy cursor updates

This code has been more or less picked up from the vc4 and intel
implementations of update_plane() funcs for cursor planes.

The update_plane() func is usually the drm_atomic_helper_update_plane
func that will issue an atomic commit with the plane updates. Such
commits are not intended to be done faster than the vsync rate.

The legacy cursor userspace API, on the other hand, expects the kernel
to handle cursor updates immediately.

Create a fast path in update_plane, which updates the cursor registers
and flushes the configuration. The fast path is taken when there is only
a change in the cursor's position in the crtc, or a change in the
cursor's crop co-ordinates. For anything else, we go via the slow path.

We take the slow path even when the fb changes, and when there is
currently no fb tied to the plane. This should hopefully ensure that we
always take a slow path for every new fb. This in turn should ensure that
the fb is pinned/prepared.

Signed-off-by: Archit Taneja <architt@codeaurora.org>
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.h
drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c