|
@@ -365,6 +365,36 @@ static const char * const color_range_name[] = {
|
|
|
[DRM_COLOR_YCBCR_LIMITED_RANGE] = "YCbCr limited range",
|
|
|
};
|
|
|
|
|
|
+/**
|
|
|
+ * drm_get_color_encoding_name - return a string for color encoding
|
|
|
+ * @encoding: color encoding to compute name of
|
|
|
+ *
|
|
|
+ * In contrast to the other drm_get_*_name functions this one here returns a
|
|
|
+ * const pointer and hence is threadsafe.
|
|
|
+ */
|
|
|
+const char *drm_get_color_encoding_name(enum drm_color_encoding encoding)
|
|
|
+{
|
|
|
+ if (WARN_ON(encoding >= ARRAY_SIZE(color_encoding_name)))
|
|
|
+ return "unknown";
|
|
|
+
|
|
|
+ return color_encoding_name[encoding];
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+ * drm_get_color_range_name - return a string for color range
|
|
|
+ * @range: color range to compute name of
|
|
|
+ *
|
|
|
+ * In contrast to the other drm_get_*_name functions this one here returns a
|
|
|
+ * const pointer and hence is threadsafe.
|
|
|
+ */
|
|
|
+const char *drm_get_color_range_name(enum drm_color_range range)
|
|
|
+{
|
|
|
+ if (WARN_ON(range >= ARRAY_SIZE(color_range_name)))
|
|
|
+ return "unknown";
|
|
|
+
|
|
|
+ return color_range_name[range];
|
|
|
+}
|
|
|
+
|
|
|
/**
|
|
|
* drm_plane_create_color_properties - color encoding related plane properties
|
|
|
* @plane: plane object
|