]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
media: staging: rkisp1: call params isr only upon frame out
authorDafna Hirschfeld <dafna.hirschfeld@collabora.com>
Sat, 15 Aug 2020 10:37:21 +0000 (12:37 +0200)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Sat, 29 Aug 2020 06:31:55 +0000 (08:31 +0200)
Currently the params isr is called and then returned when
isp-frame interrupt is not set. This condition is already
tested in the isp's isr so move the call under the condition
in the isp's isr.

Signed-off-by: Dafna Hirschfeld <dafna.hirschfeld@collabora.com>
Acked-by: Helen Koike <helen.koike@collabora.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
drivers/staging/media/rkisp1/rkisp1-common.h
drivers/staging/media/rkisp1/rkisp1-isp.c
drivers/staging/media/rkisp1/rkisp1-params.c

index e6b60244c35633437e786051a651c168be3fbf09..992d8ec4c4484bbf1169b94f7cc8eafcdb13e626 100644 (file)
@@ -460,7 +460,7 @@ void rkisp1_isp_isr(struct rkisp1_device *rkisp1);
 void rkisp1_mipi_isr(struct rkisp1_device *rkisp1);
 void rkisp1_capture_isr(struct rkisp1_device *rkisp1);
 void rkisp1_stats_isr(struct rkisp1_stats *stats, u32 isp_ris);
-void rkisp1_params_isr(struct rkisp1_device *rkisp1, u32 isp_mis);
+void rkisp1_params_isr(struct rkisp1_device *rkisp1);
 
 /* register/unregisters functions of the entities */
 int rkisp1_capture_devs_register(struct rkisp1_device *rkisp1);
index 7b40f53fde9aa1826e18b9413aa1b5828dda1981..02eafea92863f951305849e7a0a7195796ba8903 100644 (file)
@@ -1140,12 +1140,12 @@ void rkisp1_isp_isr(struct rkisp1_device *rkisp1)
                isp_ris = rkisp1_read(rkisp1, RKISP1_CIF_ISP_RIS);
                if (isp_ris & RKISP1_STATS_MEAS_MASK)
                        rkisp1_stats_isr(&rkisp1->stats, isp_ris);
+               /*
+                * Then update changed configs. Some of them involve
+                * lot of register writes. Do those only one per frame.
+                * Do the updates in the order of the processing flow.
+                */
+               rkisp1_params_isr(rkisp1);
        }
 
-       /*
-        * Then update changed configs. Some of them involve
-        * lot of register writes. Do those only one per frame.
-        * Do the updates in the order of the processing flow.
-        */
-       rkisp1_params_isr(rkisp1, status);
 }
index ce58196cbc91d69cae5c5192e5a708a3782d7ea5..fd870b6ae7078352cbe76e49ef98e3e2e3c66dd3 100644 (file)
@@ -1185,12 +1185,13 @@ static void rkisp1_isp_isr_meas_config(struct rkisp1_params *params,
        }
 }
 
-void rkisp1_params_isr(struct rkisp1_device *rkisp1, u32 isp_mis)
+void rkisp1_params_isr(struct rkisp1_device *rkisp1)
 {
        unsigned int frame_sequence = atomic_read(&rkisp1->isp.frame_sequence);
        struct rkisp1_params *params = &rkisp1->params;
        struct rkisp1_params_cfg *new_params;
        struct rkisp1_buffer *cur_buf = NULL;
+       u32 isp_ctrl;
 
        spin_lock(&params->config_lock);
        if (!params->is_streaming) {
@@ -1209,24 +1210,20 @@ void rkisp1_params_isr(struct rkisp1_device *rkisp1, u32 isp_mis)
 
        new_params = (struct rkisp1_params_cfg *)(cur_buf->vaddr);
 
-       if (isp_mis & RKISP1_CIF_ISP_FRAME) {
-               u32 isp_ctrl;
+       rkisp1_isp_isr_other_config(params, new_params);
+       rkisp1_isp_isr_meas_config(params, new_params);
 
-               rkisp1_isp_isr_other_config(params, new_params);
-               rkisp1_isp_isr_meas_config(params, new_params);
+       /* update shadow register immediately */
+       isp_ctrl = rkisp1_read(params->rkisp1, RKISP1_CIF_ISP_CTRL);
+       isp_ctrl |= RKISP1_CIF_ISP_CTRL_ISP_CFG_UPD;
+       rkisp1_write(params->rkisp1, isp_ctrl, RKISP1_CIF_ISP_CTRL);
 
-               /* update shadow register immediately */
-               isp_ctrl = rkisp1_read(params->rkisp1, RKISP1_CIF_ISP_CTRL);
-               isp_ctrl |= RKISP1_CIF_ISP_CTRL_ISP_CFG_UPD;
-               rkisp1_write(params->rkisp1, isp_ctrl, RKISP1_CIF_ISP_CTRL);
-
-               spin_lock(&params->config_lock);
-               list_del(&cur_buf->queue);
-               spin_unlock(&params->config_lock);
+       spin_lock(&params->config_lock);
+       list_del(&cur_buf->queue);
+       spin_unlock(&params->config_lock);
 
-               cur_buf->vb.sequence = frame_sequence;
-               vb2_buffer_done(&cur_buf->vb.vb2_buf, VB2_BUF_STATE_DONE);
-       }
+       cur_buf->vb.sequence = frame_sequence;
+       vb2_buffer_done(&cur_buf->vb.vb2_buf, VB2_BUF_STATE_DONE);
 }
 
 static const struct rkisp1_cif_isp_awb_meas_config rkisp1_awb_params_default_config = {