aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2022-09-24media: Remove incorrect comment from struct v4l2_fwnode_endpointSakari Ailus1-4/+0
struct v4l2_fwnode_endpoint was zeroed previously apart from the endpoint information itself when the endpoint properties were parsed. Now this hasn't been the case for a few years so remove the comment. Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2022-09-24media: sun6i-mipi-csi2: Depend on PHY_SUN6I_MIPI_DPHYSakari Ailus1-1/+1
PHY_SUN6I_MIPI_DPHY is not a freely selectable option and so may not always be available. Depend on it instead. Fixes: 94d7fd9692b5 ("media: sunxi: Depend on GENERIC_PHY_MIPI_DPHY") Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2022-09-24media: ov8865: Fix an error handling path in ov8865_probe()Christophe JAILLET1-4/+6
The commit in Fixes also introduced some new error handling which should goto the existing error handling path. Otherwise some resources leak. Fixes: 73dcffeb2ff9 ("media: i2c: Support 19.2MHz input clock in ov8865") Signed-off-by: Christophe JAILLET <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2022-09-24media: ar0521: Fix return value check in writing initial registersSakari Ailus1-1/+2
The return value from register writes is ignored apart from the last value. Fix this. Reported-by: kernel test robot <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2022-09-24media: v4l: subdev: Fail graciously when getting try data for NULL stateSakari Ailus1-0/+6
The state argument for the functions for obtaining various parts of the state is NULL if it is called by drivers for active state. Fail graciously in that case instead of dereferencing a NULL pointer. Suggested-by: Bingbu Cao <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Reviewed-by: Tomi Valkeinen <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2022-09-24media: ipu3-imgu: Fix NULL pointer dereference in active selection accessSakari Ailus1-17/+14
What the IMGU driver did was that it first acquired the pointers to active and try V4L2 subdev state, and only then figured out which one to use. The problem with that approach and a later patch (see Fixes: tag) is that as sd_state argument to v4l2_subdev_get_try_crop() et al is NULL, there is now an attempt to dereference that. Fix this. Also rewrap lines a little. Fixes: 0d346d2a6f54 ("media: v4l2-subdev: add subdev-wide state struct") Cc: [email protected] # for v5.14 and later Signed-off-by: Sakari Ailus <[email protected]> Reviewed-by: Bingbu Cao <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2022-09-24media: ar0521: Remove redundant variable retSakari Ailus1-2/+1
ret in ar0521_set_fmt is never set to values other than 0. Replace it with plain 0. Reported-by: kernel test robot <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2022-09-24media: ar0521: fix error return code in ar0521_power_on()Yang Yingliang1-2/+3
Return error code if ar0521_write_regs() fails in ar0521_power_on(). Fixes: 852b50aeed15 ("media: On Semi AR0521 sensor driver") Signed-off-by: Yang Yingliang <[email protected]> Acked-by: Krzysztof Hałasa <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2022-09-24media: i2c: mt9v111: Fix typo 'the the' in commentSlark Xiao1-1/+1
Replace 'the the' with 'the' in the comment. Signed-off-by: Slark Xiao <[email protected]> Reviewed-by: Jacopo Mondi <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2022-09-24media: v4l2: Fix v4l2_i2c_subdev_set_name function documentationAlexander Stein1-1/+2
The doc says the I²C device's name is used if devname is NULL, but actually the I²C device driver's name is used. Fixes: 0658293012af ("media: v4l: subdev: Add a function to set an I²C sub-device's name") Signed-off-by: Alexander Stein <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2022-09-24media: ov5640: Use runtime PMPaul Elder1-47/+76
Switch to using runtime PM for power management. Make it optional, however, to support ACPI. Signed-off-by: Paul Elder <[email protected]> Reviewed-by: Laurent Pinchart <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2022-09-24media: staging: ipu3-imgu: Fix BNR wb gain documentationJean-Michel Hautbois1-2/+5
The documentation states that the BNR factor is a multiplier coded as u3.13 and with a range of (0, 8). This is not correct, as the isp is adding 1.0 to the gain applied, ie Pout = { Pin * (1 + Gx) }. It means that a gain of 1.0 should be coded as 0. Signed-off-by: Jean-Michel Hautbois <[email protected]> Reviewed-by: Kieran Bingham <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2022-09-24media: hantro: Allows luma and chroma depth to be differentBenjamin Gaignard1-3/+0
Luma and chroma depth are set on different hardware registers. Even if they aren't identical the bitstream can be compliant to HEVC specifications and decoded by the hardware. With this patch TSUNEQBD_A_MAIN10_Technicolor_2 conformance test is successfully decoded. Signed-off-by: Benjamin Gaignard <[email protected]> Reviewed-by: Ezequiel Garcia <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2022-09-24media: hantro: imx8m: Enable 10bit decodingBenjamin Gaignard1-0/+27
Expose 10bit pixel formats to enable 10bit decoding in IMX8M SoCs. Signed-off-by: Benjamin Gaignard <[email protected]> Reviewed-by: Ezequiel Garcia <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2022-09-24media: Hantro: HEVC: Allows 10-bit bitstreamBenjamin Gaignard1-2/+2
Stop limiting HEVC support to 8-bits bitstreams also accept 10-bits bitstreams. Signed-off-by: Benjamin Gaignard <[email protected]> Reviewed-by: Ezequiel Garcia <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2022-09-24media: hantro: postproc: Configure output regs to support 10bitBenjamin Gaignard2-3/+6
Move output format setting in postproc and make sure that 8/10bit configuration is correctly set. Signed-off-by: Benjamin Gaignard <[email protected]> Reviewed-by: Ezequiel Garcia <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2022-09-24media: hantro: HEVC: Fix chroma offset computationBenjamin Gaignard1-1/+1
The chroma offset depends of the bitstream depth. Make sure that ctx->bit_depth is used to compute it. Signed-off-by: Benjamin Gaignard <[email protected]> Reviewed-by: Ezequiel Garcia <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2022-09-24media: hantro: HEVC: Fix auxilary buffer size calculationBenjamin Gaignard1-2/+2
SAO and FILTER buffers size depend of the bit depth. Make sure we have enough space for 10bit bitstreams. Signed-off-by: Benjamin Gaignard <[email protected]> Reviewed-by: Ezequiel Garcia <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2022-09-24media: hantro: Store HEVC bit depth in contextBenjamin Gaignard1-0/+7
Store HEVC bit depth in context. Bit depth is equal to hevc sps bit_depth_luma_minus8 + 8. Signed-off-by: Benjamin Gaignard <[email protected]> Reviewed-by: Ezequiel Garcia <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2022-09-24media: meson: vdec: fix possible refcount leak in vdec_probe()Hangyu Hua1-0/+2
v4l2_device_unregister need to be called to put the refcount got by v4l2_device_register when vdec_probe fails or vdec_remove is called. Signed-off-by: Hangyu Hua <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2022-09-24media: platform: cros-ec: Add Kuldax to the match tableRory Liu1-0/+2
The Google Kuldax device uses the same approach as the Google Brask which enables the HDMI CEC via the cros-ec-cec driver. Signed-off-by: Rory Liu <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2022-09-24media: MAINTAINERS: rectify entry in SAA7146 VIDEO4LINUX-2 DRIVERLukas Bulwahn1-1/+0
Commit e33fdb5a0249 ("media: saa7146: deprecate hexium_gemini/orion, mxb and ttpci") moves some media drivers to the staging subsystem, and unfortunately only partially adjusts the entry in MAINTAINERS. Hence, ./scripts/get_maintainer.pl --self-test=patterns complains about a broken reference. As the files matching include/media/drv-intf/saa7146* are moved to drivers/staging/media/deprecated/saa7146/common, this directory is already covered by the existing file entry drivers/staging/media/deprecated/saa7146/. Repair this file reference in SAA7146 VIDEO4LINUX-2 DRIVER. Signed-off-by: Lukas Bulwahn <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2022-09-24media: MAINTAINERS: adjust entry to zoran driver movementLukas Bulwahn1-1/+1
Commit 2a0c28063de2 ("media: zoran: move to mainline") moves the zoran driver from the staging to the media subsystem, but does not adjust the entry in MAINTAINERS. Hence, ./scripts/get_maintainer.pl --self-test=patterns complains about a broken reference. Repair this file reference in ZR36067 VIDEO FOR LINUX DRIVER. Signed-off-by: Lukas Bulwahn <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2022-09-24media: tuners: Remove the unneeded result variableye xingchen1-3/+1
Return the value xc_send_i2c_data() directly instead of storing it in another redundant variable. Signed-off-by: ye xingchen <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2022-09-24media: platform: mtk-mdp3: fix PM reference leak in mdp_comp_clock_on()Sun Ke1-2/+3
mdp_comp_clock_on will increase runtime PM usage counter, and mdp_comp_clock_off will decrease the runtime PM usage counter. so, if mdp_comp_clock_on failed after increment runtime PM usage counter, it should decrease it before return a error code. pm_runtime_get_sync will increment pm usage counter even it failed. Forgetting to putting operation will result in reference leak here. Fix it by replacing it with pm_runtime_resume_and_get to keep usage counter balanced. And if failed to enable clk, add pm_runtime_put() to decrease the runtime PM usage counter. Fixes: 61890ccaefaf ("media: platform: mtk-mdp3: add MediaTek MDP3 driver") Signed-off-by: Sun Ke <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2022-09-24media: platform: mtk-mdp3: fix error code in mdp_vpu_dev_init()Dan Carpenter1-1/+2
Return a negative error code if mdp_vpu_shared_mem_alloc() fails. Fixes: 61890ccaefaf ("media: platform: mtk-mdp3: add MediaTek MDP3 driver") Signed-off-by: Dan Carpenter <[email protected]> Reviewed-by: AngeloGioacchino Del Regno <[email protected]> Reviewed-by: Matthias Brugger <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2022-09-24media: radio-si476x: Remove the unneeded result variableye xingchen1-4/+1
Return the value v4l2_fh_release() directly instead of storing it in another redundant variable. Signed-off-by: ye xingchen <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2022-09-24media: docs: libv4l-introduction.rst: Fix function signature and linkDaniel Lundberg Pedersen1-2/+2
v4l2_mmap returns a void*, also link to mmap instead of munmap Signed-off-by: Daniel Lundberg Pedersen <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2022-09-24media: platform: mtk-mdp3: add pointer checks and use devm_kfreeMoudy Ho3-3/+4
Fix two errors reported by smatch: drivers/media/platform/mediatek/mdp3/mtk-mdp3-core.c:292 mdp_probe() error: we previously assumed 'mdp' could be null drivers/media/platform/mediatek/mdp3/mtk-mdp3-cmdq.c:460 mdp_cmdq_send() error: we previously assumed 'cmd' could be null Also, avoid warnings reported by smatch: drivers/media/platform/mediatek/mdp3/mtk-mdp3-comp.c:872 mdp_comp_create() warn: passing devm_ allocated variable to kfree. 'comp' [hverkuil: fix devm_kfree call] Signed-off-by: Moudy Ho <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2022-09-24media: si4713: Use the right includeLinus Walleij1-1/+1
The driver includes the legacy <linux/gpio.h> header but uses <linux/gpio/consumer.h>. Cc: Dinesh Ram <[email protected]> Cc: Eduardo Valentin <[email protected]> Signed-off-by: Linus Walleij <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2022-09-24media: i2c: isl7998x: Use right includeLinus Walleij1-1/+1
This driver is using GPIO descriptors but uses the legacy include header <linux/gpio.h>. Fix it by including the intended <linux/gpio/consumer.h>. Cc: Marek Vasut <[email protected]> Signed-off-by: Linus Walleij <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2022-09-24media: cec: add support for Absolute Volume ControlHans Verkuil4-0/+19
Add support for this new CEC message. This was added in HDMI 2.1a. Signed-off-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2022-09-24media: dvb-frontends/drxk: initialize err to 0Hans Verkuil1-1/+1
Fix a compiler warning: drivers/media/dvb-frontends/drxk_hard.c: In function 'drxk_read_ucblocks': drivers/media/dvb-frontends/drxk_hard.c:6673:21: warning: 'err' may be used uninitialized [-Wmaybe-uninitialized] 6673 | *ucblocks = (u32) err; | ^~~~~~~~~ drivers/media/dvb-frontends/drxk_hard.c:6663:13: note: 'err' was declared here 6663 | u16 err; | ^~~ Signed-off-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2022-09-24media: v4l2-ctrls: drop 'elems' argument from control type ops.Hans Verkuil4-32/+27
The type ops for equal, init and validate have an elems argument, but this can be taken from struct v4l2_ctrl: ctrl->elems for equal and init, and ctrl->new_elems for validate (since you are validating a new control value). So drop this argument and update all callers. Signed-off-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2022-09-24media: amphion: release m2m ctx when releasing vpu instanceMing Qian1-7/+4
release m2m ctx in the callback function that release the vpu instance, then there is no need to add lock around releasing m2m ctx. Fixes: 3cd084519c6f ("media: amphion: add vpu v4l2 m2m support") Signed-off-by: Ming Qian <[email protected]> Reviewed-by: Tommaso Merciai <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2022-09-24media: coda: jpeg: drop coda9_jpeg_dec_huff_setup() return valuePhilipp Zabel1-10/+3
coda9_jpeg_dec_huff_setup() never returns anything but 0. Drop return value and superfluous error handling at the call site. Signed-off-by: Philipp Zabel <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2022-09-24media: pci/cx18: fix repeated words in commentsJilin Yuan1-2/+2
Delete the redundant word 'is'. Signed-off-by: Jilin Yuan <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2022-09-24media: usb/dvb-usb-v2: fix repeated words in commentsJilin Yuan1-1/+1
Delete the redundant word 'my'. Signed-off-by: Jilin Yuan <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2022-09-24media: usb/msi2500: fix repeated words in commentsJilin Yuan1-1/+1
Delete the redundant word 'for'. Signed-off-by: Jilin Yuan <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2022-09-24media: cros-ec-cec: limit msg.len to CEC_MAX_MSG_SIZEHans Verkuil1-0/+2
I expect that the hardware will have limited this to 16, but just in case it hasn't, check for this corner case. Signed-off-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2022-09-24media: s5p_cec: limit msg.len to CEC_MAX_MSG_SIZEHans Verkuil1-0/+2
I expect that the hardware will have limited this to 16, but just in case it hasn't, check for this corner case. Signed-off-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2022-09-24media: rkisp1: Zero v4l2_subdev_format fields in when validating linksLaurent Pinchart1-3/+4
The local sd_fmt variable in rkisp1_capture_link_validate() has uninitialized fields, which causes random failures when calling the subdev .get_fmt() operation. Fix it by initializing the variable when declaring it, which zeros all other fields. Signed-off-by: Laurent Pinchart <[email protected]> Reviewed-by: Paul Elder <[email protected]> Reviewed-by: Dafna Hirschfeld <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2022-09-24media: rkisp1: Configure LSC after enabling the ISPLaurent Pinchart3-64/+143
The ISP8000Nano v18.02 (found in the i.MX8MP) requires the ISP to be enabled (as indicated by the ISP_CTRL.ISP_ENABLE bit) to configure the lens shading table in internal RAM. The driver currently configures all ISP initial parameters before enabling the ISP, which causes the LSC RAM to not be initialized properly. To fix this, split the rkisp1_params_configure() function into a rkisp1_params_pre_configure() and a rkisp1_params_post_configure(). The former configures all ISP parameters but LSC, while the latter configures LSC. To implement this, the rkisp1_params_apply_params_cfg() function is deconstructed, with two small helpers created to deal with the parameters buffers, which are then used in rkisp1_params_isr(), rkisp1_params_pre_configure() and rkisp1_params_post_configure(). While this initialization ordering is only needed for the ISP8000Nano v18.02, it doesn't affect other ISP versions negatively, and can thus be followed unconditionally. Signed-off-by: Laurent Pinchart <[email protected]> Reviewed-by: Dafna Hirschfeld <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2022-09-24media: rkisp1: Use correct macro for gradient registersLaurent Pinchart2-3/+3
The rkisp1_lsc_config() function incorrectly uses the RKISP1_CIF_ISP_LSC_SECT_SIZE() macro for the gradient registers. Replace it with the correct macro, and rename it from RKISP1_CIF_ISP_LSC_GRAD_SIZE() to RKISP1_CIF_ISP_LSC_SECT_GRAD() as the corresponding registers store the gradients for each sector, not a size. This doesn't cause any functional change as the two macros are defined identically (the size and gradient registers store fields in the same number of bits at the same positions). Signed-off-by: Laurent Pinchart <[email protected]> Reviewed-by: Dafna Hirschfeld <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2022-09-24media: rkisp1: Simplify LSC x/y size and grad register macrosLaurent Pinchart2-20/+8
The LSC module x/y size and grad configuration is stored in a set of 4 indexed registers each. The rkisp1-regs.h header defines all those registers, but only the first one in each set is used, with manual calculation of addresses of subsequent registers. Simplifies this by merging all 4 register macros into one that takes the index as a parameter. No functional change intended. Signed-off-by: Laurent Pinchart <[email protected]> Reviewed-by: Dafna Hirschfeld <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2022-09-24media: rkisp1: Store LSC register values in u32 variablesLaurent Pinchart1-4/+6
Use the u32 type instead of unsigned int to store register values in the LSC configuration code, to make the variables' size more explicit. No functional change intended. Signed-off-by: Laurent Pinchart <[email protected]> Reviewed-by: Dafna Hirschfeld <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2022-09-24media: rkisp1: Clean up LSC configuration codeLaurent Pinchart1-113/+86
Clean up the LSC configuration code to improve its readability by shortening lines, using extra local variables and renaming long variables. No functional change intended. Signed-off-by: Laurent Pinchart <[email protected]> Reviewed-by: Dafna Hirschfeld <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2022-09-24media: rkisp1: Allow setting color space on resizer sink padLaurent Pinchart1-3/+38
The resizer doesn't deal with color spaces, so it can accept any color space on its input, and propagates it unchanged to its output. When operating with a Bayer input format (in pass-through mode) further restrict the YCbCr encoding and quantization to Rec 601 and full range respectively, as for raw data the former ought to be ignored and the latter is always full range. Signed-off-by: Laurent Pinchart <[email protected]> Reviewed-by: Paul Elder <[email protected]> Reviewed-by: Dafna Hirschfeld <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2022-09-24media: rkisp1: Initialize color space on resizer sink and source padsLaurent Pinchart1-0/+4
Initialize the four color space fields on the sink and source video pads of the resizer in the .init_cfg() operation. The resizer can't perform any color space conversion, so set the sink and source color spaces to the same defaults, which match the ISP source video pad default. Signed-off-by: Laurent Pinchart <[email protected]> Reviewed-by: Paul Elder <[email protected]> Reviewed-by: Dafna Hirschfeld <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2022-09-24media: rkisp1: Configure CSM based on YCbCr encodingLaurent Pinchart3-21/+84
The driver currently only implements the Rec. 601 YCbCr encoding, extend it with support for the other encodings defined by V4L2 (Rec. 709, Rec. 2020 and SMPTE240m). The coefficients have been calculated by rounding the floating point values to the nearest Q1.7 fixed-point value, adjusting the rounding to ensure that the sum of each line in the matrix is preserved to avoid overflows. At the hardware level, the RGB to YUV conversion matrix is fully configurable, custom encoding could be supported by extending the ISP parameters if desired. Signed-off-by: Laurent Pinchart <[email protected]> Reviewed-by: Dafna Hirschfeld <[email protected]> Reviewed-by: Paul Elder <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>