提交 216c59d6 编写于 作者: L Laurent Pinchart 提交者: Daniel Vetter

drm/atomic-helper: Don't skip plane disabling on active CRTC

Since commit "drm/atomic-helper: Add option to update planes only on
active crtc" the drm_atomic_helper_commit_planes() function accepts an
active_only argument to skip updating planes when the associated CRTC is
inactive. Planes being disabled on an active CRTC are incorrectly
considered as associated with an inactive CRTC and are thus skipped,
preventing any plane disabling update from reaching drivers.

Fix it by checking the state of the CRTC stored in the old plane state
for planes being disabled.
Signed-off-by: NLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
上级 c86fb9d9
...@@ -1227,23 +1227,35 @@ void drm_atomic_helper_commit_planes(struct drm_device *dev, ...@@ -1227,23 +1227,35 @@ void drm_atomic_helper_commit_planes(struct drm_device *dev,
for_each_plane_in_state(old_state, plane, old_plane_state, i) { for_each_plane_in_state(old_state, plane, old_plane_state, i) {
const struct drm_plane_helper_funcs *funcs; const struct drm_plane_helper_funcs *funcs;
bool disabling;
funcs = plane->helper_private; funcs = plane->helper_private;
if (!funcs) if (!funcs)
continue; continue;
if (active_only && !plane_crtc_active(plane->state)) disabling = drm_atomic_plane_disabling(plane, old_plane_state);
continue;
if (active_only) {
/*
* Skip planes related to inactive CRTCs. If the plane
* is enabled use the state of the current CRTC. If the
* plane is being disabled use the state of the old
* CRTC to avoid skipping planes being disabled on an
* active CRTC.
*/
if (!disabling && !plane_crtc_active(plane->state))
continue;
if (disabling && !plane_crtc_active(old_plane_state))
continue;
}
/* /*
* Special-case disabling the plane if drivers support it. * Special-case disabling the plane if drivers support it.
*/ */
if (drm_atomic_plane_disabling(plane, old_plane_state) && if (disabling && funcs->atomic_disable)
funcs->atomic_disable)
funcs->atomic_disable(plane, old_plane_state); funcs->atomic_disable(plane, old_plane_state);
else if (plane->state->crtc || else if (plane->state->crtc || disabling)
drm_atomic_plane_disabling(plane, old_plane_state))
funcs->atomic_update(plane, old_plane_state); funcs->atomic_update(plane, old_plane_state);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册