diff options
| author | Alex Hung <alex.hung@amd.com> | 2025-11-14 17:02:02 -0700 |
|---|---|---|
| committer | Simon Ser <contact@emersion.fr> | 2025-11-26 23:03:35 +0100 |
| commit | 99a4e4f08abe253a7812e4872882a75cecd87703 (patch) | |
| tree | bcd5a20c7a94954588944656d2d08f4eb379e24e /include | |
| parent | 94529775135c301efff78373310102f47f3c8671 (diff) | |
drm/colorop: Add 1D Curve Custom LUT type
We've previously introduced DRM_COLOROP_1D_CURVE for
pre-defined 1D curves. But we also have HW that supports
custom curves and userspace needs the ability to pass
custom curves, aka LUTs.
This patch introduces a new colorop type, called
DRM_COLOROP_1D_LUT that provides a SIZE property which
is used by a driver to advertise the supported SIZE
of the LUT, as well as a DATA property which userspace
uses to set the LUT.
DATA and size function in the same way as current drm_crtc
GAMMA and DEGAMMA LUTs.
Reviewed-by: Simon Ser <contact@emersion.fr>
Signed-off-by: Alex Hung <alex.hung@amd.com>
Co-developed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Harry Wentland <harry.wentland@amd.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Signed-off-by: Simon Ser <contact@emersion.fr>
Link: https://patch.msgid.link/20251115000237.3561250-38-alex.hung@amd.com
Diffstat (limited to 'include')
| -rw-r--r-- | include/drm/drm_colorop.h | 16 | ||||
| -rw-r--r-- | include/uapi/drm/drm_mode.h | 14 |
2 files changed, 30 insertions, 0 deletions
diff --git a/include/drm/drm_colorop.h b/include/drm/drm_colorop.h index 067805276b15..529af9f8266d 100644 --- a/include/drm/drm_colorop.h +++ b/include/drm/drm_colorop.h @@ -258,6 +258,13 @@ struct drm_colorop { struct drm_property *bypass_property; /** + * @size: + * + * Number of entries of the custom LUT. This should be read-only. + */ + uint32_t size; + + /** * @curve_1d_type_property: * * Sub-type for DRM_COLOROP_1D_CURVE type. @@ -265,6 +272,13 @@ struct drm_colorop { struct drm_property *curve_1d_type_property; /** + * @size_property: + * + * Size property for custom LUT from userspace. + */ + struct drm_property *size_property; + + /** * @data_property: * * blob property for any TYPE that requires a blob of data, @@ -311,6 +325,8 @@ void drm_colorop_cleanup(struct drm_colorop *colorop); int drm_plane_colorop_curve_1d_init(struct drm_device *dev, struct drm_colorop *colorop, struct drm_plane *plane, u64 supported_tfs); +int drm_plane_colorop_curve_1d_lut_init(struct drm_device *dev, struct drm_colorop *colorop, + struct drm_plane *plane, uint32_t lut_size); int drm_plane_colorop_ctm_3x4_init(struct drm_device *dev, struct drm_colorop *colorop, struct drm_plane *plane); diff --git a/include/uapi/drm/drm_mode.h b/include/uapi/drm/drm_mode.h index 5e637ec7b64c..bec524e2fa32 100644 --- a/include/uapi/drm/drm_mode.h +++ b/include/uapi/drm/drm_mode.h @@ -903,6 +903,20 @@ enum drm_colorop_type { DRM_COLOROP_1D_CURVE, /** + * @DRM_COLOROP_1D_LUT: + * + * enum string "1D LUT" + * + * A simple 1D LUT of uniformly spaced &drm_color_lut32 entries, + * packed into a blob via the DATA property. The driver's + * expected LUT size is advertised via the SIZE property. + * + * The DATA blob is an array of struct drm_color_lut32 with size + * of "size". + */ + DRM_COLOROP_1D_LUT, + + /** * @DRM_COLOROP_CTM_3X4: * * enum string "3x4 Matrix" |
