Skip to content

Commit c8f89c9

Browse files
naushirpopcornmix
authored andcommitted
staging: vc04_services: ISP: Add a more complex ISP processing component
Driver for the BCM2835 ISP hardware block. This driver uses the MMAL component to program the ISP hardware through the VC firmware. The ISP component can produce two video stream outputs, and Bayer image statistics. This can't be encompassed in a simple V4L2 M2M device, so create a new device that registers 4 video nodes. This patch squashes all the development patches from the earlier rpi-5.4.y branch into one Signed-off-by: Naushir Patuck <[email protected]>
1 parent 6310fd1 commit c8f89c9

File tree

10 files changed

+2305
-1
lines changed

10 files changed

+2305
-1
lines changed

MAINTAINERS

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4182,6 +4182,15 @@ S: Maintained
41824182
F: Documentation/devicetree/bindings/media/brcm,bcm2835-unicam.yaml
41834183
F: drivers/media/platform/broadcom/bcm2835-unicam*
41844184

4185+
BROADCOM BCM2835 ISP DRIVER
4186+
M: Raspberry Pi Kernel Maintenance <[email protected]>
4187+
4188+
S: Maintained
4189+
F: Documentation/media/uapi/v4l/pixfmt-meta-bcm2835-isp-stats.rst
4190+
F: Documentation/media/v4l-drivers/bcm2835-isp.rst
4191+
F: drivers/staging/vc04_services/bcm2835-isp
4192+
F: include/uapi/linux/bcm2835-isp.h
4193+
41854194
BROADCOM BCM2711 HEVC DECODER
41864195
M: Raspberry Pi Kernel Maintenance <[email protected]>
41874196

drivers/staging/vc04_services/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ source "drivers/staging/vc04_services/bcm2835-camera/Kconfig"
5252

5353
source "drivers/staging/vc04_services/vc-sm-cma/Kconfig"
5454
source "drivers/staging/vc04_services/bcm2835-codec/Kconfig"
55+
source "drivers/staging/vc04_services/bcm2835-isp/Kconfig"
5556

5657
source "drivers/staging/vc04_services/vchiq-mmal/Kconfig"
5758

drivers/staging/vc04_services/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,5 @@ obj-$(CONFIG_VIDEO_BCM2835) += bcm2835-camera/
1616
obj-$(CONFIG_BCM2835_VCHIQ_MMAL) += vchiq-mmal/
1717
obj-$(CONFIG_BCM_VC_SM_CMA) += vc-sm-cma/
1818
obj-$(CONFIG_VIDEO_CODEC_BCM2835) += bcm2835-codec/
19+
obj-$(CONFIG_VIDEO_ISP_BCM2835) += bcm2835-isp/
1920

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
config VIDEO_ISP_BCM2835
2+
tristate "BCM2835 ISP support"
3+
depends on MEDIA_SUPPORT
4+
depends on VIDEO_DEV && (ARCH_BCM2835 || COMPILE_TEST)
5+
depends on MEDIA_CONTROLLER
6+
select BCM2835_VCHIQ_MMAL
7+
select VIDEOBUF2_DMA_CONTIG
8+
help
9+
This is the V4L2 driver for the Broadcom BCM2835 ISP hardware.
10+
This operates over the VCHIQ interface to a service running on
11+
VideoCore.
12+
13+
To compile this driver as a module, choose M here: the module
14+
will be called bcm2835-isp.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# SPDX-License-Identifier: GPL-2.0
2+
bcm2835-isp-objs := bcm2835-v4l2-isp.o
3+
4+
obj-$(CONFIG_VIDEO_ISP_BCM2835) += bcm2835-isp.o
5+
6+
ccflags-y += \
7+
-I$(srctree)/drivers/staging/vc04_services \
8+
-D__VCCOREVER__=0x04000000
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
/* SPDX-License-Identifier: GPL-2.0 */
2+
/*
3+
* Broadcom BCM2835 ISP driver
4+
*
5+
* Copyright © 2019-2020 Raspberry Pi (Trading) Ltd.
6+
*
7+
* Author: Naushir Patuck ([email protected])
8+
*
9+
*/
10+
11+
#ifndef BCM2835_ISP_CTRLS
12+
#define BCM2835_ISP_CTRLS
13+
14+
#include <linux/bcm2835-isp.h>
15+
16+
struct bcm2835_isp_custom_ctrl {
17+
const char *name;
18+
u32 id;
19+
u32 size;
20+
u32 flags;
21+
};
22+
23+
static const struct bcm2835_isp_custom_ctrl custom_ctrls[] = {
24+
{
25+
.name = "Colour Correction Matrix",
26+
.id = V4L2_CID_USER_BCM2835_ISP_CC_MATRIX,
27+
.size = sizeof(struct bcm2835_isp_custom_ccm),
28+
.flags = 0
29+
}, {
30+
.name = "Lens Shading",
31+
.id = V4L2_CID_USER_BCM2835_ISP_LENS_SHADING,
32+
.size = sizeof(struct bcm2835_isp_lens_shading),
33+
.flags = V4L2_CTRL_FLAG_EXECUTE_ON_WRITE
34+
}, {
35+
.name = "Black Level",
36+
.id = V4L2_CID_USER_BCM2835_ISP_BLACK_LEVEL,
37+
.size = sizeof(struct bcm2835_isp_black_level),
38+
.flags = 0
39+
}, {
40+
.name = "Green Equalisation",
41+
.id = V4L2_CID_USER_BCM2835_ISP_GEQ,
42+
.size = sizeof(struct bcm2835_isp_geq),
43+
.flags = 0
44+
}, {
45+
.name = "Gamma",
46+
.id = V4L2_CID_USER_BCM2835_ISP_GAMMA,
47+
.size = sizeof(struct bcm2835_isp_gamma),
48+
.flags = 0
49+
}, {
50+
.name = "Sharpen",
51+
.id = V4L2_CID_USER_BCM2835_ISP_SHARPEN,
52+
.size = sizeof(struct bcm2835_isp_sharpen),
53+
.flags = 0
54+
}, {
55+
.name = "Denoise",
56+
.id = V4L2_CID_USER_BCM2835_ISP_DENOISE,
57+
.size = sizeof(struct bcm2835_isp_denoise),
58+
.flags = 0
59+
}, {
60+
.name = "Defective Pixel Correction",
61+
.id = V4L2_CID_USER_BCM2835_ISP_DPC,
62+
.size = sizeof(struct bcm2835_isp_dpc),
63+
.flags = 0
64+
}
65+
};
66+
67+
#endif

0 commit comments

Comments
 (0)