Add capability property which a colorop can expose it's hardware's abilities. It's a blob property that can be filled with respective data structures depending on the colorop. The user space is expected to read this property and program the colorop accordingly. v2: Added documentation for hw_caps blob (Dmitry) Signed-off-by: Uma Shankar <uma.shankar@xxxxxxxxx> Signed-off-by: Chaitanya Kumar Borah <chaitanya.kumar.borah@xxxxxxxxx> --- drivers/gpu/drm/drm_atomic_uapi.c | 3 +++ include/drm/drm_colorop.h | 17 +++++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/drivers/gpu/drm/drm_atomic_uapi.c b/drivers/gpu/drm/drm_atomic_uapi.c index 8258558ff334..b469f0ee9a25 100644 --- a/drivers/gpu/drm/drm_atomic_uapi.c +++ b/drivers/gpu/drm/drm_atomic_uapi.c @@ -771,6 +771,9 @@ drm_atomic_colorop_get_property(struct drm_colorop *colorop, *val = colorop->lut3d_interpolation; } else if (property == colorop->data_property) { *val = (state->data) ? state->data->base.id : 0; + } else if (property == colorop->hw_caps_property) { + *val = state->hw_caps ? + state->hw_caps->base.id : 0; } else { return -EINVAL; } diff --git a/include/drm/drm_colorop.h b/include/drm/drm_colorop.h index 1cd8ce81224e..731bd1484c34 100644 --- a/include/drm/drm_colorop.h +++ b/include/drm/drm_colorop.h @@ -141,6 +141,16 @@ struct drm_colorop_state { */ uint64_t multiplier; + /** + * @hw_caps: + * + * This blob will be of type struct drm_color_lut_range which contains the + * hardware capabilities of 1D LUT. These include number of LUT segments, + * number of LUT samples per segment, start and end point of respective + * segments and the precision of the LUT sample along with the normalization factor + */ + struct drm_property_blob *hw_caps; + /** * @data: * @@ -309,6 +319,13 @@ struct drm_colorop { */ struct drm_property *curve_1d_type_property; + /** + * @hw_caps_property: + * + * Property to expose hardware lut capabilities. + */ + struct drm_property *hw_caps_property; + /** * @multiplier_property: * -- 2.42.0