Procházet zdrojové kódy

drm: mode: Allow NULL modes for equality check

Since we're now using mode == NULL to represent disabled, it's not
wholly surprising that we'd want to compare NULL modes.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Daniel Stone před 10 roky
rodič
revize
54270952e9
1 změnil soubory, kde provedl 6 přidání a 0 odebrání
  1. 6 0
      drivers/gpu/drm/drm_modes.c

+ 6 - 0
drivers/gpu/drm/drm_modes.c

@@ -903,6 +903,12 @@ EXPORT_SYMBOL(drm_mode_duplicate);
  */
 bool drm_mode_equal(const struct drm_display_mode *mode1, const struct drm_display_mode *mode2)
 {
+	if (!mode1 && !mode2)
+		return true;
+
+	if (!mode1 || !mode2)
+		return false;
+
 	/* do clock check convert to PICOS so fb modes get matched
 	 * the same */
 	if (mode1->clock && mode2->clock) {