b/drivers/gpu/drm/drm_modes.c
@@ -971,6 +971,27 @@ bool drm_mode_equal_no_clocks(const struct
drm_display_mode *mode1, const struct
}
EXPORT_SYMBOL(drm_mode_equal_no_clocks);
+static bool drm_mode_par_valid(const struct drm_display_mode *mode)
+{
+ switch (mode->picture_aspect_ratio) {
+ case HDMI_PICTURE_ASPECT_4_3:
+ case HDMI_PICTURE_ASPECT_16_9:
+ case HDMI_PICTURE_ASPECT_64_27:
+ case HDMI_PICTURE_ASPECT_256_135:
+ return true;
+ default:
+ return false;
+ }
+}
+
+static bool drm_mode_equal_par(const struct drm_display_mode *mode1,
+ const struct drm_display_mode *mode2)
+{
+ if (!drm_mode_par_valid(mode1) || !drm_mode_par_valid(mode2))
+ return true;
+ return mode1->picture_aspect_ratio ==
mode2->picture_aspect_ratio;
+}
+
/**