On Fri, Jan 10, 2025 at 01:15:30AM +0530, Arun R Murthy wrote: > ImageEnhancemenT(IET) hardware interpolates the LUT value to generate > the enhanced output image. LUT takes an input value, outputs a new > value based on the data within the LUT. 1D LUT can remap individual > input values to new output values based on the LUT sample. LUT can be > interpolated by the hardware by multiple modes Ex: Direct Lookup LUT, > Multiplicative LUT etc > The list of supported mode by hardware along with the format(exponent > mantissa) is exposed to user by the iet_lut_caps property. Maximum > format being 8.24 i.e 8 exponent and 24 mantissa. > For illustration a hardware supporting 1.9 format denotes this as > 0x10001FF. In order to know the exponent do a bitwise AND with > 0xF000000. The LUT value to be provided by user would be a 10bit value > with 1 bit integer and 9 bit fractional value. > > Multiple formats can be supported, hence pointer is used over here. > User can then provide the LUT with any one of the supported modes in > any of the supported formats. > The entries in the LUT can vary depending on the hardware capability > with max being 255. This will also be exposed as iet_lut_caps so user > can generate a LUT with the specified entries. > > Signed-off-by: Arun R Murthy <arun.r.murthy@xxxxxxxxx> > --- > include/uapi/drm/drm_mode.h | 50 +++++++++++++++++++++++++++++++++++++++++++++ > 1 file changed, 50 insertions(+) > > diff --git a/include/uapi/drm/drm_mode.h b/include/uapi/drm/drm_mode.h > index 7a7039381142bb5dba269bdaec42c18be34e2d05..056c2efef1589848034afc0089f1838c2547bcf8 100644 > --- a/include/uapi/drm/drm_mode.h > +++ b/include/uapi/drm/drm_mode.h > @@ -1367,6 +1367,17 @@ struct drm_mode_closefb { > */ > #define DRM_MODE_HISTOGRAM_HSV_MAX_RGB (1 << 0) > > +/* LUT values are points on exponential graph with x axis and y-axis y=f(x) */ Huh? > +#define DRM_MODE_IET_LOOKUP_LUT (1 << 0) Again, what is the reason for a shift? Can these values be OR'd? > +/* > + * LUT values, points on negative exponential graph with x-axis and y-axis > + * y = y/x so upon multiplying x, y is obtained, hence multiplicative. The Can't parse this sentence. > + * format of LUT can at max be 8.24(8integer 24 fractional) represented by > + * u32. Depending on the hardware capability and exponent mantissa can be > + * chosen. What does that mean? How is it choosen? > + */ > +#define DRM_MODE_IET_MULTIPLICATIVE (1 << 1) > + > /** > * struct drm_histogram_caps > * > @@ -1414,6 +1425,45 @@ struct drm_histogram { > __u32 nr_elements; > }; > > +/** > + * struct drm_iet_caps > + * > + * @iet_mode: pixel factor enhancement modes defined in the above macros > + * @iet_sample_format: holds the address of an array of u32 LUT sample formats > + * depending on the hardware capability. Max being 8.24 > + * Doing a bitwise AND will get the present sample. > + * Ex: for 1 integer 9 fraction AND with 0x10001FF ?? Can hardware support 16.16? 32.0? > + * @nr_iet_sample_formats: number of iet_sample_formsts supported by the > + * hardware > + * @nr_iet_lut_entries: number of LUT entries > + */ > +struct drm_iet_caps { > + __u8 iet_mode; > + u64 iet_sample_format; > + __u32 nr_iet_sample_formats; > + __u32 nr_iet_lut_entries; > +}; > + > +/** > + * struct drm_iet_1dlut_sample Is it supposed to be used with DRM_MODE_IET_MULTIPLICATIVE only? Or is it supposed to be used with DRM_MODE_IET_LOOKUP_LUT? In the latter case what should be the iet_format value? > + * @iet_mode: image enhancement mode, this will also convey the channel. > + * @iet_format: LUT exponent and mantissa format, max being 8.24 > + * @data_ptr: pointer to the array of values which is of type u32. > + * 1 channel: 10 bit corrected value and remaining bits are reserved. > + * multi channel: pointer to struct drm_color_lut > + * @nr_elements: number of entries pointed by the data @data_ptr > + * @reserved: reserved for future use > + * @reserved1: reserved for future use > + */ > +struct drm_iet_1dlut_sample { > + __u8 iet_mode; > + __u32 iet_format; > + __u64 data_ptr; > + __u32 nr_elements; > + __u32 reserved; > + __u32 reserved1; > +}; > + > #if defined(__cplusplus) > } > #endif > > -- > 2.25.1 > -- With best wishes Dmitry