Commit 7432ca5a authored by Matt Roper's avatar Matt Roper Committed by Daniel Vetter

drm/plane-helper: Test for plane disable earlier

drm_plane_helper_check_update() currently uses crtc before testing whether
we're disabling the plane (fb == NULL).  Move the fb test before the first crtc
usage so that crtc == NULL doesn't have to be handled by the caller.
Signed-off-by: default avatarMatt Roper <matthew.d.roper@intel.com>
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
parent c631c715
...@@ -142,6 +142,17 @@ int drm_plane_helper_check_update(struct drm_plane *plane, ...@@ -142,6 +142,17 @@ int drm_plane_helper_check_update(struct drm_plane *plane,
{ {
int hscale, vscale; int hscale, vscale;
if (!fb) {
*visible = false;
return 0;
}
/* crtc should only be NULL when disabling (i.e., !fb) */
if (WARN_ON(!crtc)) {
*visible = false;
return 0;
}
if (!crtc->enabled && !can_update_disabled) { if (!crtc->enabled && !can_update_disabled) {
DRM_DEBUG_KMS("Cannot update plane of a disabled CRTC.\n"); DRM_DEBUG_KMS("Cannot update plane of a disabled CRTC.\n");
return -EINVAL; return -EINVAL;
...@@ -155,11 +166,6 @@ int drm_plane_helper_check_update(struct drm_plane *plane, ...@@ -155,11 +166,6 @@ int drm_plane_helper_check_update(struct drm_plane *plane,
return -ERANGE; return -ERANGE;
} }
if (!fb) {
*visible = false;
return 0;
}
*visible = drm_rect_clip_scaled(src, dest, clip, hscale, vscale); *visible = drm_rect_clip_scaled(src, dest, clip, hscale, vscale);
if (!*visible) if (!*visible)
/* /*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment