drm: provide a helper for the encoder possible_crtcs mask
[firefly-linux-kernel-4.4.55.git] / drivers / gpu / drm / drm_crtc_helper.c
index 01361aba033b4a39888a41bc15c4a7f5e4052152..940c678cf012acfdeb4311fc202aac1ee44d6c07 100644 (file)
@@ -334,23 +334,7 @@ EXPORT_SYMBOL(drm_helper_disable_unused_functions);
 static bool drm_encoder_crtc_ok(struct drm_encoder *encoder,
                                struct drm_crtc *crtc)
 {
-       struct drm_device *dev;
-       struct drm_crtc *tmp;
-       int crtc_mask = 1;
-
-       WARN(!crtc, "checking null crtc?\n");
-
-       dev = crtc->dev;
-
-       list_for_each_entry(tmp, &dev->mode_config.crtc_list, head) {
-               if (tmp == crtc)
-                       break;
-               crtc_mask <<= 1;
-       }
-
-       if (encoder->possible_crtcs & crtc_mask)
-               return true;
-       return false;
+       return !!(encoder->possible_crtcs & drm_crtc_mask(crtc));
 }
 
 /*