Received: by 10.223.164.202 with SMTP id h10csp343037wrb; Wed, 15 Nov 2017 00:15:14 -0800 (PST) X-Google-Smtp-Source: AGs4zMZBEOuuMzHVnQ9FLFoyleocNFOtMK+sHGDA32qjsCuSbRdg+nyqYYn1Rfl49vXL8yKMNXl2 X-Received: by 10.98.113.130 with SMTP id m124mr16498682pfc.157.1510733714085; Wed, 15 Nov 2017 00:15:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510733714; cv=none; d=google.com; s=arc-20160816; b=ctTJEo2kFHh5zO81j9OeUgKXDHCQYPMzdFjhMugOWuaKF5ZLobtkQWwJOiui9KTe5i f3fEsdCltkSjBrKvqld2W6CKplDhtHYLTfRZHCHbufzwlU1k0UxbjZJJdeBSnTCt+4+v K5x+a3+r++iWrrcXf7vKF+igX7HVVJXeaBpXzLYWrmCAMiJCzTy1lUye95G3hehcpxcw r50CweqXnXgAU5rgg28NhcUYBiXJRGxHaYs0Pl6v95NCvmAG24h7aqpuErjuHTvLvMm1 naQs7+JmIn/b36pPEMlk/QaPFYVu/tBdHYn1nbdMS2w1C57sqlNwb0AhDhOBoa4Ey3aU CB8w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=B0w4l6O34c8YNFS1U2NwGG1RTQQfk/1G0J/+xYtroAE=; b=yjNPZwwezZeV8G2NxAmlSOWF1nltkiYJIy6XMXipazEtu3pvg2Fw1ofY2aS2qoTsy/ AhwBzsplMg5ex4KcQibBgnexYnvsPYbLQynAUItEqKP0YH/klM/PD3BqVztWhc8+K6Hq MfBT89mSmYignFMe5xu1kYsguacLhj+ubAJ2l2t51Vox6aWBDhMVbIADVnrTBx5wLyAl DSAm48KvlRfYrc2mb63WDOoW3NSJk/mXk6IQ7t8uyjTiX7CumQKPckKkYlMXnDU/bZ6D uTAQ2FktWKVwkBqujfqQClG9Orl8WwIB1CGMGH4yKszzJtc14g+QRsyL6cwn0fWgpLTH hjlA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l30si17298387pgc.625.2017.11.15.00.15.01; Wed, 15 Nov 2017 00:15:14 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753782AbdKOHaY (ORCPT + 88 others); Wed, 15 Nov 2017 02:30:24 -0500 Received: from mail-pf0-f196.google.com ([209.85.192.196]:43476 "EHLO mail-pf0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750962AbdKOHaP (ORCPT ); Wed, 15 Nov 2017 02:30:15 -0500 Received: by mail-pf0-f196.google.com with SMTP id a84so11505436pfl.0; Tue, 14 Nov 2017 23:30:15 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=B0w4l6O34c8YNFS1U2NwGG1RTQQfk/1G0J/+xYtroAE=; b=ICBpu4x9yjrYBJ0w7hnmEAa1mDn9EQtRV5d8UyxEWOMwCaPEwzfTPyIFMf6VuY2J74 PP7YTxgeT8kTFOMtZDTE4+WBN4nmtSFTWcI+KWB8RMeLmoqtyA0NHTqc6lSpf/pobDLL 16O89pgY1amuz+gnoSe0ZnVDM0sdUzS1wRa9CKUzBbuS7XcfQKs1QDiH0rNf/7rnyQaD amTSEJN/NsNwsFt4uSU9rT1+sWnz32FnW/UMtq4RuAU3V1QjKcXWJ0/iqWu3F24w2rRJ tNFANwj/pY2GHfYniNH36lkIpOKLhEPbqjIGWGWkdRU7OJLbMKp33Gb1Z/J3FV0I60nZ 3j+g== X-Gm-Message-State: AJaThX69gDDumpU9NAxtfpuGIEQfYQLM+xvMqsMDx5otenzQvXiz+uPv xX4E9OxI31NhujeOj6lFQ28= X-Received: by 10.99.96.87 with SMTP id u84mr14937197pgb.424.1510731015057; Tue, 14 Nov 2017 23:30:15 -0800 (PST) Received: from localhost.localdomain ([2401:fa00:1:fd00:692d:ab5f:79a7:543a]) by smtp.gmail.com with ESMTPSA id n129sm10450336pfn.1.2017.11.14.23.30.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 14 Nov 2017 23:30:14 -0800 (PST) From: Jacob Chen To: linux-rockchip@lists.infradead.org Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, heiko@sntech.de, mchehab@kernel.org, laurent.pinchart+renesas@ideasonboard.com, hans.verkuil@cisco.com, tfiga@chromium.org, nicolas@ndufresne.ca, sakari.ailus@linux.intel.com, zhengsq@rock-chips.com, zyc@rock-chips.com, eddie.cai.linux@gmail.com, jeffy.chen@rock-chips.com, allon.huang@rock-chips.com, p.zabel@pengutronix.de, slongerbeam@gmail.com, linux@armlinux.org.uk, Jacob Chen Subject: [RFC PATCH 0/5] Rockchip ISP1 Driver Date: Wed, 15 Nov 2017 15:29:22 +0800 Message-Id: <20171115072927.29367-1-jacob-chen@iotwrt.com> X-Mailer: git-send-email 2.14.2 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch series add a ISP(Camera) v4l2 driver for rockchip rk3288/rk3399 SoC. TODO: - Thomas is rewriting the binding code between isp, phy, sensors, i hope we could get suggestions. https://chromium-review.googlesource.com/c/chromiumos/third_party/kernel/+/768633/2 rules: - There are many mipi interfaces("rx0", "dxrx0")(actually it also could be parallel interface) in SoC and isp can decide which one will be used. - Sometimes there will be more than one senor in a mipi phy, the sofrware should decide which one is used(media link). - rk3399 have two isp. - Add a dummy buffer(dma_alloc_coherent) so drvier won't hold buffer. - Finish all TODO comments(mostly about hardware) in driver. To help do a quick review, i have push source code to my Github. https://github.com/wzyy2/linux/tree/rkisp1/drivers/media/platform/rockchip/isp1 Below are some infomations about driver/hardware: Rockchip ISP1 have many Hardware Blocks(simplied): MIPI --> ISP --> DCrop(Mainpath) --> RSZ(Mainpath) --> DMA(Mainpath) DMA-Input --> --> DCrop(Selfpath) --> RSZ(Selfpath) --> DMA(Selfpath);) (Acutally the TRM(rk3288, isp) could be found online...... which contains a more detailed block diagrams ;-P) The funcitons of each hardware block: Mainpath : up to 4k resolution, support raw/yuv format Selfpath : up tp 1080p, support rotate, support rgb/yuv format RSZ: scaling DCrop: crop ISP: 3A, Color processing, Crop MIPI: MIPI Camera interface Media pipelines: Mainpath, Selfpath <-- ISP subdev <-- MIPI <-- Sensor 3A stats <-- <-- 3A parms Code struct: capture.c : Mainpath, Selfpath, RSZ, DCROP : capture device. rkisp1.c : ISP : v4l2 sub-device. isp_params.c : 3A parms : output device. isp_stats.c : 3A stats : capture device. mipi_dphy_sy.c : MIPI : sperated v4l2 sub-device. Usage: ChromiumOS: use below v4l2-ctl command to capture frames. v4l2-ctl --verbose -d /dev/video4 --stream-mmap=2 --stream-to=/tmp/stream.out --stream-count=60 --stream-poll use below command to playback the video on your PC. mplayer /tmp/stream.out -loop 0 --demuxer=rawvideo --rawvideo=w=800:h=600:size=$((800*600*2)):format=yuy2 or mplayer ./stream.out -loop 0 -demuxer rawvideo -rawvideo w=800:h=600:size=$((800*600*2)):format=yuy2 Linux: use rkcamsrc gstreamer plugin(just a modified v4l2src) to preview. gst-launch-1.0 rkcamsrc device=/dev/video0 io-mode=4 disable-3A=true videoconvert ! video/x-raw,format=NV12,width=640,height=480 ! kmssink Jacob Chen (2): media: rkisp1: add rockchip isp1 driver ARM: dts: rockchip: add isp node for rk3288 Jeffy Chen (1): media: rkisp1: Add user space ABI definitions Shunqian Zheng (2): media: videodev2.h, v4l2-ioctl: add rkisp1 meta buffer format arm64: dts: rockchip: add isp0 node for rk3399 arch/arm/boot/dts/rk3288.dtsi | 24 + arch/arm64/boot/dts/rockchip/rk3399.dtsi | 26 + drivers/media/platform/Kconfig | 10 + drivers/media/platform/Makefile | 1 + drivers/media/platform/rockchip/isp1/Makefile | 9 + drivers/media/platform/rockchip/isp1/capture.c | 1678 ++++++++++++++++++++ drivers/media/platform/rockchip/isp1/capture.h | 46 + drivers/media/platform/rockchip/isp1/common.h | 327 ++++ drivers/media/platform/rockchip/isp1/dev.c | 728 +++++++++ drivers/media/platform/rockchip/isp1/isp_params.c | 1556 ++++++++++++++++++ drivers/media/platform/rockchip/isp1/isp_params.h | 81 + drivers/media/platform/rockchip/isp1/isp_stats.c | 537 +++++++ drivers/media/platform/rockchip/isp1/isp_stats.h | 81 + .../media/platform/rockchip/isp1/mipi_dphy_sy.c | 619 ++++++++ .../media/platform/rockchip/isp1/mipi_dphy_sy.h | 42 + drivers/media/platform/rockchip/isp1/regs.c | 251 +++ drivers/media/platform/rockchip/isp1/regs.h | 1578 ++++++++++++++++++ drivers/media/platform/rockchip/isp1/rkisp1.c | 1132 +++++++++++++ drivers/media/platform/rockchip/isp1/rkisp1.h | 130 ++ drivers/media/v4l2-core/v4l2-ioctl.c | 2 + include/uapi/linux/rkisp1-config.h | 554 +++++++ include/uapi/linux/videodev2.h | 4 + 22 files changed, 9416 insertions(+) create mode 100644 drivers/media/platform/rockchip/isp1/Makefile create mode 100644 drivers/media/platform/rockchip/isp1/capture.c create mode 100644 drivers/media/platform/rockchip/isp1/capture.h create mode 100644 drivers/media/platform/rockchip/isp1/common.h create mode 100644 drivers/media/platform/rockchip/isp1/dev.c create mode 100644 drivers/media/platform/rockchip/isp1/isp_params.c create mode 100644 drivers/media/platform/rockchip/isp1/isp_params.h create mode 100644 drivers/media/platform/rockchip/isp1/isp_stats.c create mode 100644 drivers/media/platform/rockchip/isp1/isp_stats.h create mode 100644 drivers/media/platform/rockchip/isp1/mipi_dphy_sy.c create mode 100644 drivers/media/platform/rockchip/isp1/mipi_dphy_sy.h create mode 100644 drivers/media/platform/rockchip/isp1/regs.c create mode 100644 drivers/media/platform/rockchip/isp1/regs.h create mode 100644 drivers/media/platform/rockchip/isp1/rkisp1.c create mode 100644 drivers/media/platform/rockchip/isp1/rkisp1.h create mode 100644 include/uapi/linux/rkisp1-config.h -- 2.14.2 From 1584116517511921832@xxx Wed Nov 15 07:33:56 +0000 2017 X-GM-THRID: 1584116517511921832 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread