From: Chaitanya Kumar Borah <chaitanya.kumar.borah@xxxxxxxxx> Add support for color ops that can be programmed by 1 dimensional multi segmented Look Up Tables. Signed-off-by: Chaitanya Kumar Borah <chaitanya.kumar.borah@xxxxxxxxx> Signed-off-by: Uma Shankar <uma.shankar@xxxxxxxxx> --- drivers/gpu/drm/drm_atomic.c | 4 ++++ drivers/gpu/drm/drm_atomic_uapi.c | 3 +++ include/uapi/drm/drm_mode.h | 8 ++++++++ 3 files changed, 15 insertions(+) diff --git a/drivers/gpu/drm/drm_atomic.c b/drivers/gpu/drm/drm_atomic.c index 8a75f4a0637a..f344d64d42ce 100644 --- a/drivers/gpu/drm/drm_atomic.c +++ b/drivers/gpu/drm/drm_atomic.c @@ -802,6 +802,10 @@ static void drm_atomic_colorop_print_state(struct drm_printer *p, drm_printf(p, "\tinterpolation=%s\n", drm_get_colorop_lut1d_interpolation_name(colorop->lut1d_interpolation)); drm_printf(p, "\tdata blob id=%d\n", state->data ? state->data->base.id : 0); break; + case DRM_COLOROP_1D_LUT_MULTSEG: + drm_printf(p, "\thw cap blob id=%d\n", state->hw_caps ? state->hw_caps->base.id : 0); + drm_printf(p, "\tdata blob id=%d\n", state->data ? state->data->base.id : 0); + break; case DRM_COLOROP_CTM_3X3: drm_printf(p, "\tdata blob id=%d\n", state->data ? state->data->base.id : 0); break; diff --git a/drivers/gpu/drm/drm_atomic_uapi.c b/drivers/gpu/drm/drm_atomic_uapi.c index 46cc7b0df6e8..326159bff91c 100644 --- a/drivers/gpu/drm/drm_atomic_uapi.c +++ b/drivers/gpu/drm/drm_atomic_uapi.c @@ -720,6 +720,9 @@ static int drm_atomic_color_set_data_property(struct drm_colorop *colorop, size = modes[index].lut_stride[0] * modes[index].lut_stride[1] * modes[index].lut_stride[2] * sizeof(struct drm_color_lut); break; + case DRM_COLOROP_1D_LUT_MULTSEG: + elem_size = sizeof(struct drm_color_lut_32); + break; default: /* should never get here */ return -EINVAL; diff --git a/include/uapi/drm/drm_mode.h b/include/uapi/drm/drm_mode.h index 9ed8b1b1357a..d126a5410eea 100644 --- a/include/uapi/drm/drm_mode.h +++ b/include/uapi/drm/drm_mode.h @@ -923,6 +923,14 @@ enum drm_colorop_type { */ DRM_COLOROP_CTM_3X4, + /** + * @DRM_COLOROP_1D_LUT_MULTSEG: + * + * A 3x4 matrix. Its values are specified via the + * &drm_color_ctm_3x4 struct provided via the DATA property. + */ + DRM_COLOROP_1D_LUT_MULTSEG, + /** * @DRM_COLOROP_CTM_3X3: * -- 2.42.0