media: staging: rkisp1 stats: set a measure flag with '|=' instead of '='
Subsystems (3)
PATCH 1/2 media: staging: rkisp1 stats: set a measure flag with '|=' instead of '='
The flag RKISP1_CIF_ISP_STAT_AFM_FIN that indicates a type of statistics is mistakenly set with '=' instead of '|=' this might set off previous flags.
--- drivers/staging/media/rkisp1/rkisp1-stats.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/media/rkisp1/rkisp1-stats.c +1 -1
@@ -253,7 +253,7 @@ static void rkisp1_stats_get_afc_meas(struct rkisp1_stats *stats,struct rkisp1_device *rkisp1 = stats->rkisp1;struct rkisp1_cif_isp_af_stat *af; - pbuf->meas_type =RKISP1_CIF_ISP_STAT_AFM_FIN ; + pbuf->meas_type |=RKISP1_CIF_ISP_STAT_AFM_FIN ; af = &pbuf->params.af; af->window[0 ].sum =rkisp1_read (rkisp1,RKISP1_CIF_ISP_AFM_SUM_A );
Signature · 1 line
2.17.1
PATCH 2/2 media: staging: rkisp1: stats: don't set stats flags in rkisp1_stats_send_measurement
The flags that indicate which statistics are read are already set in the functions that read them so there is no need to set them in the function rkisp1_stats_send_measurement.
--- drivers/staging/media/rkisp1/rkisp1-stats.c | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-)
drivers/staging/media/rkisp1/rkisp1-stats.c +3 -10
@@ -356,26 +356,19 @@ rkisp1_stats_send_measurement(struct rkisp1_stats *stats, cur_stat_buf = (struct rkisp1_stat_buffer *)(cur_buf->vaddr[0 ]); -if (meas_work->isp_ris &RKISP1_CIF_ISP_AWB_DONE ) { +if (meas_work->isp_ris &RKISP1_CIF_ISP_AWB_DONE )rkisp1_stats_get_awb_meas (stats, cur_stat_buf); - cur_stat_buf->meas_type |=RKISP1_CIF_ISP_STAT_AWB ; - } -if (meas_work->isp_ris &RKISP1_CIF_ISP_AFM_FIN ) { +if (meas_work->isp_ris &RKISP1_CIF_ISP_AFM_FIN )rkisp1_stats_get_afc_meas (stats, cur_stat_buf); - cur_stat_buf->meas_type |=RKISP1_CIF_ISP_STAT_AFM_FIN ; - }if (meas_work->isp_ris &RKISP1_CIF_ISP_EXP_END ) {rkisp1_stats_get_aec_meas (stats, cur_stat_buf);rkisp1_stats_get_bls_meas (stats, cur_stat_buf); - cur_stat_buf->meas_type |=RKISP1_CIF_ISP_STAT_AUTOEXP ; } -if (meas_work->isp_ris &RKISP1_CIF_ISP_HIST_MEASURE_RDY ) { +if (meas_work->isp_ris &RKISP1_CIF_ISP_HIST_MEASURE_RDY )rkisp1_stats_get_hst_meas (stats, cur_stat_buf); - cur_stat_buf->meas_type |=RKISP1_CIF_ISP_STAT_HIST ; - }vb2_set_plane_payload (&cur_buf->vb.vb2_buf,0 ,sizeof (struct rkisp1_stat_buffer ));
Signature · 1 line
2.17.1
Re: [PATCH 2/2] media: staging: rkisp1: stats: don't set stats flags in rkisp1_stats_send_measurement
Quoted 5 lines · Dafna Hirschfeld
The flags that indicate which statistics are read are already set in the functions that read them so there is no need to set them in the function
rkisp1_stats_send_measurement.Signed-off-by Dafna Hirschfeld <[email protected]>
Thanks
Helen
Quoted 39 lines
--- drivers/staging/media/rkisp1/rkisp1-stats.c | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-)drivers/staging/media/rkisp1/rkisp1-stats.c +3
-10@@ -356,26 +356,19 @@ rkisp1_stats_send_measurement(struct rkisp1_stats *stats, cur_stat_buf = (struct rkisp1_stat_buffer *)(cur_buf->vaddr[0 ]); -if (meas_work->isp_ris &RKISP1_CIF_ISP_AWB_DONE ) { +if (meas_work->isp_ris &RKISP1_CIF_ISP_AWB_DONE )rkisp1_stats_get_awb_meas (stats, cur_stat_buf); - cur_stat_buf->meas_type |=RKISP1_CIF_ISP_STAT_AWB ; - } -if (meas_work->isp_ris &RKISP1_CIF_ISP_AFM_FIN ) { +if (meas_work->isp_ris &RKISP1_CIF_ISP_AFM_FIN )rkisp1_stats_get_afc_meas (stats, cur_stat_buf); - cur_stat_buf->meas_type |=RKISP1_CIF_ISP_STAT_AFM_FIN ; - }if (meas_work->isp_ris &RKISP1_CIF_ISP_EXP_END ) {rkisp1_stats_get_aec_meas (stats, cur_stat_buf);rkisp1_stats_get_bls_meas (stats, cur_stat_buf); - cur_stat_buf->meas_type |=RKISP1_CIF_ISP_STAT_AUTOEXP ; } -if (meas_work->isp_ris &RKISP1_CIF_ISP_HIST_MEASURE_RDY ) { +if (meas_work->isp_ris &RKISP1_CIF_ISP_HIST_MEASURE_RDY )rkisp1_stats_get_hst_meas (stats, cur_stat_buf); - cur_stat_buf->meas_type |=RKISP1_CIF_ISP_STAT_HIST ; - }vb2_set_plane_payload (&cur_buf->vb.vb2_buf,0 ,sizeof (struct rkisp1_stat_buffer ));
Re: [PATCH 2/2] media: staging: rkisp1: stats: don't set stats flags in rkisp1_stats_send_measurement
In reply to Dafna HirschfeldHi Dafna,
Thank you for the patch.
Quoted 5 lines · Dafna Hirschfeld
The flags that indicate which statistics are read are already set in the functions that read them so there is no need to set them in the function
rkisp1_stats_send_measurement.Signed-off-by Dafna Hirschfeld <[email protected]>
Quoted 38 lines
--- drivers/staging/media/rkisp1/rkisp1-stats.c | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-)drivers/staging/media/rkisp1/rkisp1-stats.c +3
-10@@ -356,26 +356,19 @@ rkisp1_stats_send_measurement(struct rkisp1_stats *stats, cur_stat_buf = (struct rkisp1_stat_buffer *)(cur_buf->vaddr[0 ]); -if (meas_work->isp_ris &RKISP1_CIF_ISP_AWB_DONE ) { +if (meas_work->isp_ris &RKISP1_CIF_ISP_AWB_DONE )rkisp1_stats_get_awb_meas (stats, cur_stat_buf); - cur_stat_buf->meas_type |=RKISP1_CIF_ISP_STAT_AWB ; - } -if (meas_work->isp_ris &RKISP1_CIF_ISP_AFM_FIN ) { +if (meas_work->isp_ris &RKISP1_CIF_ISP_AFM_FIN )rkisp1_stats_get_afc_meas (stats, cur_stat_buf); - cur_stat_buf->meas_type |=RKISP1_CIF_ISP_STAT_AFM_FIN ; - }if (meas_work->isp_ris &RKISP1_CIF_ISP_EXP_END ) {rkisp1_stats_get_aec_meas (stats, cur_stat_buf);rkisp1_stats_get_bls_meas (stats, cur_stat_buf); - cur_stat_buf->meas_type |=RKISP1_CIF_ISP_STAT_AUTOEXP ; } -if (meas_work->isp_ris &RKISP1_CIF_ISP_HIST_MEASURE_RDY ) { +if (meas_work->isp_ris &RKISP1_CIF_ISP_HIST_MEASURE_RDY )rkisp1_stats_get_hst_meas (stats, cur_stat_buf); - cur_stat_buf->meas_type |=RKISP1_CIF_ISP_STAT_HIST ; - }vb2_set_plane_payload (&cur_buf->vb.vb2_buf,0 ,sizeof (struct rkisp1_stat_buffer ));
Signature · 3 lines
Regards, Laurent Pinchart
Re: [PATCH 2/2] media: staging: rkisp1: stats: don't set stats flags in rkisp1_stats_send_measurement
In reply to Dafna HirschfeldQuoted 15 lines · Dafna Hirschfeld
The flags that indicate which statistics are read are already set in the functions that read them so there is no need to set them in the function
rkisp1_stats_send_measurement.--- drivers/staging/media/rkisp1/rkisp1-stats.c | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-)drivers/staging/media/rkisp1/rkisp1-stats.c +0
-0
drivers/staging/media/rkisp1/rkisp1-stats.c rkisp1_stats_send_measurement(struct rkisp1_stats *stats, · line 358
Quoted 3 lines
drivers/staging/media/rkisp1/rkisp1-stats.c +0
-0@@ -356,26 +356,19 @@ rkisp1_stats_send_measurement(struct rkisp1_stats *stats, cur_stat_buf = (struct rkisp1_stat_buffer *)(cur_buf->vaddr[0 ]);
Should we perhaps also set cur_stat_buf->meas_type to 0 here?
drivers/staging/media/rkisp1/rkisp1-stats.c rkisp1_stats_send_measurement(struct rkisp1_stats *stats, · line 361
Quoted 4 lines
drivers/staging/media/rkisp1/rkisp1-stats.c +1
-2-if (meas_work->isp_ris &RKISP1_CIF_ISP_AWB_DONE ) { +if (meas_work->isp_ris &RKISP1_CIF_ISP_AWB_DONE )rkisp1_stats_get_awb_meas (stats, cur_stat_buf); - cur_stat_buf->meas_type |=RKISP1_CIF_ISP_STAT_AWB ;
I wonder if it wouldn't be cleaner if this function took care of meas_type, rather than sprinkling it all over the measurement collection functions.
Quoted 25 lines
drivers/staging/media/rkisp1/rkisp1-stats.c +2
-9- } -if (meas_work->isp_ris &RKISP1_CIF_ISP_AFM_FIN ) { +if (meas_work->isp_ris &RKISP1_CIF_ISP_AFM_FIN )rkisp1_stats_get_afc_meas (stats, cur_stat_buf); - cur_stat_buf->meas_type |=RKISP1_CIF_ISP_STAT_AFM_FIN ; - }if (meas_work->isp_ris &RKISP1_CIF_ISP_EXP_END ) {rkisp1_stats_get_aec_meas (stats, cur_stat_buf);rkisp1_stats_get_bls_meas (stats, cur_stat_buf); - cur_stat_buf->meas_type |=RKISP1_CIF_ISP_STAT_AUTOEXP ; } -if (meas_work->isp_ris &RKISP1_CIF_ISP_HIST_MEASURE_RDY ) { +if (meas_work->isp_ris &RKISP1_CIF_ISP_HIST_MEASURE_RDY )rkisp1_stats_get_hst_meas (stats, cur_stat_buf); - cur_stat_buf->meas_type |=RKISP1_CIF_ISP_STAT_HIST ; - }vb2_set_plane_payload (&cur_buf->vb.vb2_buf,0 ,sizeof (struct rkisp1_stat_buffer )); --2.17.1
Hi Dafna,
Thanks for the patch.
Quoted 14 lines · Dafna Hirschfeld
The flag
RKISP1_CIF_ISP_STAT_AFM_FINthat indicates a type of statistics is mistakenly set with '=' instead of '|=' this might set off previous flags.Signed-off-by Dafna Hirschfeld <[email protected]>--- drivers/staging/media/rkisp1/rkisp1-stats.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/staging/media/rkisp1/rkisp1-stats.c +0
-0
drivers/staging/media/rkisp1/rkisp1-stats.c static void rkisp1_stats_get_afc_meas(struct rkisp1_stats *stats, · line 256
Quoted 5 lines
drivers/staging/media/rkisp1/rkisp1-stats.c +1
-1@@ -253,7 +253,7 @@ static void rkisp1_stats_get_afc_meas(struct rkisp1_stats *stats,struct rkisp1_device *rkisp1 = stats->rkisp1;struct rkisp1_cif_isp_af_stat *af; - pbuf->meas_type =RKISP1_CIF_ISP_STAT_AFM_FIN ; + pbuf->meas_type |=RKISP1_CIF_ISP_STAT_AFM_FIN ;
It seems there is a redundancy, the place that calls this function already sets this bit. It seems there is a similar issue in all rkisp1_stats_get_* functions.
Could you please check and do the proper cleanup?
Thanks
Helen
Quoted 4 lines
drivers/staging/media/rkisp1/rkisp1-stats.c +0
-0af = &pbuf->params.af; af->window[0 ].sum =rkisp1_read (rkisp1,RKISP1_CIF_ISP_AFM_SUM_A );
Helen Koike
Acked-byQuoted 22 lines · Helen Koike
Hi Dafna,
Thanks for the patch.
Quoted 17 lines · Dafna Hirschfeld
The flag
RKISP1_CIF_ISP_STAT_AFM_FINthat indicates a type of statistics is mistakenly set with '=' instead of '|=' this might set off previous flags.Signed-off-by Dafna Hirschfeld <[email protected]>--- drivers/staging/media/rkisp1/rkisp1-stats.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/staging/media/rkisp1/rkisp1-stats.c +0
-0@@ -253,7 +253,7 @@ static void rkisp1_stats_get_afc_meas(struct rkisp1_stats *stats,struct rkisp1_device *rkisp1 = stats->rkisp1;struct rkisp1_cif_isp_af_stat *af;
Quoted 7 lines
drivers/staging/media/rkisp1/rkisp1-stats.c static void rkisp1_stats_get_afc_meas(struct rkisp1_stats *stats, · line 256
Quoted 2 lines
drivers/staging/media/rkisp1/rkisp1-stats.c +1
-1- pbuf->meas_type =RKISP1_CIF_ISP_STAT_AFM_FIN ; + pbuf->meas_type |=RKISP1_CIF_ISP_STAT_AFM_FIN ;It seems there is a redundancy, the place that calls this function already sets this bit. It seems there is a similar issue in all rkisp1_stats_get_* functions.
Could you please check and do the proper cleanup?
Please ignore my comment, for some reason I didn't see the second patch.
Thanks
Helen
Quoted 8 lines
Thanks
HelenQuoted 4 lines
drivers/staging/media/rkisp1/rkisp1-stats.c +0
-0af = &pbuf->params.af; af->window[0 ].sum =rkisp1_read (rkisp1,RKISP1_CIF_ISP_AFM_SUM_A );
Hi Dafna,
Thank you for the patch.
Quoted 5 lines · Dafna Hirschfeld
The flag
RKISP1_CIF_ISP_STAT_AFM_FINthat indicates a type of statistics is mistakenly set with '=' instead of '|=' this might set off previous flags.Signed-off-by Dafna Hirschfeld <[email protected]>
Quoted 17 lines
--- drivers/staging/media/rkisp1/rkisp1-stats.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/staging/media/rkisp1/rkisp1-stats.c +1
-1@@ -253,7 +253,7 @@ static void rkisp1_stats_get_afc_meas(struct rkisp1_stats *stats,struct rkisp1_device *rkisp1 = stats->rkisp1;struct rkisp1_cif_isp_af_stat *af; - pbuf->meas_type =RKISP1_CIF_ISP_STAT_AFM_FIN ; + pbuf->meas_type |=RKISP1_CIF_ISP_STAT_AFM_FIN ; af = &pbuf->params.af; af->window[0 ].sum =rkisp1_read (rkisp1,RKISP1_CIF_ISP_AFM_SUM_A );
Signature · 3 lines
Regards, Laurent Pinchart