Skip to content

Commit

Permalink
drivers/video/isx019: Clear clip setting in unnecessary cases
Browse files Browse the repository at this point in the history
In QVGA or QQVGA cases, FPGA clip setting "clip 1280x720" or "clip 640x360"
may cause the delay of data transmission and error detection in applications.
  • Loading branch information
SPRESENSE committed Apr 27, 2022
1 parent f674317 commit 6f03449
Showing 1 changed file with 28 additions and 25 deletions.
53 changes: 28 additions & 25 deletions drivers/video/isx019.c
Original file line number Diff line number Diff line change
Expand Up @@ -1446,7 +1446,7 @@ static int activate_clip(imgsensor_stream_type_t type,

break;

default: /* 640 */
case 640:
if (clip->width == 640)
{
/* In this case, clip->height == 360 */
Expand Down Expand Up @@ -1474,6 +1474,12 @@ static int activate_clip(imgsensor_stream_type_t type,
}

break;

default: /* Otherwise, clear clip setting. */
size = FPGA_CLIP_NON;
top = 0;
left = 0;
break;
}

fpga_i2c_write(FPGA_CLIP_SIZE, &size, 1);
Expand Down Expand Up @@ -1535,30 +1541,27 @@ static int isx019_start_capture(imgsensor_stream_type_t type,
}

switch (fmt[IMGSENSOR_FMT_MAIN].width)
{
case 1280:
regval |= FPGA_SCALE_1280_960;
activate_clip(type,
fmt[IMGSENSOR_FMT_MAIN].width,
fmt[IMGSENSOR_FMT_MAIN].height);
break;

case 640:
regval |= FPGA_SCALE_640_480;
activate_clip(type,
fmt[IMGSENSOR_FMT_MAIN].width,
fmt[IMGSENSOR_FMT_MAIN].height);
break;

case 320:
regval |= FPGA_SCALE_320_240;
break;

default: /* 160 */

regval |= FPGA_SCALE_160_120;
break;
}
{
case 1280:
regval |= FPGA_SCALE_1280_960;
break;

case 640:
regval |= FPGA_SCALE_640_480;
break;

case 320:
regval |= FPGA_SCALE_320_240;
break;

default: /* 160 */
regval |= FPGA_SCALE_160_120;
break;
}

activate_clip(type,
fmt[IMGSENSOR_FMT_MAIN].width,
fmt[IMGSENSOR_FMT_MAIN].height);

fpga_i2c_write(FPGA_FORMAT_AND_SCALE, &regval, 1);

Expand Down

0 comments on commit 6f03449

Please sign in to comment.