Skip to content

Commit 0e0e32b

Browse files
Stefan Klugkbingham
Stefan Klug
authored andcommitted
ipa: rkisp1: algorithms: agc: Check for correct stats type
Sometimes the ISP produces statistics only with a subset of statistic types being valid. It doesn't happen normally, but was observed in the wild. Check for the RKISP1_CIF_ISP_STAT_AUTOEXP bit to prevent using invalid or outdated data. As it doesn't happen regularly add an error message to get notified when it happens. Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
1 parent c8d2616 commit 0e0e32b

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/ipa/rkisp1/algorithms/agc.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -402,6 +402,12 @@ void Agc::process(IPAContext &context, [[maybe_unused]] const uint32_t frame,
402402
fillMetadata(context, frameContext, metadata);
403403
return;
404404
}
405+
406+
if (!(stats->meas_type & RKISP1_CIF_ISP_STAT_AUTOEXP)) {
407+
fillMetadata(context, frameContext, metadata);
408+
LOG(RkISP1Agc, Error) << "AUTOEXP data is missing in statistics";
409+
return;
410+
}
405411

406412
/*
407413
* \todo Verify that the exposure and gain applied by the sensor for
@@ -412,7 +418,6 @@ void Agc::process(IPAContext &context, [[maybe_unused]] const uint32_t frame,
412418
*/
413419

414420
const rkisp1_cif_isp_stat *params = &stats->params;
415-
ASSERT(stats->meas_type & RKISP1_CIF_ISP_STAT_AUTOEXP);
416421

417422
/* The lower 4 bits are fractional and meant to be discarded. */
418423
Histogram hist({ params->hist.hist_bins, context.hw->numHistogramBins },

0 commit comments

Comments
 (0)