drm: small property creation cleanup
[deliverable/linux.git] / drivers / gpu / drm / drm_plane_helper.c
index ae61fb21ea864de0155c2c8418143bd84b39b1f7..f24c4cfe674b9e0d75a36f0ab017afef7bcddb5f 100644 (file)
@@ -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)
                /*
This page took 0.044284 seconds and 5 git commands to generate.