drivers: staging: bcm2835-isp: Clear LS table handle in the firmware
authorNaushir Patuck <naush@raspberrypi.com>
Tue, 22 Mar 2022 15:16:40 +0000 (15:16 +0000)
committerPhil Elwell <8911409+pelwell@users.noreply.github.com>
Fri, 25 Mar 2022 09:25:39 +0000 (09:25 +0000)
When all nodes have stopped streaming, ensure the firmware has released its
handle on the LS table dmabuf. This is done by passing a null handle in the
LS params.

Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
drivers/staging/vc04_services/bcm2835-isp/bcm2835-v4l2-isp.c

index 9ea8170..b674992 100644 (file)
@@ -655,6 +655,19 @@ static void bcm2835_isp_node_stop_streaming(struct vb2_queue *q)
        atomic_dec(&dev->num_streaming);
        /* If all ports disabled, then disable the component */
        if (atomic_read(&dev->num_streaming) == 0) {
+               struct bcm2835_isp_lens_shading ls;
+               /*
+                * The ISP component on the firmware has a reference to the
+                * dmabuf handle for the lens shading table.  Pass a null handle
+                * to remove that reference now.
+                */
+               memset(&ls, 0, sizeof(ls));
+               /* Must set a valid grid size for the FW */
+               ls.grid_cell_size = 16;
+               set_isp_param(&dev->node[0],
+                             MMAL_PARAMETER_LENS_SHADING_OVERRIDE,
+                             &ls, sizeof(ls));
+
                ret = vchiq_mmal_component_disable(dev->mmal_instance,
                                                   dev->component);
                if (ret) {