@@ -75,6 +75,90 @@ static void displayGD(struct ipu3_uapi_bnr_static_config_green_disparity *gd)
gd->gd_central_weight);
}
+static void displayShdGrid(struct ipu3_uapi_shd_grid_config *grid, const char *gridName)
+{
+ fprintf(stderr, "Configured %s grid [%d,%d]x[%d,%d] starting at (%d, %d)\n",
+ gridName,
+ grid->width,
+ grid->block_width_log2,
+ grid->height,
+ grid->block_height_log2,
+ grid->x_start,
+ grid->y_start & ~IPU3_UAPI_GRID_Y_START_EN);
+ fprintf(stderr, "Grid size is (%d x %d)\n",
+ grid->width << grid->block_width_log2,
+ grid->height << grid->block_height_log2);
+}
+
+static void displayShdConfig(struct ipu3_uapi_params *params)
+{
+ struct ipu3_uapi_shd_general_config shdConfig = params->acc_param.shd.shd.general;
+ fprintf(stderr, "Shading general config\n");
+ fprintf(stderr, "Vertical offset (init_set_vrt_offst_ul): %u\n", shdConfig.init_set_vrt_offst_ul);
+ fprintf(stderr, "Shd flag (shd_enable): %s\n", shdConfig.shd_enable ? "enabled" : "disabled");
+ fprintf(stderr, "Gain factor (gain_factor): %u\n", shdConfig.gain_factor);
+}
+
+static void displayShdLutGr(struct ipu3_uapi_params *params)
+{
+ struct ipu3_uapi_shd_lut shdLut = params->acc_param.shd.shd_lut;
+ for (unsigned int height = 0; height < params->acc_param.shd.shd.grid.height / 2; height++) {
+ fprintf(stderr, "\n");
+ for (unsigned int width = 0; width < params->acc_param.shd.shd.grid.width; width++) {
+ fprintf(stderr, "%d,", shdLut.sets[height].r_and_gr[width].gr);
+ }
+ fprintf(stderr, "\n");
+ for (unsigned int width = 0; width < params->acc_param.shd.shd.grid.width; width++) {
+ fprintf(stderr, "%d,", shdLut.sets[height].r_and_gr[params->acc_param.shd.shd.grid.width + width].gr);
+ }
+ }
+}
+
+static void displayShdLutR(struct ipu3_uapi_params *params)
+{
+ struct ipu3_uapi_shd_lut shdLut = params->acc_param.shd.shd_lut;
+ for (unsigned int height = 0; height < params->acc_param.shd.shd.grid.height / 2; height++) {
+ fprintf(stderr, "\n");
+ for (unsigned int width = 0; width < params->acc_param.shd.shd.grid.width; width++) {
+ fprintf(stderr, "%d,", shdLut.sets[height].r_and_gr[width].r);
+ }
+ fprintf(stderr, "\n");
+ for (unsigned int width = 0; width < params->acc_param.shd.shd.grid.width; width++) {
+ fprintf(stderr, "%d,", shdLut.sets[height].r_and_gr[params->acc_param.shd.shd.grid.width + width].r);
+ }
+ }
+}
+
+static void displayShdLutGb(struct ipu3_uapi_params *params)
+{
+ struct ipu3_uapi_shd_lut shdLut = params->acc_param.shd.shd_lut;
+ for (unsigned int height = 0; height < params->acc_param.shd.shd.grid.height / 2; height++) {
+ fprintf(stderr, "\n");
+ for (unsigned int width = 0; width < params->acc_param.shd.shd.grid.width; width++) {
+ fprintf(stderr, "%d,", shdLut.sets[height].gb_and_b[width].gb);
+ }
+ fprintf(stderr, "\n");
+ for (unsigned int width = 0; width < params->acc_param.shd.shd.grid.width; width++) {
+ fprintf(stderr, "%d,", shdLut.sets[height].gb_and_b[params->acc_param.shd.shd.grid.width + width].gb);
+ }
+ }
+}
+
+static void displayShdLutB(struct ipu3_uapi_params *params)
+{
+ struct ipu3_uapi_shd_lut shdLut = params->acc_param.shd.shd_lut;
+ for (unsigned int height = 0; height < params->acc_param.shd.shd.grid.height / 2; height++) {
+ fprintf(stderr, "\n");
+ for (unsigned int width = 0; width < params->acc_param.shd.shd.grid.width; width++) {
+ fprintf(stderr, "%d,", shdLut.sets[height].gb_and_b[width].b);
+ }
+ fprintf(stderr, "\n");
+ for (unsigned int width = 0; width < params->acc_param.shd.shd.grid.width; width++) {
+ fprintf(stderr, "%d,", shdLut.sets[height].gb_and_b[params->acc_param.shd.shd.grid.width + width].b);
+ }
+ }
+}
+
int main(int argc, char *argv[])
{
int in_fd;
@@ -118,6 +202,20 @@ start:
displayGD(¶ms.acc_param.green_disparity);
}
+ if (params.use.acc_shd) {
+ fprintf(stderr, "\n**** Lens shading parameters ****\n");
+ displayShdGrid(¶ms.acc_param.shd.shd.grid, "shd");
+ displayShdConfig(¶ms);
+ fprintf(stderr, "\n** Lens shading LUT for Gr **");
+ displayShdLutGr(¶ms);
+ fprintf(stderr, "\n** Lens shading LUT for R **");
+ displayShdLutR(¶ms);
+ fprintf(stderr, "\n** Lens shading LUT for Gb **");
+ displayShdLutGb(¶ms);
+ fprintf(stderr, "\n** Lens shading LUT for B **");
+ displayShdLutB(¶ms);
+ }
+
close(in_fd);
return ret ? 1 : 0;
The sensor lens shading can be corrected, and this is controlled with the ipu3_uapi_shd_config structure. Display the configuration followed by the look-up tables for each of the 4 channels. Signed-off-by: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com> --- utils/ipu3/ipu3-dump-params.c | 98 +++++++++++++++++++++++++++++++++++ 1 file changed, 98 insertions(+)