Skip to content

Commit

Permalink
staging: vc04_services: ISP: Add a more complex ISP processing component
Browse files Browse the repository at this point in the history
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 <naush@raspberrypi.com>
  • Loading branch information
naushir authored and popcornmix committed May 31, 2024
1 parent 6310fd1 commit c8f89c9
Show file tree
Hide file tree
Showing 10 changed files with 2,305 additions and 1 deletion.
9 changes: 9 additions & 0 deletions MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -4182,6 +4182,15 @@ S: Maintained
F: Documentation/devicetree/bindings/media/brcm,bcm2835-unicam.yaml
F: drivers/media/platform/broadcom/bcm2835-unicam*

BROADCOM BCM2835 ISP DRIVER
M: Raspberry Pi Kernel Maintenance <kernel-list@raspberrypi.com>
L: linux-media@vger.kernel.org
S: Maintained
F: Documentation/media/uapi/v4l/pixfmt-meta-bcm2835-isp-stats.rst
F: Documentation/media/v4l-drivers/bcm2835-isp.rst
F: drivers/staging/vc04_services/bcm2835-isp
F: include/uapi/linux/bcm2835-isp.h

BROADCOM BCM2711 HEVC DECODER
M: Raspberry Pi Kernel Maintenance <kernel-list@raspberrypi.com>
L: linux-media@vger.kernel.org
Expand Down
1 change: 1 addition & 0 deletions drivers/staging/vc04_services/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ source "drivers/staging/vc04_services/bcm2835-camera/Kconfig"

source "drivers/staging/vc04_services/vc-sm-cma/Kconfig"
source "drivers/staging/vc04_services/bcm2835-codec/Kconfig"
source "drivers/staging/vc04_services/bcm2835-isp/Kconfig"

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

Expand Down
1 change: 1 addition & 0 deletions drivers/staging/vc04_services/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@ obj-$(CONFIG_VIDEO_BCM2835) += bcm2835-camera/
obj-$(CONFIG_BCM2835_VCHIQ_MMAL) += vchiq-mmal/
obj-$(CONFIG_BCM_VC_SM_CMA) += vc-sm-cma/
obj-$(CONFIG_VIDEO_CODEC_BCM2835) += bcm2835-codec/
obj-$(CONFIG_VIDEO_ISP_BCM2835) += bcm2835-isp/

14 changes: 14 additions & 0 deletions drivers/staging/vc04_services/bcm2835-isp/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
config VIDEO_ISP_BCM2835
tristate "BCM2835 ISP support"
depends on MEDIA_SUPPORT
depends on VIDEO_DEV && (ARCH_BCM2835 || COMPILE_TEST)
depends on MEDIA_CONTROLLER
select BCM2835_VCHIQ_MMAL
select VIDEOBUF2_DMA_CONTIG
help
This is the V4L2 driver for the Broadcom BCM2835 ISP hardware.
This operates over the VCHIQ interface to a service running on
VideoCore.

To compile this driver as a module, choose M here: the module
will be called bcm2835-isp.
8 changes: 8 additions & 0 deletions drivers/staging/vc04_services/bcm2835-isp/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# SPDX-License-Identifier: GPL-2.0
bcm2835-isp-objs := bcm2835-v4l2-isp.o

obj-$(CONFIG_VIDEO_ISP_BCM2835) += bcm2835-isp.o

ccflags-y += \
-I$(srctree)/drivers/staging/vc04_services \
-D__VCCOREVER__=0x04000000
67 changes: 67 additions & 0 deletions drivers/staging/vc04_services/bcm2835-isp/bcm2835-isp-ctrls.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
/* SPDX-License-Identifier: GPL-2.0 */
/*
* Broadcom BCM2835 ISP driver
*
* Copyright © 2019-2020 Raspberry Pi (Trading) Ltd.
*
* Author: Naushir Patuck (naush@raspberrypi.com)
*
*/

#ifndef BCM2835_ISP_CTRLS
#define BCM2835_ISP_CTRLS

#include <linux/bcm2835-isp.h>

struct bcm2835_isp_custom_ctrl {
const char *name;
u32 id;
u32 size;
u32 flags;
};

static const struct bcm2835_isp_custom_ctrl custom_ctrls[] = {
{
.name = "Colour Correction Matrix",
.id = V4L2_CID_USER_BCM2835_ISP_CC_MATRIX,
.size = sizeof(struct bcm2835_isp_custom_ccm),
.flags = 0
}, {
.name = "Lens Shading",
.id = V4L2_CID_USER_BCM2835_ISP_LENS_SHADING,
.size = sizeof(struct bcm2835_isp_lens_shading),
.flags = V4L2_CTRL_FLAG_EXECUTE_ON_WRITE
}, {
.name = "Black Level",
.id = V4L2_CID_USER_BCM2835_ISP_BLACK_LEVEL,
.size = sizeof(struct bcm2835_isp_black_level),
.flags = 0
}, {
.name = "Green Equalisation",
.id = V4L2_CID_USER_BCM2835_ISP_GEQ,
.size = sizeof(struct bcm2835_isp_geq),
.flags = 0
}, {
.name = "Gamma",
.id = V4L2_CID_USER_BCM2835_ISP_GAMMA,
.size = sizeof(struct bcm2835_isp_gamma),
.flags = 0
}, {
.name = "Sharpen",
.id = V4L2_CID_USER_BCM2835_ISP_SHARPEN,
.size = sizeof(struct bcm2835_isp_sharpen),
.flags = 0
}, {
.name = "Denoise",
.id = V4L2_CID_USER_BCM2835_ISP_DENOISE,
.size = sizeof(struct bcm2835_isp_denoise),
.flags = 0
}, {
.name = "Defective Pixel Correction",
.id = V4L2_CID_USER_BCM2835_ISP_DPC,
.size = sizeof(struct bcm2835_isp_dpc),
.flags = 0
}
};

#endif
Loading

0 comments on commit c8f89c9

Please sign in to comment.