|
@@ -1605,3 +1605,61 @@ int drm_mode_convert_umode(struct drm_display_mode *out,
|
|
|
out:
|
|
|
return ret;
|
|
|
}
|
|
|
+
|
|
|
+/**
|
|
|
+ * drm_mode_is_420_only - if a given videomode can be only supported in YCBCR420
|
|
|
+ * output format
|
|
|
+ *
|
|
|
+ * @connector: drm connector under action.
|
|
|
+ * @mode: video mode to be tested.
|
|
|
+ *
|
|
|
+ * Returns:
|
|
|
+ * true if the mode can be supported in YCBCR420 format
|
|
|
+ * false if not.
|
|
|
+ */
|
|
|
+bool drm_mode_is_420_only(const struct drm_display_info *display,
|
|
|
+ const struct drm_display_mode *mode)
|
|
|
+{
|
|
|
+ u8 vic = drm_match_cea_mode(mode);
|
|
|
+
|
|
|
+ return test_bit(vic, display->hdmi.y420_vdb_modes);
|
|
|
+}
|
|
|
+EXPORT_SYMBOL(drm_mode_is_420_only);
|
|
|
+
|
|
|
+/**
|
|
|
+ * drm_mode_is_420_also - if a given videomode can be supported in YCBCR420
|
|
|
+ * output format also (along with RGB/YCBCR444/422)
|
|
|
+ *
|
|
|
+ * @display: display under action.
|
|
|
+ * @mode: video mode to be tested.
|
|
|
+ *
|
|
|
+ * Returns:
|
|
|
+ * true if the mode can be support YCBCR420 format
|
|
|
+ * false if not.
|
|
|
+ */
|
|
|
+bool drm_mode_is_420_also(const struct drm_display_info *display,
|
|
|
+ const struct drm_display_mode *mode)
|
|
|
+{
|
|
|
+ u8 vic = drm_match_cea_mode(mode);
|
|
|
+
|
|
|
+ return test_bit(vic, display->hdmi.y420_cmdb_modes);
|
|
|
+}
|
|
|
+EXPORT_SYMBOL(drm_mode_is_420_also);
|
|
|
+/**
|
|
|
+ * drm_mode_is_420 - if a given videomode can be supported in YCBCR420
|
|
|
+ * output format
|
|
|
+ *
|
|
|
+ * @display: display under action.
|
|
|
+ * @mode: video mode to be tested.
|
|
|
+ *
|
|
|
+ * Returns:
|
|
|
+ * true if the mode can be supported in YCBCR420 format
|
|
|
+ * false if not.
|
|
|
+ */
|
|
|
+bool drm_mode_is_420(const struct drm_display_info *display,
|
|
|
+ const struct drm_display_mode *mode)
|
|
|
+{
|
|
|
+ return drm_mode_is_420_only(display, mode) ||
|
|
|
+ drm_mode_is_420_also(display, mode);
|
|
|
+}
|
|
|
+EXPORT_SYMBOL(drm_mode_is_420);
|