summaryrefslogtreecommitdiff
path: root/include/drm/drm_color_mgmt.h
diff options
context:
space:
mode:
authorVille Syrjälä <ville.syrjala@linux.intel.com>2018-03-15 17:23:38 +0200
committerVille Syrjälä <ville.syrjala@linux.intel.com>2018-03-16 15:44:01 +0200
commit41204dfeed93f2c7668cf8aa5086bcd96eccaa35 (patch)
treecb7f210a29c95a520eaf7ed0c0a4f99ac3efae45 /include/drm/drm_color_mgmt.h
parentd2a24edb532e6599755fc1bbd080cf57e0dd72c3 (diff)
drm: Introduce drm_color_lut_size()
Provide a small helper to convert the blob length in bytes to the number of LUT entries. v2: Add kerneldoc (Daniel) Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: https://patchwork.freedesktop.org/patch/msgid/20180315152338.7248-1-ville.syrjala@linux.intel.com
Diffstat (limited to 'include/drm/drm_color_mgmt.h')
-rw-r--r--include/drm/drm_color_mgmt.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/include/drm/drm_color_mgmt.h b/include/drm/drm_color_mgmt.h
index b3b6d302ca8c..44f04233e3db 100644
--- a/include/drm/drm_color_mgmt.h
+++ b/include/drm/drm_color_mgmt.h
@@ -38,6 +38,18 @@ void drm_crtc_enable_color_mgmt(struct drm_crtc *crtc,
int drm_mode_crtc_set_gamma_size(struct drm_crtc *crtc,
int gamma_size);
+/**
+ * drm_color_lut_size - calculate the number of entries in the LUT
+ * @blob: blob containing the LUT
+ *
+ * Returns:
+ * The number of entries in the color LUT stored in @blob.
+ */
+static inline int drm_color_lut_size(const struct drm_property_blob *blob)
+{
+ return blob->length / sizeof(struct drm_color_lut);
+}
+
enum drm_color_encoding {
DRM_COLOR_YCBCR_BT601,
DRM_COLOR_YCBCR_BT709,