Commit 76c97b0b authored by Eugen Hristev's avatar Eugen Hristev Committed by Mauro Carvalho Chehab

media: atmel: atmel-isc-base: add wb debug messages

Add debug messages that make it easier to debug white balance algorithm.
Signed-off-by: default avatarEugen Hristev <eugen.hristev@microchip.com>
Reviewed-by: default avatarJacopo Mondi <jacopo+renesas@jmondi.org>
Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@kernel.org>
parent 9780baa0
...@@ -1289,10 +1289,15 @@ static void isc_hist_count(struct isc_device *isc, u32 *min, u32 *max) ...@@ -1289,10 +1289,15 @@ static void isc_hist_count(struct isc_device *isc, u32 *min, u32 *max)
if (!*min) if (!*min)
*min = 1; *min = 1;
v4l2_dbg(1, debug, &isc->v4l2_dev,
"isc wb: hist_id %u, hist_count %u",
ctrls->hist_id, *hist_count);
} }
static void isc_wb_update(struct isc_ctrls *ctrls) static void isc_wb_update(struct isc_ctrls *ctrls)
{ {
struct isc_device *isc = container_of(ctrls, struct isc_device, ctrls);
u32 *hist_count = &ctrls->hist_count[0]; u32 *hist_count = &ctrls->hist_count[0];
u32 c, offset[4]; u32 c, offset[4];
u64 avg = 0; u64 avg = 0;
...@@ -1309,6 +1314,9 @@ static void isc_wb_update(struct isc_ctrls *ctrls) ...@@ -1309,6 +1314,9 @@ static void isc_wb_update(struct isc_ctrls *ctrls)
(u64)hist_count[ISC_HIS_CFG_MODE_GB]; (u64)hist_count[ISC_HIS_CFG_MODE_GB];
avg >>= 1; avg >>= 1;
v4l2_dbg(1, debug, &isc->v4l2_dev,
"isc wb: green components average %llu\n", avg);
/* Green histogram is null, nothing to do */ /* Green histogram is null, nothing to do */
if (!avg) if (!avg)
return; return;
...@@ -1361,9 +1369,15 @@ static void isc_wb_update(struct isc_ctrls *ctrls) ...@@ -1361,9 +1369,15 @@ static void isc_wb_update(struct isc_ctrls *ctrls)
else else
gw_gain[c] = 1 << 9; gw_gain[c] = 1 << 9;
v4l2_dbg(1, debug, &isc->v4l2_dev,
"isc wb: component %d, s_gain %u, gw_gain %u\n",
c, s_gain[c], gw_gain[c]);
/* multiply both gains and adjust for decimals */ /* multiply both gains and adjust for decimals */
ctrls->gain[c] = s_gain[c] * gw_gain[c]; ctrls->gain[c] = s_gain[c] * gw_gain[c];
ctrls->gain[c] >>= 9; ctrls->gain[c] >>= 9;
v4l2_dbg(1, debug, &isc->v4l2_dev,
"isc wb: component %d, final gain %u\n",
c, ctrls->gain[c]);
} }
} }
...@@ -1387,6 +1401,10 @@ static void isc_awb_work(struct work_struct *w) ...@@ -1387,6 +1401,10 @@ static void isc_awb_work(struct work_struct *w)
return; return;
isc_hist_count(isc, &min, &max); isc_hist_count(isc, &min, &max);
v4l2_dbg(1, debug, &isc->v4l2_dev,
"isc wb mode %d: hist min %u , max %u\n", hist_id, min, max);
ctrls->hist_minmax[hist_id][HIST_MIN_INDEX] = min; ctrls->hist_minmax[hist_id][HIST_MIN_INDEX] = min;
ctrls->hist_minmax[hist_id][HIST_MAX_INDEX] = max; ctrls->hist_minmax[hist_id][HIST_MAX_INDEX] = max;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment