diff options
author | Álvaro Fernández Rojas <noltari@gmail.com> | 2021-02-18 18:04:33 +0100 |
---|---|---|
committer | Álvaro Fernández Rojas <noltari@gmail.com> | 2021-02-19 07:17:21 +0100 |
commit | 62b7f5931c54e96fca56dd8761b0e466d355c881 (patch) | |
tree | 1258b392752379833a075df006c2f6d7ac4be51d /target/linux/bcm27xx/patches-5.4/950-0918-staging-vc04_services-isp-Rework-lens-shading-to-tak.patch | |
parent | 76d1168d0d4b9d76e2ad78c0fc6b255561deb284 (diff) | |
download | upstream-62b7f5931c54e96fca56dd8761b0e466d355c881.tar.gz upstream-62b7f5931c54e96fca56dd8761b0e466d355c881.tar.bz2 upstream-62b7f5931c54e96fca56dd8761b0e466d355c881.zip |
bcm27xx: import latest patches from the RPi foundation
bcm2708: boot tested on RPi B+ v1.2
bcm2709: boot tested on RPi 3B v1.2 and RPi 4B v1.1 4G
bcm2710: boot tested on RPi 3B v1.2
bcm2711: boot tested on RPi 4B v1.1 4G
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
(cherry-picked from commit f07e572f64)
Diffstat (limited to 'target/linux/bcm27xx/patches-5.4/950-0918-staging-vc04_services-isp-Rework-lens-shading-to-tak.patch')
-rw-r--r-- | target/linux/bcm27xx/patches-5.4/950-0918-staging-vc04_services-isp-Rework-lens-shading-to-tak.patch | 87 |
1 files changed, 87 insertions, 0 deletions
diff --git a/target/linux/bcm27xx/patches-5.4/950-0918-staging-vc04_services-isp-Rework-lens-shading-to-tak.patch b/target/linux/bcm27xx/patches-5.4/950-0918-staging-vc04_services-isp-Rework-lens-shading-to-tak.patch new file mode 100644 index 0000000000..8748214797 --- /dev/null +++ b/target/linux/bcm27xx/patches-5.4/950-0918-staging-vc04_services-isp-Rework-lens-shading-to-tak.patch @@ -0,0 +1,87 @@ +From 7504f92483407233d9093e164d8f001db5c374e5 Mon Sep 17 00:00:00 2001 +From: Dave Stevenson <dave.stevenson@raspberrypi.com> +Date: Fri, 8 May 2020 22:05:29 +0100 +Subject: [PATCH] staging: vc04_services: isp: Rework lens shading to + take a dmabuf + +This removes the need for the client to use vcsm at all. + +Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com> +--- + .../bcm2835-isp/bcm2835-v4l2-isp.c | 36 +++++++++++++++++-- + include/uapi/linux/bcm2835-isp.h | 4 +-- + 2 files changed, 35 insertions(+), 5 deletions(-) + +--- a/drivers/staging/vc04_services/bcm2835-isp/bcm2835-v4l2-isp.c ++++ b/drivers/staging/vc04_services/bcm2835-isp/bcm2835-v4l2-isp.c +@@ -21,6 +21,8 @@ + #include "vchiq-mmal/mmal-parameters.h" + #include "vchiq-mmal/mmal-vchiq.h" + ++#include "vc-sm-cma/vc_sm_knl.h" ++ + #include "bcm2835_isp_ctrls.h" + #include "bcm2835_isp_fmts.h" + +@@ -722,10 +724,38 @@ static int bcm2835_isp_s_ctrl(struct v4l + sizeof(struct bcm2835_isp_custom_ccm)); + break; + case V4L2_CID_USER_BCM2835_ISP_LENS_SHADING: +- ret = set_isp_param(node, MMAL_PARAMETER_LENS_SHADING_OVERRIDE, +- ctrl->p_new.p_u8, +- sizeof(struct bcm2835_isp_lens_shading)); ++ { ++ struct bcm2835_isp_lens_shading ls; ++ struct dma_buf *dmabuf; ++ void *vcsm_handle; ++ ++ memcpy(&ls, ctrl->p_new.p_u8, ++ sizeof(struct bcm2835_isp_lens_shading)); ++ ++ dmabuf = dma_buf_get(ls.dmabuf); ++ if (!dmabuf) ++ return -EINVAL; ++ ++ ret = vc_sm_cma_import_dmabuf(dmabuf, ++ &vcsm_handle); ++ if (ret) { ++ dma_buf_put(dmabuf); ++ return -EINVAL; ++ } ++ ++ ls.dmabuf = vc_sm_cma_int_handle(vcsm_handle); ++ if (ls.dmabuf) ++ ret = set_isp_param(node, ++ MMAL_PARAMETER_LENS_SHADING_OVERRIDE, ++ &ls, ++ sizeof(struct bcm2835_isp_lens_shading)); ++ else ++ ret = -EINVAL; ++ ++ vc_sm_cma_free(vcsm_handle); ++ dma_buf_put(dmabuf); + break; ++ } + case V4L2_CID_USER_BCM2835_ISP_BLACK_LEVEL: + ret = set_isp_param(node, MMAL_PARAMETER_BLACK_LEVEL, + ctrl->p_new.p_u8, +--- a/include/uapi/linux/bcm2835-isp.h ++++ b/include/uapi/linux/bcm2835-isp.h +@@ -108,7 +108,7 @@ enum bcm2835_isp_gain_format { + * @grid_stride: Row to row distance (in grid cells) between grid cells + * in the same horizontal location. + * @grid_height: Height of lens shading tables in grid cells. +- * @mem_handle_table: Memory handle to the tables. ++ * @dmabuf: dmabuf file handle containing the table. + * @ref_transform: Reference transform - unsupported, please pass zero. + * @corner_sampled: Whether the gains are sampled at the corner points + * of the grid cells or in the cell centres. +@@ -120,7 +120,7 @@ struct bcm2835_isp_lens_shading { + __u32 grid_width; + __u32 grid_stride; + __u32 grid_height; +- __u32 mem_handle_table; ++ __s32 dmabuf; + __u32 ref_transform; + __u32 corner_sampled; + __u32 gain_format; |