drm/colorop: Add 1D Curve subtype

Add a new drm_colorop with DRM_COLOROP_1D_CURVE with two subtypes:
DRM_COLOROP_1D_CURVE_SRGB_EOTF and DRM_COLOROP_1D_CURVE_SRGB_INV_EOTF.

Reviewed-by: Simon Ser <contact@emersion.fr>
Reviewed-by: Louis Chauvet <louis.chauvet@bootlin.com>
Signed-off-by: Harry Wentland <harry.wentland@amd.com>
Co-developed-by: Alex Hung <alex.hung@amd.com>
Signed-off-by: Alex Hung <alex.hung@amd.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Melissa Wen <mwen@igalia.com>
Reviewed-by: Sebastian Wick <sebastian.wick@redhat.com>
Signed-off-by: Simon Ser <contact@emersion.fr>
Link: https://patch.msgid.link/20251115000237.3561250-7-alex.hung@amd.com
This commit is contained in:
Harry Wentland
2025-11-14 17:01:31 -07:00
committed by Simon Ser
parent 84423e5612
commit 41651f9d42
3 changed files with 207 additions and 4 deletions

View File

@@ -655,10 +655,17 @@ static int drm_atomic_colorop_set_property(struct drm_colorop *colorop,
struct drm_property *property,
uint64_t val)
{
drm_dbg_atomic(colorop->dev,
"[COLOROP:%d] unknown property [PROP:%d:%s]]\n",
colorop->base.id, property->base.id, property->name);
return -EINVAL;
if (property == colorop->curve_1d_type_property) {
state->curve_1d_type = val;
} else {
drm_dbg_atomic(colorop->dev,
"[COLOROP:%d:%d] unknown property [PROP:%d:%s]\n",
colorop->base.id, colorop->type,
property->base.id, property->name);
return -EINVAL;
}
return 0;
}
static int
@@ -668,6 +675,8 @@ drm_atomic_colorop_get_property(struct drm_colorop *colorop,
{
if (property == colorop->type_property)
*val = colorop->type;
else if (property == colorop->curve_1d_type_property)
*val = state->curve_1d_type;
else
return -EINVAL;