2183f2759451dd43ca79934cc149a14afe3bdfb7
[openwrt/staging/neocturne.git] /
1 From bdce2bf86c56f023dc37130afafa3617f05e7876 Mon Sep 17 00:00:00 2001
2 From: Naushir Patuck <naush@raspberrypi.com>
3 Date: Tue, 22 Mar 2022 15:16:40 +0000
4 Subject: [PATCH] drivers: staging: bcm2835-isp: Clear LS table handle
5 in the firmware
6
7 When all nodes have stopped streaming, ensure the firmware has released its
8 handle on the LS table dmabuf. This is done by passing a null handle in the
9 LS params.
10
11 Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
12 ---
13 .../vc04_services/bcm2835-isp/bcm2835-v4l2-isp.c | 13 +++++++++++++
14 1 file changed, 13 insertions(+)
15
16 --- a/drivers/staging/vc04_services/bcm2835-isp/bcm2835-v4l2-isp.c
17 +++ b/drivers/staging/vc04_services/bcm2835-isp/bcm2835-v4l2-isp.c
18 @@ -657,6 +657,19 @@ static void bcm2835_isp_node_stop_stream
19 atomic_dec(&dev->num_streaming);
20 /* If all ports disabled, then disable the component */
21 if (atomic_read(&dev->num_streaming) == 0) {
22 + struct bcm2835_isp_lens_shading ls;
23 + /*
24 + * The ISP component on the firmware has a reference to the
25 + * dmabuf handle for the lens shading table. Pass a null handle
26 + * to remove that reference now.
27 + */
28 + memset(&ls, 0, sizeof(ls));
29 + /* Must set a valid grid size for the FW */
30 + ls.grid_cell_size = 16;
31 + set_isp_param(&dev->node[0],
32 + MMAL_PARAMETER_LENS_SHADING_OVERRIDE,
33 + &ls, sizeof(ls));
34 +
35 ret = vchiq_mmal_component_disable(dev->mmal_instance,
36 dev->component);
37 if (ret) {