Re: [PATCH] [media] ov2640: make GPIOLIB an optional dependency
Hi! > > Better solution would be for VIDEO_EM28XX_V4L2 to depend on GPIOLIB, > > too, no? If not, should there be BUG_ON(priv->pwdn_gpio); > > BUG_ON(priv->resetb_gpio);? > > Pavel, > > The em28xx driver was added upstream several years the gpio driver. > It controls GPIO using a different logic. It makes no sense to make > it dependent on GPIOLIB, except if someone converts it to use it. At least comment in the sourcecode...? Remove pwdn_gpio fields from structure in !GPIOLIB case, because otherwise they are trap for the programmer trying to understand what is going on? Plus, something like this, because otherwise it is quite confusing? Thanks, Pavel diff --git a/drivers/media/i2c/soc_camera/ov2640.c b/drivers/media/i2c/soc_camera/ov2640.c index 56de182..85620e1 100644 --- a/drivers/media/i2c/soc_camera/ov2640.c +++ b/drivers/media/i2c/soc_camera/ov2640.c @@ -1060,7 +1060,7 @@ static int ov2640_hw_reset(struct device *dev) /* Active the resetb pin to perform a reset pulse */ gpiod_direction_output(priv->resetb_gpio, 1); usleep_range(3000, 5000); - gpiod_direction_output(priv->resetb_gpio, 0); + gpiod_set_value(priv->resetb_gpio, 0); } return 0; -- (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html signature.asc Description: Digital signature
cron job: media_tree daily build: ERRORS
This message is generated daily by a cron job that builds media_tree for the kernels and architectures in the list below. Results of the daily build of media_tree: date: Fri Apr 21 05:00:15 CEST 2017 media-tree git hash:9eb9db3a0f92b75ec710066202e0b2accb45afa9 media_build git hash: 1af19680bde3e227d64d99ff5fdc43eb343a3b28 v4l-utils git hash: b514d615166bdc0901a4c71261b87db31e89f464 gcc version:i686-linux-gcc (GCC) 6.2.0 sparse version: v0.5.0-3553-g78b2ea6 smatch version: v0.5.0-3553-g78b2ea6 host hardware: x86_64 host os:4.9.0-164 linux-git-arm-at91: OK linux-git-arm-davinci: OK linux-git-arm-multi: OK linux-git-arm-pxa: OK linux-git-blackfin-bf561: OK linux-git-i686: OK linux-git-m32r: OK linux-git-mips: OK linux-git-powerpc64: OK linux-git-sh: OK linux-git-x86_64: OK linux-2.6.36.4-i686: ERRORS linux-2.6.37.6-i686: ERRORS linux-2.6.38.8-i686: ERRORS linux-2.6.39.4-i686: ERRORS linux-3.0.60-i686: ERRORS linux-3.1.10-i686: ERRORS linux-3.2.37-i686: OK linux-3.3.8-i686: OK linux-3.4.27-i686: OK linux-3.5.7-i686: OK linux-3.6.11-i686: OK linux-3.7.4-i686: OK linux-3.8-i686: OK linux-3.9.2-i686: OK linux-3.10.1-i686: WARNINGS linux-3.11.1-i686: ERRORS linux-3.12.67-i686: ERRORS linux-3.13.11-i686: ERRORS linux-3.14.9-i686: WARNINGS linux-3.15.2-i686: WARNINGS linux-3.16.7-i686: WARNINGS linux-3.17.8-i686: WARNINGS linux-3.18.7-i686: WARNINGS linux-3.19-i686: WARNINGS linux-4.0.9-i686: WARNINGS linux-4.1.33-i686: WARNINGS linux-4.2.8-i686: WARNINGS linux-4.3.6-i686: WARNINGS linux-4.4.22-i686: WARNINGS linux-4.5.7-i686: WARNINGS linux-4.6.7-i686: WARNINGS linux-4.7.5-i686: WARNINGS linux-4.8-i686: OK linux-4.9-i686: OK linux-4.10.1-i686: OK linux-4.11-rc1-i686: OK linux-2.6.36.4-x86_64: ERRORS linux-2.6.37.6-x86_64: ERRORS linux-2.6.38.8-x86_64: ERRORS linux-2.6.39.4-x86_64: ERRORS linux-3.0.60-x86_64: ERRORS linux-3.1.10-x86_64: ERRORS linux-3.2.37-x86_64: OK linux-3.3.8-x86_64: OK linux-3.4.27-x86_64: OK linux-3.5.7-x86_64: OK linux-3.6.11-x86_64: OK linux-3.7.4-x86_64: OK linux-3.8-x86_64: OK linux-3.9.2-x86_64: OK linux-3.10.1-x86_64: WARNINGS linux-3.11.1-x86_64: ERRORS linux-3.12.67-x86_64: ERRORS linux-3.13.11-x86_64: ERRORS linux-3.14.9-x86_64: WARNINGS linux-3.15.2-x86_64: WARNINGS linux-3.16.7-x86_64: WARNINGS linux-3.17.8-x86_64: WARNINGS linux-3.18.7-x86_64: WARNINGS linux-3.19-x86_64: WARNINGS linux-4.0.9-x86_64: WARNINGS linux-4.1.33-x86_64: WARNINGS linux-4.2.8-x86_64: WARNINGS linux-4.3.6-x86_64: WARNINGS linux-4.4.22-x86_64: WARNINGS linux-4.5.7-x86_64: WARNINGS linux-4.6.7-x86_64: WARNINGS linux-4.7.5-x86_64: WARNINGS linux-4.8-x86_64: WARNINGS linux-4.9-x86_64: WARNINGS linux-4.10.1-x86_64: WARNINGS linux-4.11-rc1-x86_64: OK apps: WARNINGS spec-git: OK sparse: WARNINGS Detailed results are available here: http://www.xs4all.nl/~hverkuil/logs/Friday.log Full logs are available here: http://www.xs4all.nl/~hverkuil/logs/Friday.tar.bz2 The Media Infrastructure API from this daily build is here: http://www.xs4all.nl/~hverkuil/spec/index.html
Re: [PATCH 1/3] dt-bindings: mt8173: Fix mdp device tree
On Wed, 2017-04-19 at 16:35 -0500, Rob Herring wrote: > On Thu, Apr 13, 2017 at 03:33:05PM +0800, Minghsiu Tsai wrote: > > If the mdp_* nodes are under an mdp sub-node, their corresponding > > platform device does not automatically get its iommu assigned properly. > > > > Fix this by moving the mdp component nodes up a level such that they are > > siblings of mdp and all other SoC subsystems. This also simplifies the > > device tree. > > It may simplify the DT, but it also breaks compatibility with old DT. > Not sure if that's a problem on Mediatek platforms, but please be > explicit here that you are breaking compatibility and why that is okay. > I will add the following description for more information. " Although it fixes iommu assignment issue, it also break compatibility with old device tree, so driver patch[1] is needed to iterate over sibling mdp device nodes, not child ones, to keep driver work properly. In mtk_mdp_probe() Old: for_each_child_of_node(dev->of_node, node) New: for_each_child_of_node(dev->of_node->parent, node) [1]https://patchwork.kernel.org/patch/9678833/ " > > > > Signed-off-by: Daniel Kurtz > > Signed-off-by: Minghsiu Tsai > > Should this have Daniel as the author? This patch is provided by Daniel, so I keep he is the author. I just split his patch into two parts. One is dts only, and the other is for driver. I also provide another patch to modify dts bindings according to this patch. > > > > > --- > > Documentation/devicetree/bindings/media/mediatek-mdp.txt | 12 +++- > > 1 file changed, 3 insertions(+), 9 deletions(-) > > > > diff --git a/Documentation/devicetree/bindings/media/mediatek-mdp.txt > > b/Documentation/devicetree/bindings/media/mediatek-mdp.txt > > index 4182063..0d03e3a 100644 > > --- a/Documentation/devicetree/bindings/media/mediatek-mdp.txt > > +++ b/Documentation/devicetree/bindings/media/mediatek-mdp.txt > > @@ -2,7 +2,7 @@ > > > > Media Data Path is used for scaling and color space conversion. > > > > -Required properties (controller (parent) node): > > +Required properties (controller node): > > - compatible: "mediatek,mt8173-mdp" > > - mediatek,vpu: the node of video processor unit, see > >Documentation/devicetree/bindings/media/mediatek-vpu.txt for details. > > @@ -32,21 +32,16 @@ Required properties (DMA function blocks, child node): > >for details. > > > > Example: > > -mdp { > > - compatible = "mediatek,mt8173-mdp"; > > - #address-cells = <2>; > > - #size-cells = <2>; > > - ranges; > > - mediatek,vpu = <&vpu>; > > - > > mdp_rdma0: rdma@14001000 { > > compatible = "mediatek,mt8173-mdp-rdma"; > > +"mediatek,mt8173-mdp"; > > reg = <0 0x14001000 0 0x1000>; > > clocks = <&mmsys CLK_MM_MDP_RDMA0>, > > <&mmsys CLK_MM_MUTEX_32K>; > > power-domains = <&scpsys MT8173_POWER_DOMAIN_MM>; > > iommus = <&iommu M4U_PORT_MDP_RDMA0>; > > mediatek,larb = <&larb0>; > > + mediatek,vpu = <&vpu>; > > }; > > > > mdp_rdma1: rdma@14002000 { > > @@ -106,4 +101,3 @@ mdp { > > iommus = <&iommu M4U_PORT_MDP_WROT1>; > > mediatek,larb = <&larb4>; > > }; > > -}; > > -- > > 1.9.1 > >
Re: [PATCH] [media] sti: hdmi: improve MEDIA_CEC_NOTIFIER dependency
On Wed, Apr 19, 2017 at 11:06 PM, Hans Verkuil wrote: > On 19/04/17 18:59, Arnd Bergmann wrote: >> When the media subsystem is built as a loadable module, a built-in >> This adds a Kconfig dependency to enforce the HDMI driver to also >> be a loadable module in this case. > > I've marked this patch and the exynos_hdmi patch as 'Obsoleted' in patchwork: > today several CEC Kconfig cleanup patches were merged that invalidate these > two patches. I expect they'll turn up soon in -next. I can confirm that the previous problems are fixed with today's linux-next, but I have now run into another problem, with CONFIG_INPUT=m forcing CONFIG_RC_CORE=m: drivers/media/cec/cec-core.o: In function `cec_unregister_adapter': cec-core.c:(.text.cec_unregister_adapter+0x18): undefined reference to `rc_unregister_device' drivers/media/cec/cec-core.o: In function `cec_delete_adapter': cec-core.c:(.text.cec_delete_adapter+0x54): undefined reference to `rc_free_device' drivers/media/cec/cec-core.o: In function `cec_register_adapter': cec-core.c:(.text.cec_register_adapter+0x94): undefined reference to `rc_register_device' cec-core.c:(.text.cec_register_adapter+0xa4): undefined reference to `rc_free_device' cec-core.c:(.text.cec_register_adapter+0x110): undefined reference to `rc_unregister_device' drivers/media/cec/cec-core.o: In function `cec_allocate_adapter': cec-core.c:(.text.cec_allocate_adapter+0x234): undefined reference to `rc_allocate_device' drivers/media/cec/cec-adap.o: In function `cec_received_msg': cec-adap.c:(.text.cec_received_msg+0x734): undefined reference to `rc_keydown' cec-adap.c:(.text.cec_received_msg+0x768): undefined reference to `rc_keyup' /git/arm-soc/Makefile:1033: recipe for target 'vmlinux' failed I don't see an obvious fix for this, and as you seem to have a good grip on the problem already, I'll let you figure out how to best address it. Arnd
Re: [PATCH v3 0/8] Add support for DCMI camera interface of STMicroelectronics STM32 SoC series
Hi Hans, v4 has been sent with "v4l2-compliance -s -f" report provided in cover letter. Bindings acked by Rob. http://www.mail-archive.com/linux-media@vger.kernel.org/msg111743.html BR, Hugues. On 04/10/2017 10:55 AM, Hans Verkuil wrote: > On 04/04/2017 05:44 PM, Hugues Fruchet wrote: >> This patchset introduces a basic support for Digital Camera Memory Interface >> (DCMI) of STMicroelectronics STM32 SoC series. >> >> This first basic support implements RGB565 & YUV frame grabbing. >> Cropping and JPEG support will be added later on. >> >> This has been tested on STM324x9I-EVAL evaluation board embedding >> an OV2640 camera sensor. >> >> This driver depends on: >> - [PATCHv6 00/14] atmel-isi/ov7670/ov2640: convert to standalone drivers >> http://www.spinics.net/lists/linux-media/msg113480.html >> >> === >> = history = >> === >> version 3: >> - stm32-dcmi: Add "Reviewed-by: Hans Verkuil " >> - dt-bindings: Fix remarks from Rob Herring: >> http://www.mail-archive.com/linux-media@vger.kernel.org/msg110956.html >> >> version 2: >> - Fix a Kbuild warning in probe: >> http://www.mail-archive.com/linux-media@vger.kernel.org/msg110678.html >> - Fix a warning in dcmi_queue_setup() >> - dt-bindings: warn on sensor signals level inversion in board example >> - Typos fixing >> >> version 1: >> - Initial submission >> >> === >> = v4l2-compliance = >> === >> Below is the v4l2-compliance report for this current version of the DCMI >> camera interface. >> v4l2-compliance has been built from v4l-utils-1.12.3. > > Please test with 'v4l2-compliance -s -f' as well and mail me the output of > that test. > > Once you have the Acks for the DT/bindings patches just let me know and I'll > make a pull request. > > Regards, > > Hans > >> >> v4l2-compliance SHA : f5f45e17ee98a0ebad7836ade2b34ceec909d751 >> >> Driver Info: >> Driver name : stm32-dcmi >> Card type : STM32 Digital Camera Memory Int >> Bus info : platform:dcmi >> Driver version: 4.11.0 >> Capabilities : 0x8521 >> Video Capture >> Read/Write >> Streaming >> Extended Pix Format >> Device Capabilities >> Device Caps : 0x0521 >> Video Capture >> Read/Write >> Streaming >> Extended Pix Format >> >> Compliance test for device /dev/video0 (not using libv4l2): >> >> Required ioctls: >> test VIDIOC_QUERYCAP: OK >> >> Allow for multiple opens: >> test second video open: OK >> test VIDIOC_QUERYCAP: OK >> test VIDIOC_G/S_PRIORITY: OK >> test for unlimited opens: OK >> >> Debug ioctls: >> test VIDIOC_DBG_G/S_REGISTER: OK (Not Supported) >> test VIDIOC_LOG_STATUS: OK >> >> Input ioctls: >> test VIDIOC_G/S_TUNER/ENUM_FREQ_BANDS: OK (Not Supported) >> test VIDIOC_G/S_FREQUENCY: OK (Not Supported) >> test VIDIOC_S_HW_FREQ_SEEK: OK (Not Supported) >> test VIDIOC_ENUMAUDIO: OK (Not Supported) >> test VIDIOC_G/S/ENUMINPUT: OK >> test VIDIOC_G/S_AUDIO: OK (Not Supported) >> Inputs: 1 Audio Inputs: 0 Tuners: 0 >> >> Output ioctls: >> test VIDIOC_G/S_MODULATOR: OK (Not Supported) >> test VIDIOC_G/S_FREQUENCY: OK (Not Supported) >> test VIDIOC_ENUMAUDOUT: OK (Not Supported) >> test VIDIOC_G/S/ENUMOUTPUT: OK (Not Supported) >> test VIDIOC_G/S_AUDOUT: OK (Not Supported) >> Outputs: 0 Audio Outputs: 0 Modulators: 0 >> >> Input/Output configuration ioctls: >> test VIDIOC_ENUM/G/S/QUERY_STD: OK (Not Supported) >> test VIDIOC_ENUM/G/S/QUERY_DV_TIMINGS: OK (Not Supported) >> test VIDIOC_DV_TIMINGS_CAP: OK (Not Supported) >> test VIDIOC_G/S_EDID: OK (Not Supported) >> >> Test input 0: >> >> Control ioctls: >> test VIDIOC_QUERY_EXT_CTRL/QUERYMENU: OK >> test VIDIOC_QUERYCTRL: OK >> test VIDIOC_G/S_CTRL: OK >> test VIDIOC_G/S/TRY_EXT_CTRLS: OK >> test VIDIOC_(UN)SUBSCRIBE_EVENT/DQEVENT: OK >> test VIDIOC_G/S_JPEGCOMP: OK (Not Supported) >> Standard Controls: 3 Private Controls: 0 >> >> Format ioctls: >> test VIDIOC_ENUM_FMT/FRAMESIZES/FRAMEINTERVALS: OK >> test VIDIOC_G/S_PARM: OK (Not Supported) >> test VIDIOC_G_FBUF: OK (Not Supported) >> test VIDIOC_G_FMT: OK >> test VIDIOC_TRY_FMT: OK >> test VIDIOC_S_FMT: OK >> test VIDIOC_G_SLICED_VBI_CAP: OK (Not Supported) >> test Cropping: OK (Not Supported) >> test Composing: OK (Not Supported) >> test Scaling: OK >> >> Codec ioctls: >> test VIDIOC_(TRY_)ENCODER_CMD: OK (
[PATCH v4 3/8] ARM: dts: stm32: Enable DCMI support on STM32F429 MCU
Enable DCMI camera interface on STM32F429 MCU. Signed-off-by: Hugues Fruchet --- arch/arm/boot/dts/stm32f429.dtsi | 37 + 1 file changed, 37 insertions(+) diff --git a/arch/arm/boot/dts/stm32f429.dtsi b/arch/arm/boot/dts/stm32f429.dtsi index ee0da97..e1ff978 100644 --- a/arch/arm/boot/dts/stm32f429.dtsi +++ b/arch/arm/boot/dts/stm32f429.dtsi @@ -736,6 +736,29 @@ slew-rate = <3>; }; }; + + dcmi_pins: dcmi_pins@0 { + pins { + pinmux = , + , + , +, +, +, +, +, +, +, +, +, +, +, +; + bias-disable; + drive-push-pull; + slew-rate = <3>; + }; + }; }; rcc: rcc@40023810 { @@ -805,6 +828,20 @@ status = "disabled"; }; + dcmi: dcmi@5005 { + compatible = "st,stm32-dcmi"; + reg = <0x5005 0x400>; + interrupts = <78>; + resets = <&rcc STM32F4_AHB2_RESET(DCMI)>; + clocks = <&rcc 0 STM32F4_AHB2_CLOCK(DCMI)>; + clock-names = "mclk"; + pinctrl-names = "default"; + pinctrl-0 = <&dcmi_pins>; + dmas = <&dma2 1 1 0x414 0x3>; + dma-names = "tx"; + status = "disabled"; + }; + rng: rng@50060800 { compatible = "st,stm32-rng"; reg = <0x50060800 0x400>; -- 1.9.1
[PATCH v4 4/8] ARM: dts: stm32: Enable DCMI camera interface on STM32F429-EVAL board
Enable DCMI camera interface on STM32F429-EVAL board. Signed-off-by: Hugues Fruchet --- arch/arm/boot/dts/stm32429i-eval.dts | 9 + 1 file changed, 9 insertions(+) diff --git a/arch/arm/boot/dts/stm32429i-eval.dts b/arch/arm/boot/dts/stm32429i-eval.dts index 3c99466..617f2f7 100644 --- a/arch/arm/boot/dts/stm32429i-eval.dts +++ b/arch/arm/boot/dts/stm32429i-eval.dts @@ -141,6 +141,15 @@ clock-frequency = <2500>; }; +&dcmi { + status = "okay"; + + port { + dcmi_0: endpoint { + }; + }; +}; + &i2c1 { pinctrl-0 = <&i2c1_pins>; pinctrl-names = "default"; -- 1.9.1
[PATCH v4 8/8] ARM: configs: stm32: DCMI + OV2640 camera support
Enable DCMI camera interface and OV2640 camera sensor drivers. Signed-off-by: Hugues Fruchet --- arch/arm/configs/stm32_defconfig | 7 +++ 1 file changed, 7 insertions(+) diff --git a/arch/arm/configs/stm32_defconfig b/arch/arm/configs/stm32_defconfig index 84adc88..3f2e4ce 100644 --- a/arch/arm/configs/stm32_defconfig +++ b/arch/arm/configs/stm32_defconfig @@ -53,6 +53,13 @@ CONFIG_GPIO_STMPE=y CONFIG_MFD_STMPE=y CONFIG_REGULATOR_FIXED_VOLTAGE=y # CONFIG_USB_SUPPORT is not set +CONFIG_VIDEO_V4L2=y +CONFIG_MEDIA_SUBDRV_AUTOSELECT=n +CONFIG_V4L_PLATFORM_DRIVERS=y +CONFIG_MEDIA_SUPPORT=y +CONFIG_MEDIA_CAMERA_SUPPORT=y +CONFIG_VIDEO_STM32_DCMI=y +CONFIG_VIDEO_OV2640=y CONFIG_NEW_LEDS=y CONFIG_LEDS_CLASS=y CONFIG_LEDS_GPIO=y -- 1.9.1
[PATCH v4 5/8] ARM: dts: stm32: Enable STMPE1600 gpio expander of STM32F429-EVAL board
Enable STMPE1600 gpio expander of STM32F429-EVAL board. Signed-off-by: Hugues Fruchet --- arch/arm/boot/dts/stm32429i-eval.dts | 17 + 1 file changed, 17 insertions(+) diff --git a/arch/arm/boot/dts/stm32429i-eval.dts b/arch/arm/boot/dts/stm32429i-eval.dts index 617f2f7..2bb8a0f 100644 --- a/arch/arm/boot/dts/stm32429i-eval.dts +++ b/arch/arm/boot/dts/stm32429i-eval.dts @@ -154,6 +154,23 @@ pinctrl-0 = <&i2c1_pins>; pinctrl-names = "default"; status = "okay"; + + stmpe1600: stmpe1600@42 { + compatible = "st,stmpe1600"; + reg = <0x42>; + irq-gpio = <&gpioi 8 0>; + irq-trigger = <3>; + interrupts = <8 3>; + interrupt-parent = <&exti>; + interrupt-controller; + wakeup-source; + + stmpegpio: stmpe_gpio { + compatible = "st,stmpe-gpio"; + gpio-controller; + #gpio-cells = <2>; + }; + }; }; &mac { -- 1.9.1
[PATCH v4 7/8] ARM: configs: stm32: STMPE1600 GPIO expander
Enable STMPE1600 GPIO expander. Signed-off-by: Hugues Fruchet --- arch/arm/configs/stm32_defconfig | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/arm/configs/stm32_defconfig b/arch/arm/configs/stm32_defconfig index a9d8e3c..84adc88 100644 --- a/arch/arm/configs/stm32_defconfig +++ b/arch/arm/configs/stm32_defconfig @@ -49,6 +49,8 @@ CONFIG_SERIAL_STM32_CONSOLE=y # CONFIG_HW_RANDOM is not set # CONFIG_HWMON is not set CONFIG_REGULATOR=y +CONFIG_GPIO_STMPE=y +CONFIG_MFD_STMPE=y CONFIG_REGULATOR_FIXED_VOLTAGE=y # CONFIG_USB_SUPPORT is not set CONFIG_NEW_LEDS=y -- 1.9.1
[PATCH v4 6/8] ARM: dts: stm32: Enable OV2640 camera support of STM32F429-EVAL board
Enable OV2640 camera support of STM32F429-EVAL board. Signed-off-by: Hugues Fruchet --- arch/arm/boot/dts/stm32429i-eval.dts | 30 ++ 1 file changed, 30 insertions(+) diff --git a/arch/arm/boot/dts/stm32429i-eval.dts b/arch/arm/boot/dts/stm32429i-eval.dts index 2bb8a0f..95c33b1 100644 --- a/arch/arm/boot/dts/stm32429i-eval.dts +++ b/arch/arm/boot/dts/stm32429i-eval.dts @@ -48,6 +48,7 @@ /dts-v1/; #include "stm32f429.dtsi" #include +#include / { model = "STMicroelectronics STM32429i-EVAL board"; @@ -66,6 +67,14 @@ serial0 = &usart1; }; + clocks { + clk_ext_camera: clk-ext-camera { + #clock-cells = <0>; + compatible = "fixed-clock"; + clock-frequency = <2400>; + }; + }; + soc { dma-ranges = <0xc000 0x0 0x1000>; }; @@ -146,6 +155,11 @@ port { dcmi_0: endpoint { + remote-endpoint = <&ov2640_0>; + bus-width = <8>; + hsync-active = <0>; + vsync-active = <0>; + pclk-sample = <1>; }; }; }; @@ -155,6 +169,22 @@ pinctrl-names = "default"; status = "okay"; + ov2640: camera@30 { + compatible = "ovti,ov2640"; + reg = <0x30>; + resetb-gpios = <&stmpegpio 2 GPIO_ACTIVE_HIGH>; + pwdn-gpios = <&stmpegpio 0 GPIO_ACTIVE_LOW>; + clocks = <&clk_ext_camera>; + clock-names = "xvclk"; + status = "okay"; + + port { + ov2640_0: endpoint { + remote-endpoint = <&dcmi_0>; + }; + }; + }; + stmpe1600: stmpe1600@42 { compatible = "st,stmpe1600"; reg = <0x42>; -- 1.9.1
[PATCH v4 1/8] dt-bindings: Document STM32 DCMI bindings
This adds documentation of device tree bindings for the STM32 DCMI (Digital Camera Memory Interface). Acked-by: Rob Herring Signed-off-by: Hugues Fruchet --- .../devicetree/bindings/media/st,stm32-dcmi.txt| 46 ++ 1 file changed, 46 insertions(+) create mode 100644 Documentation/devicetree/bindings/media/st,stm32-dcmi.txt diff --git a/Documentation/devicetree/bindings/media/st,stm32-dcmi.txt b/Documentation/devicetree/bindings/media/st,stm32-dcmi.txt new file mode 100644 index 000..f8baf65 --- /dev/null +++ b/Documentation/devicetree/bindings/media/st,stm32-dcmi.txt @@ -0,0 +1,46 @@ +STMicroelectronics STM32 Digital Camera Memory Interface (DCMI) + +Required properties: +- compatible: "st,stm32-dcmi" +- reg: physical base address and length of the registers set for the device +- interrupts: should contain IRQ line for the DCMI +- resets: reference to a reset controller, + see Documentation/devicetree/bindings/reset/st,stm32-rcc.txt +- clocks: list of clock specifiers, corresponding to entries in + the clock-names property +- clock-names: must contain "mclk", which is the DCMI peripherial clock +- pinctrl: the pincontrol settings to configure muxing properly + for pins that connect to DCMI device. + See Documentation/devicetree/bindings/pinctrl/st,stm32-pinctrl.txt. +- dmas: phandle to DMA controller node, +see Documentation/devicetree/bindings/dma/stm32-dma.txt +- dma-names: must contain "tx", which is the transmit channel from DCMI to DMA + +DCMI supports a single port node with parallel bus. It should contain one +'port' child node with child 'endpoint' node. Please refer to the bindings +defined in Documentation/devicetree/bindings/media/video-interfaces.txt. + +Example: + + dcmi: dcmi@5005 { + compatible = "st,stm32-dcmi"; + reg = <0x5005 0x400>; + interrupts = <78>; + resets = <&rcc STM32F4_AHB2_RESET(DCMI)>; + clocks = <&rcc 0 STM32F4_AHB2_CLOCK(DCMI)>; + clock-names = "mclk"; + pinctrl-names = "default"; + pinctrl-0 = <&dcmi_pins>; + dmas = <&dma2 1 1 0x414 0x3>; + dma-names = "tx"; + port { + dcmi_0: endpoint { + remote-endpoint = <...>; + bus-width = <8>; + hsync-active = <0>; + vsync-active = <0>; + pclk-sample = <1>; + }; + }; + }; + -- 1.9.1
[PATCH v4 2/8] [media] stm32-dcmi: STM32 DCMI camera interface driver
This V4L2 subdev driver enables Digital Camera Memory Interface (DCMI) of STMicroelectronics STM32 SoC series. Reviewed-by: Hans Verkuil Signed-off-by: Yannick Fertre Signed-off-by: Hugues Fruchet --- drivers/media/platform/Kconfig| 12 + drivers/media/platform/Makefile |2 + drivers/media/platform/stm32/Makefile |1 + drivers/media/platform/stm32/stm32-dcmi.c | 1419 + 4 files changed, 1434 insertions(+) create mode 100644 drivers/media/platform/stm32/Makefile create mode 100644 drivers/media/platform/stm32/stm32-dcmi.c diff --git a/drivers/media/platform/Kconfig b/drivers/media/platform/Kconfig index ac026ee..de6e18b 100644 --- a/drivers/media/platform/Kconfig +++ b/drivers/media/platform/Kconfig @@ -114,6 +114,18 @@ config VIDEO_S3C_CAMIF To compile this driver as a module, choose M here: the module will be called s3c-camif. +config VIDEO_STM32_DCMI + tristate "Digital Camera Memory Interface (DCMI) support" + depends on VIDEO_V4L2 && OF && HAS_DMA + depends on ARCH_STM32 || COMPILE_TEST + select VIDEOBUF2_DMA_CONTIG + ---help--- + This module makes the STM32 Digital Camera Memory Interface (DCMI) + available as a v4l2 device. + + To compile this driver as a module, choose M here: the module + will be called stm32-dcmi. + source "drivers/media/platform/soc_camera/Kconfig" source "drivers/media/platform/exynos4-is/Kconfig" source "drivers/media/platform/am437x/Kconfig" diff --git a/drivers/media/platform/Makefile b/drivers/media/platform/Makefile index 63303d6..231f3c2 100644 --- a/drivers/media/platform/Makefile +++ b/drivers/media/platform/Makefile @@ -68,6 +68,8 @@ obj-$(CONFIG_VIDEO_RCAR_VIN) += rcar-vin/ obj-$(CONFIG_VIDEO_ATMEL_ISC) += atmel/ obj-$(CONFIG_VIDEO_ATMEL_ISI) += atmel/ +obj-$(CONFIG_VIDEO_STM32_DCMI) += stm32/ + ccflags-y += -I$(srctree)/drivers/media/i2c obj-$(CONFIG_VIDEO_MEDIATEK_VPU) += mtk-vpu/ diff --git a/drivers/media/platform/stm32/Makefile b/drivers/media/platform/stm32/Makefile new file mode 100644 index 000..9b606a7 --- /dev/null +++ b/drivers/media/platform/stm32/Makefile @@ -0,0 +1 @@ +obj-$(CONFIG_VIDEO_STM32_DCMI) += stm32-dcmi.o diff --git a/drivers/media/platform/stm32/stm32-dcmi.c b/drivers/media/platform/stm32/stm32-dcmi.c new file mode 100644 index 000..0ed3bd9 --- /dev/null +++ b/drivers/media/platform/stm32/stm32-dcmi.c @@ -0,0 +1,1419 @@ +/* + * Driver for STM32 Digital Camera Memory Interface + * + * Copyright (C) STMicroelectronics SA 2017 + * Authors: Yannick Fertre + * Hugues Fruchet + * for STMicroelectronics. + * License terms: GNU General Public License (GPL), version 2 + * + * This driver is based on atmel_isi.c + * + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#define DRV_NAME "stm32-dcmi" + +/* Registers offset for DCMI */ +#define DCMI_CR0x00 /* Control Register */ +#define DCMI_SR0x04 /* Status Register */ +#define DCMI_RIS 0x08 /* Raw Interrupt Status register */ +#define DCMI_IER 0x0C /* Interrupt Enable Register */ +#define DCMI_MIS 0x10 /* Masked Interrupt Status register */ +#define DCMI_ICR 0x14 /* Interrupt Clear Register */ +#define DCMI_ESCR 0x18 /* Embedded Synchronization Code Register */ +#define DCMI_ESUR 0x1C /* Embedded Synchronization Unmask Register */ +#define DCMI_CWSTRT0x20 /* Crop Window STaRT */ +#define DCMI_CWSIZE0x24 /* Crop Window SIZE */ +#define DCMI_DR0x28 /* Data Register */ +#define DCMI_IDR 0x2C /* IDentifier Register */ + +/* Bits definition for control register (DCMI_CR) */ +#define CR_CAPTURE BIT(0) +#define CR_CM BIT(1) +#define CR_CROPBIT(2) +#define CR_JPEGBIT(3) +#define CR_ESS BIT(4) +#define CR_PCKPOL BIT(5) +#define CR_HSPOL BIT(6) +#define CR_VSPOL BIT(7) +#define CR_FCRC_0 BIT(8) +#define CR_FCRC_1 BIT(9) +#define CR_EDM_0 BIT(10) +#define CR_EDM_1 BIT(11) +#define CR_ENABLE BIT(14) + +/* Bits definition for status register (DCMI_SR) */ +#define SR_HSYNC BIT(0) +#define SR_VSYNC BIT(1) +#define SR_FNE BIT(2) + +/* + * Bits definition for interrupt registers + * (DCMI_RIS, DCMI_IER, DCMI_MIS, DCMI_ICR) + */ +#define IT_FRAME BIT(0) +#define IT_OVR BIT(1) +#define IT_ERR BIT(2) +#define IT_VSYNC BIT(3) +#define IT_LINEBIT(4) + +enum state { + STOPPED = 0, + RUNNING, + STOPPING, +}; + +#define MAX_BUS_WIDTH 14 +#define MAX_SUPPORT_WIDTH 2048 +#define MAX_SUPPORT_HEIGHT 2048 +#define MIN_SUPPORT_
[PATCH v4 0/8] Add support for DCMI camera interface of STMicroelectronics STM32 SoC series
This patchset introduces a basic support for Digital Camera Memory Interface (DCMI) of STMicroelectronics STM32 SoC series. This first basic support implements RGB565 & YUV frame grabbing. Cropping and JPEG support will be added later on. This has been tested on STM324x9I-EVAL evaluation board embedding an OV2640 camera sensor. This driver depends on: - [PATCHv6 00/14] atmel-isi/ov7670/ov2640: convert to standalone drivers http://www.spinics.net/lists/linux-media/msg113480.html === = history = === version 4: - "v4l2-compliance -s -f" report - fix behaviour in case of start_streaming failure (DMA memory shortage for ex.) - dt-bindings: Fix remarks from Rob Herring: http://www.mail-archive.com/linux-media@vger.kernel.org/msg111340.html Add "Acked-by: Rob Herring " version 3: - stm32-dcmi: Add "Reviewed-by: Hans Verkuil " - dt-bindings: Fix remarks from Rob Herring: http://www.mail-archive.com/linux-media@vger.kernel.org/msg110956.html version 2: - Fix a Kbuild warning in probe: http://www.mail-archive.com/linux-media@vger.kernel.org/msg110678.html - Fix a warning in dcmi_queue_setup() - dt-bindings: warn on sensor signals level inversion in board example - Typos fixing version 1: - Initial submission === = v4l2-compliance = === Below is the v4l2-compliance report for this current version of the DCMI camera interface. v4l2-compliance has been built from v4l-utils-1.12.3. ~ # v4l2-compliance -s -f -d /dev/video0 v4l2-compliance SHA : f5f45e17ee98a0ebad7836ade2b34ceec909d751 Driver Info: Driver name : stm32-dcmi Card type : STM32 Digital Camera Memory Int Bus info : platform:dcmi Driver version: 4.11.0 Capabilities : 0x8521 Video Capture Read/Write Streaming Extended Pix Format Device Capabilities Device Caps : 0x0521 Video Capture Read/Write Streaming Extended Pix Format Compliance test for device /dev/video0 (not using libv4l2): Required ioctls: test VIDIOC_QUERYCAP: OK Allow for multiple opens: test second video open: OK test VIDIOC_QUERYCAP: OK test VIDIOC_G/S_PRIORITY: OK test for unlimited opens: OK Debug ioctls: test VIDIOC_DBG_G/S_REGISTER: OK (Not Supported) test VIDIOC_LOG_STATUS: OK Input ioctls: test VIDIOC_G/S_TUNER/ENUM_FREQ_BANDS: OK (Not Supported) test VIDIOC_G/S_FREQUENCY: OK (Not Supported) test VIDIOC_S_HW_FREQ_SEEK: OK (Not Supported) test VIDIOC_ENUMAUDIO: OK (Not Supported) test VIDIOC_G/S/ENUMINPUT: OK test VIDIOC_G/S_AUDIO: OK (Not Supported) Inputs: 1 Audio Inputs: 0 Tuners: 0 Output ioctls: test VIDIOC_G/S_MODULATOR: OK (Not Supported) test VIDIOC_G/S_FREQUENCY: OK (Not Supported) test VIDIOC_ENUMAUDOUT: OK (Not Supported) test VIDIOC_G/S/ENUMOUTPUT: OK (Not Supported) test VIDIOC_G/S_AUDOUT: OK (Not Supported) Outputs: 0 Audio Outputs: 0 Modulators: 0 Input/Output configuration ioctls: test VIDIOC_ENUM/G/S/QUERY_STD: OK (Not Supported) test VIDIOC_ENUM/G/S/QUERY_DV_TIMINGS: OK (Not Supported) test VIDIOC_DV_TIMINGS_CAP: OK (Not Supported) test VIDIOC_G/S_EDID: OK (Not Supported) Test input 0: Control ioctls: test VIDIOC_QUERY_EXT_CTRL/QUERYMENU: OK test VIDIOC_QUERYCTRL: OK test VIDIOC_G/S_CTRL: OK test VIDIOC_G/S/TRY_EXT_CTRLS: OK test VIDIOC_(UN)SUBSCRIBE_EVENT/DQEVENT: OK test VIDIOC_G/S_JPEGCOMP: OK (Not Supported) Standard Controls: 3 Private Controls: 0 Format ioctls: test VIDIOC_ENUM_FMT/FRAMESIZES/FRAMEINTERVALS: OK test VIDIOC_G/S_PARM: OK (Not Supported) test VIDIOC_G_FBUF: OK (Not Supported) test VIDIOC_G_FMT: OK test VIDIOC_TRY_FMT: OK test VIDIOC_S_FMT: OK test VIDIOC_G_SLICED_VBI_CAP: OK (Not Supported) test Cropping: OK (Not Supported) test Composing: OK (Not Supported) test Scaling: OK Codec ioctls: test VIDIOC_(TRY_)ENCODER_CMD: OK (Not Supported) test VIDIOC_G_ENC_INDEX: OK (Not Supported) test VIDIOC_(TRY_)DECODER_CMD: OK (Not Supported) Buffer ioctls: test VIDIOC_REQBUFS/CREATE_BUFS/QUERYBUF: OK test VIDIOC_EXPBUF: OK Test input 0: Streaming ioctls: test read/write: OK test MMAP: OK test USERPTR: OK (Not Supported) test DMABUF: Cannot test, specify --expbuf-device Stream using all formats: test MMAP
Re: TW686x Linux Main Line Driver Issue
On 20 April 2017 at 07:10, Anuradha Ranasinghe wrote: > Dear All, > > This issue is associated to the Linux Mainline Kernel 4.1.15.2 (branch2) > tw686x upstream driver and IMX6Q platform. > > We have an analog camera capture board (a custom one) based around tw6865. > We are interfacing it with Nitrogen6_Max board (IMX6Q) . We use the > aforementioned kernel with the boundary devices latest patches to the tw686x > driver (having 3 DMA buffers) and system running on Ubuntu 16 Xenial Mate > version. > https://github.com/boundarydevices/linux-imx6/commits/7fcd22da6d731b36e5ab856551c41301fca9881f > > The driver initialization, device and composite signal detection work well > as intended. But when the streaming started, frame rate becomes lower and > after few frames, the whole system freezes. To get the camera to work to > this level, we had to do : > What dma-mode are you using? Have you tried other dma-modes? How many frames do you manage to obtain? I believe you should debug this further and provide more information. > 1. Disable PCI interrupts from the kernel (from menuconfig and pci=nomsi > kernel command) (CCing PCI people) Lucas, Richard: any idea about why is this parameter needed? > 2. Set Coherent_Pool to 128M in boot args to get the memory allocation for > driver. Without this driver does not enumerate. > Hm.. interesting. > I can confirm that there is no issue in our hardware. I strictly followed > the free scale data sheet recommendations. So I have few questions needing > your answers : > >> Have you guys tried this driver for tw6865 or a related chip on same root >> fs ? If not can you kindly mention the operating condition you had ? FWIW, I have tested tw6869 on x86_64. It works well here, but only using dma-mode=memcpy, as documented here: http://lxr.free-electrons.com/source/drivers/media/pci/tw686x/tw686x-core.c#L19 >> Is attached patch required for higher kernel versions (4.1.15) to support >> DMA accessing ? I have no idea about that patch. The patch has nothing to do with tw686x, but it's i.MX6 platform-specific, you should ask the author. >> Is there any additional settings (cma allocation, memory mapping) required >> for this newer kernel ? That depends on your platform and usage. >> I use the pipeline : > gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw,width=720,height=480 > ! autovideosink > for an unknown reason, imxv4l2videosrc does not work at all for this pcie > camera. > You need to ask imxv4l2videosrc's authors. -- Ezequiel GarcĂa, VanguardiaSur www.vanguardiasur.com.ar
Fwd: uvcvideo extension controls
-- Forwarded message -- From: Paulo Assis Date: 2017-04-20 12:04 GMT+01:00 Subject: uvcvideo extension controls To: Laurent Pinchart Cc: Linux Media Mailing List , aUDIo Laurent Hi, I've just noticed that uvcvideo extension controls no longer work properly, for instance for a logitech c930e I have the 'UVC_GUID_LOGITECH_PERIPHERAL': VideoControl Interface Descriptor: bLength28 bDescriptorType36 bDescriptorSubtype 6 (EXTENSION_UNIT) bUnitID11 guidExtensionCode {212de5ff-3080-2c4e-82d9-f587d00540bd} bNumControl 3 bNrPins 1 baSourceID( 0) 10 bControlSize3 bmControls( 0) 0x00 bmControls( 1) 0x41 bmControls( 2) 0x01 iExtension 0 when I try to map or query the controls associated with this GUID (like the LED control) I get a ENOENT error, the same applies for other GUID, although some, like the h264 extension, will work just fine: VideoControl Interface Descriptor: bLength27 bDescriptorType36 bDescriptorSubtype 6 (EXTENSION_UNIT) bUnitID12 guidExtensionCode {41769ea2-04de-e347-8b2b-f4341aff003b} bNumControl11 bNrPins 1 baSourceID( 0) 3 bControlSize2 bmControls( 0) 0x07 bmControls( 1) 0x7f iExtension 0 'uvcdynctrl --device=/dev/video1 --get_raw=12:1' returns without error: query control size of : 46 query control flags of: 0x3 These mappings were working just fine in previous kernels, did something changed in the uvc extension control API, or do you think this is just a bug in the driver? Regards, Paulo
[PATCH] [media] atmel-isc: Set the default DMA memory burst size
Sometimes 'DMA single access' is not enough to transfer a frame of image, '8-beat burst access' is set as the default DMA memory burst size. Signed-off-by: Songjun Wu --- drivers/media/platform/atmel/atmel-isc.c | 23 --- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/drivers/media/platform/atmel/atmel-isc.c b/drivers/media/platform/atmel/atmel-isc.c index c4b2115559a5..78d966233f80 100644 --- a/drivers/media/platform/atmel/atmel-isc.c +++ b/drivers/media/platform/atmel/atmel-isc.c @@ -239,13 +239,11 @@ static struct isc_format isc_formats[] = { { V4L2_PIX_FMT_YUV420, 0x0, 12, ISC_PFE_CFG0_BPS_EIGHT, ISC_BAY_CFG_BGBG, ISC_RLP_CFG_MODE_YYCC, - ISC_DCFG_IMODE_YC420P | ISC_DCFG_YMBSIZE_BEATS8 | - ISC_DCFG_CMBSIZE_BEATS8, ISC_DCTRL_DVIEW_PLANAR, 0x7fb, + ISC_DCFG_IMODE_YC420P, ISC_DCTRL_DVIEW_PLANAR, 0x7fb, false, false }, { V4L2_PIX_FMT_YUV422P, 0x0, 16, ISC_PFE_CFG0_BPS_EIGHT, ISC_BAY_CFG_BGBG, ISC_RLP_CFG_MODE_YYCC, - ISC_DCFG_IMODE_YC422P | ISC_DCFG_YMBSIZE_BEATS8 | - ISC_DCFG_CMBSIZE_BEATS8, ISC_DCTRL_DVIEW_PLANAR, 0x3fb, + ISC_DCFG_IMODE_YC422P, ISC_DCTRL_DVIEW_PLANAR, 0x3fb, false, false }, { V4L2_PIX_FMT_RGB565, MEDIA_BUS_FMT_RGB565_2X8_LE, 16, ISC_PFE_CFG0_BPS_EIGHT, ISC_BAY_CFG_BGBG, ISC_RLP_CFG_MODE_RGB565, @@ -700,8 +698,10 @@ static void isc_set_histogram(struct isc_device *isc) } static inline void isc_get_param(const struct isc_format *fmt, -u32 *rlp_mode, u32 *dcfg_imode) + u32 *rlp_mode, u32 *dcfg) { + *dcfg = ISC_DCFG_YMBSIZE_BEATS8; + switch (fmt->fourcc) { case V4L2_PIX_FMT_SBGGR10: case V4L2_PIX_FMT_SGBRG10: @@ -712,11 +712,11 @@ static inline void isc_get_param(const struct isc_format *fmt, case V4L2_PIX_FMT_SGRBG12: case V4L2_PIX_FMT_SRGGB12: *rlp_mode = fmt->reg_rlp_mode; - *dcfg_imode = fmt->reg_dcfg_imode; + *dcfg |= fmt->reg_dcfg_imode; break; default: *rlp_mode = ISC_RLP_CFG_MODE_DAT8; - *dcfg_imode = ISC_DCFG_IMODE_PACKED8; + *dcfg |= ISC_DCFG_IMODE_PACKED8; break; } } @@ -726,18 +726,19 @@ static int isc_configure(struct isc_device *isc) struct regmap *regmap = isc->regmap; const struct isc_format *current_fmt = isc->current_fmt; struct isc_subdev_entity *subdev = isc->current_subdev; - u32 pfe_cfg0, rlp_mode, dcfg_imode, mask, pipeline; + u32 pfe_cfg0, rlp_mode, dcfg, mask, pipeline; if (sensor_is_preferred(current_fmt)) { pfe_cfg0 = current_fmt->reg_bps; pipeline = 0x0; - isc_get_param(current_fmt, &rlp_mode, &dcfg_imode); + isc_get_param(current_fmt, &rlp_mode, &dcfg); isc->ctrls.hist_stat = HIST_INIT; } else { pfe_cfg0 = isc->raw_fmt->reg_bps; pipeline = current_fmt->pipeline; rlp_mode = current_fmt->reg_rlp_mode; - dcfg_imode = current_fmt->reg_dcfg_imode; + dcfg = current_fmt->reg_dcfg_imode | ISC_DCFG_YMBSIZE_BEATS8 | + ISC_DCFG_CMBSIZE_BEATS8; } pfe_cfg0 |= subdev->pfe_cfg0 | ISC_PFE_CFG0_MODE_PROGRESSIVE; @@ -750,7 +751,7 @@ static int isc_configure(struct isc_device *isc) regmap_update_bits(regmap, ISC_RLP_CFG, ISC_RLP_CFG_MODE_MASK, rlp_mode); - regmap_update_bits(regmap, ISC_DCFG, ISC_DCFG_IMODE_MASK, dcfg_imode); + regmap_write(regmap, ISC_DCFG, dcfg); /* Set the pipeline */ isc_set_pipeline(isc, pipeline); -- 2.11.0
Re: [Intel-gfx] [PATCH v2] dma-buf: Rename dma-ops to prevent conflict with kunmap_atomic macro
Hi Marek, Thanks! On 20 April 2017 at 13:36, Marek Szyprowski wrote: > Hi All, > > On 2017-04-20 09:51, Daniel Vetter wrote: >> >> On Wed, Apr 19, 2017 at 01:36:10PM -0600, Logan Gunthorpe wrote: >>> >>> Seeing the kunmap_atomic dma_buf_ops share the same name with a macro >>> in highmem.h, the former can be aliased if any dma-buf user includes >>> that header. >>> >>> I'm personally trying to include highmem.h inside scatterlist.h and this >>> breaks the dma-buf code proper. >>> >>> Christoph Hellwig suggested [1] renaming it and pushing this patch ASAP. >>> >>> To maintain consistency I've renamed all four of kmap* and kunmap* to be >>> map* and unmap*. (Even though only kmap_atomic presently conflicts.) >>> >>> [1] https://www.spinics.net/lists/target-devel/msg15070.html >>> >>> Signed-off-by: Logan Gunthorpe >>> Reviewed-by: Sinclair Yeh >> >> Acked-by: Daniel Vetter >> >> Probably simplest if we pull this in through the drm-misc tree for 4.12. >> Can we have an ack for the v4l side for that pls? > > > For the V4L2/videobuf2: > Acked-by: Marek Szyprowski > I will queue it up for drm-misc-fixes so it gets into 4.12. > > >> Thanks, Daniel Best, Sumit. >>> >>> --- >>> >>> Changes since v1: >>> >>> - Added the missing tegra driver (noticed by kbuild robot) >>> - Rebased off of drm-intel-next to get the i915 selftest that is new >>> - Fixed nits Sinclair pointed out. >>> >>> drivers/dma-buf/dma-buf.c | 16 >>> drivers/gpu/drm/armada/armada_gem.c| 8 >>> drivers/gpu/drm/drm_prime.c| 8 >>> drivers/gpu/drm/i915/i915_gem_dmabuf.c | 8 >>> drivers/gpu/drm/i915/selftests/mock_dmabuf.c | 8 >>> drivers/gpu/drm/omapdrm/omap_gem_dmabuf.c | 8 >>> drivers/gpu/drm/tegra/gem.c| 8 >>> drivers/gpu/drm/udl/udl_dmabuf.c | 8 >>> drivers/gpu/drm/vmwgfx/vmwgfx_prime.c | 8 >>> drivers/media/v4l2-core/videobuf2-dma-contig.c | 4 ++-- >>> drivers/media/v4l2-core/videobuf2-dma-sg.c | 4 ++-- >>> drivers/media/v4l2-core/videobuf2-vmalloc.c| 4 ++-- >>> drivers/staging/android/ion/ion.c | 8 >>> include/linux/dma-buf.h| 22 >>> +++--- >>> 14 files changed, 61 insertions(+), 61 deletions(-) >>> >>> diff --git a/drivers/dma-buf/dma-buf.c b/drivers/dma-buf/dma-buf.c >>> index f72aaac..512bdbc 100644 >>> --- a/drivers/dma-buf/dma-buf.c >>> +++ b/drivers/dma-buf/dma-buf.c >>> @@ -405,8 +405,8 @@ struct dma_buf *dma_buf_export(const struct >>> dma_buf_export_info *exp_info) >>> || !exp_info->ops->map_dma_buf >>> || !exp_info->ops->unmap_dma_buf >>> || !exp_info->ops->release >>> - || !exp_info->ops->kmap_atomic >>> - || !exp_info->ops->kmap >>> + || !exp_info->ops->map_atomic >>> + || !exp_info->ops->map >>> || !exp_info->ops->mmap)) { >>> return ERR_PTR(-EINVAL); >>> } >>> @@ -872,7 +872,7 @@ void *dma_buf_kmap_atomic(struct dma_buf *dmabuf, >>> unsigned long page_num) >>> { >>> WARN_ON(!dmabuf); >>> >>> - return dmabuf->ops->kmap_atomic(dmabuf, page_num); >>> + return dmabuf->ops->map_atomic(dmabuf, page_num); >>> } >>> EXPORT_SYMBOL_GPL(dma_buf_kmap_atomic); >>> >>> @@ -889,8 +889,8 @@ void dma_buf_kunmap_atomic(struct dma_buf *dmabuf, >>> unsigned long page_num, >>> { >>> WARN_ON(!dmabuf); >>> >>> - if (dmabuf->ops->kunmap_atomic) >>> - dmabuf->ops->kunmap_atomic(dmabuf, page_num, vaddr); >>> + if (dmabuf->ops->unmap_atomic) >>> + dmabuf->ops->unmap_atomic(dmabuf, page_num, vaddr); >>> } >>> EXPORT_SYMBOL_GPL(dma_buf_kunmap_atomic); >>> >>> @@ -907,7 +907,7 @@ void *dma_buf_kmap(struct dma_buf *dmabuf, unsigned >>> long page_num) >>> { >>> WARN_ON(!dmabuf); >>> >>> - return dmabuf->ops->kmap(dmabuf, page_num); >>> + return dmabuf->ops->map(dmabuf, page_num); >>> } >>> EXPORT_SYMBOL_GPL(dma_buf_kmap); >>> >>> @@ -924,8 +924,8 @@ void dma_buf_kunmap(struct dma_buf *dmabuf, unsigned >>> long page_num, >>> { >>> WARN_ON(!dmabuf); >>> >>> - if (dmabuf->ops->kunmap) >>> - dmabuf->ops->kunmap(dmabuf, page_num, vaddr); >>> + if (dmabuf->ops->unmap) >>> + dmabuf->ops->unmap(dmabuf, page_num, vaddr); >>> } >>> EXPORT_SYMBOL_GPL(dma_buf_kunmap); >>> >>> diff --git a/drivers/gpu/drm/armada/armada_gem.c >>> b/drivers/gpu/drm/armada/armada_gem.c >>> index 1597458..d6c2a5d 100644 >>> --- a/drivers/gpu/drm/armada/armada_gem.c >>> +++ b/drivers/gpu/drm/armada/armada_gem.c >>> @@ -529,10 +529,10 @@ static const struct dma_buf_ops >>> armada_gem_prime_dmabuf_ops = { >>>
Re: [Intel-gfx] [PATCH v2] dma-buf: Rename dma-ops to prevent conflict with kunmap_atomic macro
Hi All, On 2017-04-20 09:51, Daniel Vetter wrote: On Wed, Apr 19, 2017 at 01:36:10PM -0600, Logan Gunthorpe wrote: Seeing the kunmap_atomic dma_buf_ops share the same name with a macro in highmem.h, the former can be aliased if any dma-buf user includes that header. I'm personally trying to include highmem.h inside scatterlist.h and this breaks the dma-buf code proper. Christoph Hellwig suggested [1] renaming it and pushing this patch ASAP. To maintain consistency I've renamed all four of kmap* and kunmap* to be map* and unmap*. (Even though only kmap_atomic presently conflicts.) [1] https://www.spinics.net/lists/target-devel/msg15070.html Signed-off-by: Logan Gunthorpe Reviewed-by: Sinclair Yeh Acked-by: Daniel Vetter Probably simplest if we pull this in through the drm-misc tree for 4.12. Can we have an ack for the v4l side for that pls? For the V4L2/videobuf2: Acked-by: Marek Szyprowski Thanks, Daniel --- Changes since v1: - Added the missing tegra driver (noticed by kbuild robot) - Rebased off of drm-intel-next to get the i915 selftest that is new - Fixed nits Sinclair pointed out. drivers/dma-buf/dma-buf.c | 16 drivers/gpu/drm/armada/armada_gem.c| 8 drivers/gpu/drm/drm_prime.c| 8 drivers/gpu/drm/i915/i915_gem_dmabuf.c | 8 drivers/gpu/drm/i915/selftests/mock_dmabuf.c | 8 drivers/gpu/drm/omapdrm/omap_gem_dmabuf.c | 8 drivers/gpu/drm/tegra/gem.c| 8 drivers/gpu/drm/udl/udl_dmabuf.c | 8 drivers/gpu/drm/vmwgfx/vmwgfx_prime.c | 8 drivers/media/v4l2-core/videobuf2-dma-contig.c | 4 ++-- drivers/media/v4l2-core/videobuf2-dma-sg.c | 4 ++-- drivers/media/v4l2-core/videobuf2-vmalloc.c| 4 ++-- drivers/staging/android/ion/ion.c | 8 include/linux/dma-buf.h| 22 +++--- 14 files changed, 61 insertions(+), 61 deletions(-) diff --git a/drivers/dma-buf/dma-buf.c b/drivers/dma-buf/dma-buf.c index f72aaac..512bdbc 100644 --- a/drivers/dma-buf/dma-buf.c +++ b/drivers/dma-buf/dma-buf.c @@ -405,8 +405,8 @@ struct dma_buf *dma_buf_export(const struct dma_buf_export_info *exp_info) || !exp_info->ops->map_dma_buf || !exp_info->ops->unmap_dma_buf || !exp_info->ops->release - || !exp_info->ops->kmap_atomic - || !exp_info->ops->kmap + || !exp_info->ops->map_atomic + || !exp_info->ops->map || !exp_info->ops->mmap)) { return ERR_PTR(-EINVAL); } @@ -872,7 +872,7 @@ void *dma_buf_kmap_atomic(struct dma_buf *dmabuf, unsigned long page_num) { WARN_ON(!dmabuf); - return dmabuf->ops->kmap_atomic(dmabuf, page_num); + return dmabuf->ops->map_atomic(dmabuf, page_num); } EXPORT_SYMBOL_GPL(dma_buf_kmap_atomic); @@ -889,8 +889,8 @@ void dma_buf_kunmap_atomic(struct dma_buf *dmabuf, unsigned long page_num, { WARN_ON(!dmabuf); - if (dmabuf->ops->kunmap_atomic) - dmabuf->ops->kunmap_atomic(dmabuf, page_num, vaddr); + if (dmabuf->ops->unmap_atomic) + dmabuf->ops->unmap_atomic(dmabuf, page_num, vaddr); } EXPORT_SYMBOL_GPL(dma_buf_kunmap_atomic); @@ -907,7 +907,7 @@ void *dma_buf_kmap(struct dma_buf *dmabuf, unsigned long page_num) { WARN_ON(!dmabuf); - return dmabuf->ops->kmap(dmabuf, page_num); + return dmabuf->ops->map(dmabuf, page_num); } EXPORT_SYMBOL_GPL(dma_buf_kmap); @@ -924,8 +924,8 @@ void dma_buf_kunmap(struct dma_buf *dmabuf, unsigned long page_num, { WARN_ON(!dmabuf); - if (dmabuf->ops->kunmap) - dmabuf->ops->kunmap(dmabuf, page_num, vaddr); + if (dmabuf->ops->unmap) + dmabuf->ops->unmap(dmabuf, page_num, vaddr); } EXPORT_SYMBOL_GPL(dma_buf_kunmap); diff --git a/drivers/gpu/drm/armada/armada_gem.c b/drivers/gpu/drm/armada/armada_gem.c index 1597458..d6c2a5d 100644 --- a/drivers/gpu/drm/armada/armada_gem.c +++ b/drivers/gpu/drm/armada/armada_gem.c @@ -529,10 +529,10 @@ static const struct dma_buf_ops armada_gem_prime_dmabuf_ops = { .map_dma_buf= armada_gem_prime_map_dma_buf, .unmap_dma_buf = armada_gem_prime_unmap_dma_buf, .release= drm_gem_dmabuf_release, - .kmap_atomic= armada_gem_dmabuf_no_kmap, - .kunmap_atomic = armada_gem_dmabuf_no_kunmap, - .kmap = armada_gem_dmabuf_no_kmap, - .kunmap = armada_gem_dmabuf_no_kunmap, + .map_atomic = armada_gem_dmabuf_no_kmap, + .unmap_atomic = armada_gem_dmabuf_no_kunmap, + .map= armada_gem_dmabuf_no_kmap, + .unmap = armada_gem_dmabuf_no_kunmap,
Re: [Intel-gfx] [PATCH v2] dma-buf: Rename dma-ops to prevent conflict with kunmap_atomic macro
Hi Logan, Thanks for the patch. On 20 April 2017 at 13:21, Daniel Vetter wrote: > On Wed, Apr 19, 2017 at 01:36:10PM -0600, Logan Gunthorpe wrote: >> Seeing the kunmap_atomic dma_buf_ops share the same name with a macro >> in highmem.h, the former can be aliased if any dma-buf user includes >> that header. >> >> I'm personally trying to include highmem.h inside scatterlist.h and this >> breaks the dma-buf code proper. >> >> Christoph Hellwig suggested [1] renaming it and pushing this patch ASAP. >> >> To maintain consistency I've renamed all four of kmap* and kunmap* to be >> map* and unmap*. (Even though only kmap_atomic presently conflicts.) >> >> [1] https://www.spinics.net/lists/target-devel/msg15070.html >> >> Signed-off-by: Logan Gunthorpe >> Reviewed-by: Sinclair Yeh > > Acked-by: Daniel Vetter Acked-by: Sumit Semwal > > Probably simplest if we pull this in through the drm-misc tree for 4.12. > Can we have an ack for the v4l side for that pls? > > Thanks, Daniel > >> --- >> >> Changes since v1: >> >> - Added the missing tegra driver (noticed by kbuild robot) >> - Rebased off of drm-intel-next to get the i915 selftest that is new >> - Fixed nits Sinclair pointed out. >> >> drivers/dma-buf/dma-buf.c | 16 >> drivers/gpu/drm/armada/armada_gem.c| 8 >> drivers/gpu/drm/drm_prime.c| 8 >> drivers/gpu/drm/i915/i915_gem_dmabuf.c | 8 >> drivers/gpu/drm/i915/selftests/mock_dmabuf.c | 8 >> drivers/gpu/drm/omapdrm/omap_gem_dmabuf.c | 8 >> drivers/gpu/drm/tegra/gem.c| 8 >> drivers/gpu/drm/udl/udl_dmabuf.c | 8 >> drivers/gpu/drm/vmwgfx/vmwgfx_prime.c | 8 >> drivers/media/v4l2-core/videobuf2-dma-contig.c | 4 ++-- >> drivers/media/v4l2-core/videobuf2-dma-sg.c | 4 ++-- >> drivers/media/v4l2-core/videobuf2-vmalloc.c| 4 ++-- >> drivers/staging/android/ion/ion.c | 8 >> include/linux/dma-buf.h| 22 +++--- >> 14 files changed, 61 insertions(+), 61 deletions(-) >> >> diff --git a/drivers/dma-buf/dma-buf.c b/drivers/dma-buf/dma-buf.c >> index f72aaac..512bdbc 100644 >> --- a/drivers/dma-buf/dma-buf.c >> +++ b/drivers/dma-buf/dma-buf.c >> @@ -405,8 +405,8 @@ struct dma_buf *dma_buf_export(const struct >> dma_buf_export_info *exp_info) >> || !exp_info->ops->map_dma_buf >> || !exp_info->ops->unmap_dma_buf >> || !exp_info->ops->release >> - || !exp_info->ops->kmap_atomic >> - || !exp_info->ops->kmap >> + || !exp_info->ops->map_atomic >> + || !exp_info->ops->map >> || !exp_info->ops->mmap)) { >> return ERR_PTR(-EINVAL); >> } >> @@ -872,7 +872,7 @@ void *dma_buf_kmap_atomic(struct dma_buf *dmabuf, >> unsigned long page_num) >> { >> WARN_ON(!dmabuf); >> >> - return dmabuf->ops->kmap_atomic(dmabuf, page_num); >> + return dmabuf->ops->map_atomic(dmabuf, page_num); >> } >> EXPORT_SYMBOL_GPL(dma_buf_kmap_atomic); >> >> @@ -889,8 +889,8 @@ void dma_buf_kunmap_atomic(struct dma_buf *dmabuf, >> unsigned long page_num, >> { >> WARN_ON(!dmabuf); >> >> - if (dmabuf->ops->kunmap_atomic) >> - dmabuf->ops->kunmap_atomic(dmabuf, page_num, vaddr); >> + if (dmabuf->ops->unmap_atomic) >> + dmabuf->ops->unmap_atomic(dmabuf, page_num, vaddr); >> } >> EXPORT_SYMBOL_GPL(dma_buf_kunmap_atomic); >> >> @@ -907,7 +907,7 @@ void *dma_buf_kmap(struct dma_buf *dmabuf, unsigned long >> page_num) >> { >> WARN_ON(!dmabuf); >> >> - return dmabuf->ops->kmap(dmabuf, page_num); >> + return dmabuf->ops->map(dmabuf, page_num); >> } >> EXPORT_SYMBOL_GPL(dma_buf_kmap); >> >> @@ -924,8 +924,8 @@ void dma_buf_kunmap(struct dma_buf *dmabuf, unsigned >> long page_num, >> { >> WARN_ON(!dmabuf); >> >> - if (dmabuf->ops->kunmap) >> - dmabuf->ops->kunmap(dmabuf, page_num, vaddr); >> + if (dmabuf->ops->unmap) >> + dmabuf->ops->unmap(dmabuf, page_num, vaddr); >> } >> EXPORT_SYMBOL_GPL(dma_buf_kunmap); >> >> diff --git a/drivers/gpu/drm/armada/armada_gem.c >> b/drivers/gpu/drm/armada/armada_gem.c >> index 1597458..d6c2a5d 100644 >> --- a/drivers/gpu/drm/armada/armada_gem.c >> +++ b/drivers/gpu/drm/armada/armada_gem.c >> @@ -529,10 +529,10 @@ static const struct dma_buf_ops >> armada_gem_prime_dmabuf_ops = { >> .map_dma_buf= armada_gem_prime_map_dma_buf, >> .unmap_dma_buf = armada_gem_prime_unmap_dma_buf, >> .release= drm_gem_dmabuf_release, >> - .kmap_atomic= armada_gem_dmabuf_no_kmap, >> - .kunmap_atomic = armada_gem_dmabuf_no_kunmap, >> - .kmap = armada_gem_dmabuf_no_kmap, >> - .kunmap = armad
Re: [Intel-gfx] [PATCH v2] dma-buf: Rename dma-ops to prevent conflict with kunmap_atomic macro
On Wed, Apr 19, 2017 at 01:36:10PM -0600, Logan Gunthorpe wrote: > Seeing the kunmap_atomic dma_buf_ops share the same name with a macro > in highmem.h, the former can be aliased if any dma-buf user includes > that header. > > I'm personally trying to include highmem.h inside scatterlist.h and this > breaks the dma-buf code proper. > > Christoph Hellwig suggested [1] renaming it and pushing this patch ASAP. > > To maintain consistency I've renamed all four of kmap* and kunmap* to be > map* and unmap*. (Even though only kmap_atomic presently conflicts.) > > [1] https://www.spinics.net/lists/target-devel/msg15070.html > > Signed-off-by: Logan Gunthorpe > Reviewed-by: Sinclair Yeh Acked-by: Daniel Vetter Probably simplest if we pull this in through the drm-misc tree for 4.12. Can we have an ack for the v4l side for that pls? Thanks, Daniel > --- > > Changes since v1: > > - Added the missing tegra driver (noticed by kbuild robot) > - Rebased off of drm-intel-next to get the i915 selftest that is new > - Fixed nits Sinclair pointed out. > > drivers/dma-buf/dma-buf.c | 16 > drivers/gpu/drm/armada/armada_gem.c| 8 > drivers/gpu/drm/drm_prime.c| 8 > drivers/gpu/drm/i915/i915_gem_dmabuf.c | 8 > drivers/gpu/drm/i915/selftests/mock_dmabuf.c | 8 > drivers/gpu/drm/omapdrm/omap_gem_dmabuf.c | 8 > drivers/gpu/drm/tegra/gem.c| 8 > drivers/gpu/drm/udl/udl_dmabuf.c | 8 > drivers/gpu/drm/vmwgfx/vmwgfx_prime.c | 8 > drivers/media/v4l2-core/videobuf2-dma-contig.c | 4 ++-- > drivers/media/v4l2-core/videobuf2-dma-sg.c | 4 ++-- > drivers/media/v4l2-core/videobuf2-vmalloc.c| 4 ++-- > drivers/staging/android/ion/ion.c | 8 > include/linux/dma-buf.h| 22 +++--- > 14 files changed, 61 insertions(+), 61 deletions(-) > > diff --git a/drivers/dma-buf/dma-buf.c b/drivers/dma-buf/dma-buf.c > index f72aaac..512bdbc 100644 > --- a/drivers/dma-buf/dma-buf.c > +++ b/drivers/dma-buf/dma-buf.c > @@ -405,8 +405,8 @@ struct dma_buf *dma_buf_export(const struct > dma_buf_export_info *exp_info) > || !exp_info->ops->map_dma_buf > || !exp_info->ops->unmap_dma_buf > || !exp_info->ops->release > - || !exp_info->ops->kmap_atomic > - || !exp_info->ops->kmap > + || !exp_info->ops->map_atomic > + || !exp_info->ops->map > || !exp_info->ops->mmap)) { > return ERR_PTR(-EINVAL); > } > @@ -872,7 +872,7 @@ void *dma_buf_kmap_atomic(struct dma_buf *dmabuf, > unsigned long page_num) > { > WARN_ON(!dmabuf); > > - return dmabuf->ops->kmap_atomic(dmabuf, page_num); > + return dmabuf->ops->map_atomic(dmabuf, page_num); > } > EXPORT_SYMBOL_GPL(dma_buf_kmap_atomic); > > @@ -889,8 +889,8 @@ void dma_buf_kunmap_atomic(struct dma_buf *dmabuf, > unsigned long page_num, > { > WARN_ON(!dmabuf); > > - if (dmabuf->ops->kunmap_atomic) > - dmabuf->ops->kunmap_atomic(dmabuf, page_num, vaddr); > + if (dmabuf->ops->unmap_atomic) > + dmabuf->ops->unmap_atomic(dmabuf, page_num, vaddr); > } > EXPORT_SYMBOL_GPL(dma_buf_kunmap_atomic); > > @@ -907,7 +907,7 @@ void *dma_buf_kmap(struct dma_buf *dmabuf, unsigned long > page_num) > { > WARN_ON(!dmabuf); > > - return dmabuf->ops->kmap(dmabuf, page_num); > + return dmabuf->ops->map(dmabuf, page_num); > } > EXPORT_SYMBOL_GPL(dma_buf_kmap); > > @@ -924,8 +924,8 @@ void dma_buf_kunmap(struct dma_buf *dmabuf, unsigned long > page_num, > { > WARN_ON(!dmabuf); > > - if (dmabuf->ops->kunmap) > - dmabuf->ops->kunmap(dmabuf, page_num, vaddr); > + if (dmabuf->ops->unmap) > + dmabuf->ops->unmap(dmabuf, page_num, vaddr); > } > EXPORT_SYMBOL_GPL(dma_buf_kunmap); > > diff --git a/drivers/gpu/drm/armada/armada_gem.c > b/drivers/gpu/drm/armada/armada_gem.c > index 1597458..d6c2a5d 100644 > --- a/drivers/gpu/drm/armada/armada_gem.c > +++ b/drivers/gpu/drm/armada/armada_gem.c > @@ -529,10 +529,10 @@ static const struct dma_buf_ops > armada_gem_prime_dmabuf_ops = { > .map_dma_buf= armada_gem_prime_map_dma_buf, > .unmap_dma_buf = armada_gem_prime_unmap_dma_buf, > .release= drm_gem_dmabuf_release, > - .kmap_atomic= armada_gem_dmabuf_no_kmap, > - .kunmap_atomic = armada_gem_dmabuf_no_kunmap, > - .kmap = armada_gem_dmabuf_no_kmap, > - .kunmap = armada_gem_dmabuf_no_kunmap, > + .map_atomic = armada_gem_dmabuf_no_kmap, > + .unmap_atomic = armada_gem_dmabuf_no_kunmap, > + .map= armada_gem_dmabuf_no_kmap, > + .unmap = armada_