aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/drm_plane_helper.c
diff options
context:
space:
mode:
authorMatt Roper <matthew.d.roper@intel.com>2014-12-11 07:20:57 -0800
committerDaniel Vetter <daniel.vetter@ffwll.ch>2014-12-11 16:57:18 +0100
commit7432ca5acec8a24a7e576c92d28449e2d790b734 (patch)
tree1dfbbb897c5c1e27c9c612f29c61a6eb1367647a /drivers/gpu/drm/drm_plane_helper.c
parentdrm/doc: Document drm_add_modes_noedid() usage (diff)
downloadlinux-dev-7432ca5acec8a24a7e576c92d28449e2d790b734.tar.xz
linux-dev-7432ca5acec8a24a7e576c92d28449e2d790b734.zip
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: Matt Roper <matthew.d.roper@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to '')
-rw-r--r--drivers/gpu/drm/drm_plane_helper.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/drivers/gpu/drm/drm_plane_helper.c b/drivers/gpu/drm/drm_plane_helper.c
index 18a1ac6ac22f..391dfb7d1086 100644
--- a/drivers/gpu/drm/drm_plane_helper.c
+++ b/drivers/gpu/drm/drm_plane_helper.c
@@ -142,6 +142,17 @@ int drm_plane_helper_check_update(struct drm_plane *plane,
{
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) {
DRM_DEBUG_KMS("Cannot update plane of a disabled CRTC.\n");
return -EINVAL;
@@ -155,11 +166,6 @@ int drm_plane_helper_check_update(struct drm_plane *plane,
return -ERANGE;
}
- if (!fb) {
- *visible = false;
- return 0;
- }
-
*visible = drm_rect_clip_scaled(src, dest, clip, hscale, vscale);
if (!*visible)
/*