mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf.git
synced 2026-04-18 06:34:27 -04:00
drm/colorop: Add 3D LUT support to color pipeline
It is to be used to enable HDR by allowing userpace to create and pass 3D LUTs to kernel and hardware. new drm_colorop_type: DRM_COLOROP_3D_LUT. Reviewed-by: Simon Ser <contact@emersion.fr> 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-46-alex.hung@amd.com
This commit is contained in:
@@ -705,6 +705,10 @@ static int drm_atomic_color_set_data_property(struct drm_colorop *colorop,
|
||||
case DRM_COLOROP_CTM_3X4:
|
||||
size = sizeof(struct drm_color_ctm_3x4);
|
||||
break;
|
||||
case DRM_COLOROP_3D_LUT:
|
||||
size = colorop->size * colorop->size * colorop->size *
|
||||
sizeof(struct drm_color_lut32);
|
||||
break;
|
||||
default:
|
||||
/* should never get here */
|
||||
return -EINVAL;
|
||||
@@ -732,6 +736,8 @@ static int drm_atomic_colorop_set_property(struct drm_colorop *colorop,
|
||||
state->curve_1d_type = val;
|
||||
} else if (property == colorop->multiplier_property) {
|
||||
state->multiplier = val;
|
||||
} else if (property == colorop->lut3d_interpolation_property) {
|
||||
colorop->lut3d_interpolation = val;
|
||||
} else if (property == colorop->data_property) {
|
||||
return drm_atomic_color_set_data_property(colorop, state,
|
||||
property, val);
|
||||
@@ -763,6 +769,8 @@ drm_atomic_colorop_get_property(struct drm_colorop *colorop,
|
||||
*val = state->multiplier;
|
||||
else if (property == colorop->size_property)
|
||||
*val = colorop->size;
|
||||
else if (property == colorop->lut3d_interpolation_property)
|
||||
*val = colorop->lut3d_interpolation;
|
||||
else if (property == colorop->data_property)
|
||||
*val = (state->data) ? state->data->base.id : 0;
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user