From patchwork Fri Nov 30 17:34:29 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ezequiel Garcia X-Patchwork-Id: 10706905 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 20ECA13AD for ; Fri, 30 Nov 2018 17:35:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 049D0303FC for ; Fri, 30 Nov 2018 17:35:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id ED0A3304AB; Fri, 30 Nov 2018 17:35:32 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 7E7EA303FC for ; Fri, 30 Nov 2018 17:35:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=zIwUDS2Qc3HJAfwp3LBPAU0a2zXHwW9pPLdundnbb2I=; b=NAYkydd2aYEKXK pMIuE6dGL1DKvMCAHtuZVshBbOrK1M2tHWr1NWbjO93JQJtbzzOk/27Sovlv3rHGaZiDlDxnLmSmv mUM7EZMfm+pZdhUIUDHDYtJr/7vgcCYDzWXCoxoYMcKpgZn3pdnrZxen4Ah9rzezevNlrHL2sU2D9 tEBv6yStyhDeuiKvze01WVGfd+YpR8XiY/U/QEmJVUEu9Y/nHWWKL8zLcz6aLCP5X0iQi3al4mbZb 56p1M3ysc4vSaEK2aYSFdRGVoDdiKCPzkCLyH8VreWQCVhTcMeEa2oskIYcJ6XckNImisQryN31Bs eVGCjkC6hpa4NoHPDPNA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gSmhM-0001z5-BG; Fri, 30 Nov 2018 17:35:28 +0000 Received: from bhuna.collabora.co.uk ([2a00:1098:0:82:1000:25:2eeb:e3e3]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gSmgq-0008NZ-Fd for linux-rockchip@lists.infradead.org; Fri, 30 Nov 2018 17:35:26 +0000 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: ezequiel) with ESMTPSA id 52AAB27DC45 From: Ezequiel Garcia To: linux-media@vger.kernel.org, devicetree@vger.kernel.org, linux-rockchip@lists.infradead.org Subject: [PATCH v11 0/4] Add Rockchip VPU JPEG encoder Date: Fri, 30 Nov 2018 14:34:29 -0300 Message-Id: <20181130173433.24185-1-ezequiel@collabora.com> X-Mailer: git-send-email 2.20.0.rc1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181130_093456_983291_71E582E6 X-CRM114-Status: GOOD ( 10.91 ) X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , Nicolas Dufresne , Heiko Stuebner , Tomasz Figa , Rob Herring , Hans Verkuil , Miouyouyou , kernel@collabora.com, Ezequiel Garcia Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Nothing like sending a new round on a Friday, so people can test and review during the weekend! ;-) As before, this series is based on Mauro's master branch, with the following patch applied: https://patchwork.kernel.org/patch/10676149/ On this new round, I've addressed all the feedback provided by Tomasz on v10. As always, any additional feedback is well received. This patchset has been tested on RK3288 and RK3399 using bleeding-edge Gstreamer, with these pipelines: function gst_kms { gst-launch-1.0 -v videotestsrc num-buffers=${4} ! video/x-raw,width=${1},height=${2},format=${3}! v4l2jpegenc extra-controls="c,compression_quality=100" ! jpegdec ! videoconvert ! video/x-raw,format=BGRx ! queue leaky=1 ! kmssink sync=0 } gst_kms 640 480 YUY2 30 gst_kms 640 480 NV12 30 gst_kms 640 480 I420 30 (and more sizes) There are a few warnings after running check_patch.pl --strict, but I've chosen not to address them, as it would reducely readability. Also, v4l2-compliance -s passes on both platforms, as has been the case for the past submissions. v11: * Update TODO file * Make macroblock alignment codec specific * Rename VEPU_REG_ADDR_IN_LUMA,CR,CB to VEPU_REG_ADDR_IN_PLANE_0,12, * Only write plane address (VEPU_REG_ADDR_IN_PLANE_0,1,2) when needed. * s/rockchip_vpu_jpeg_render/rockchip_vpu_jpeg_header_assemble * Drop wmb() and use a writel, which has an implicit barrier. * Added missing documentation for all structs. * Removed unused struct fields. * Simplified xfer_func et al usage. * Reworked vepu_debug for i/o * Explicitly enabled/disabled clocks before/after work, instead of via the PM runtime infra. * Copy buffer timecode only when required * Bound check the amount of bytes transferred by the hardware. * Remove useless void * cast. * Fix race condition between top half and watchdog . * Drop redundant check for v4l2_ctrl errors. * Add rounding up in fill_fmt helpers. * Remove unneeded DMA alignment implementation (needed only for * USERPTR). * Add check for different width and height in CAPTURE S_FMT. * Remove check for peer busy queue in OUTPUT S_FMT. * Remove double whitespace. * Multi-line comments fixed. * Google copyright fixed. * Typos fixed. v10: * Fix SPDX syntax * Add missing patch with binding documentation * Remove white line in Kconfig v9: * Address some style comments from Hans. * Fix TODO file v8: * Drop new JPEG_RAW format. * Drop quantization table user controls. * Add JPEG headers to produce JPEG frames. Ezequiel Garcia (4): media: dt-bindings: Document the Rockchip VPU bindings ARM: dts: rockchip: add VPU device node for RK3288 arm64: dts: rockchip: add VPU device node for RK3399 media: add Rockchip VPU JPEG encoder driver .../bindings/media/rockchip-vpu.txt | 29 + MAINTAINERS | 7 + arch/arm/boot/dts/rk3288.dtsi | 14 +- arch/arm64/boot/dts/rockchip/rk3399.dtsi | 14 +- drivers/staging/media/Kconfig | 2 + drivers/staging/media/Makefile | 1 + drivers/staging/media/rockchip/vpu/Kconfig | 13 + drivers/staging/media/rockchip/vpu/Makefile | 10 + drivers/staging/media/rockchip/vpu/TODO | 13 + .../media/rockchip/vpu/rk3288_vpu_hw.c | 118 +++ .../rockchip/vpu/rk3288_vpu_hw_jpeg_enc.c | 130 ++++ .../media/rockchip/vpu/rk3288_vpu_regs.h | 442 ++++++++++++ .../media/rockchip/vpu/rk3399_vpu_hw.c | 118 +++ .../rockchip/vpu/rk3399_vpu_hw_jpeg_enc.c | 164 +++++ .../media/rockchip/vpu/rk3399_vpu_regs.h | 600 ++++++++++++++++ .../staging/media/rockchip/vpu/rockchip_vpu.h | 232 ++++++ .../media/rockchip/vpu/rockchip_vpu_common.h | 29 + .../media/rockchip/vpu/rockchip_vpu_drv.c | 531 ++++++++++++++ .../media/rockchip/vpu/rockchip_vpu_enc.c | 676 ++++++++++++++++++ .../media/rockchip/vpu/rockchip_vpu_hw.h | 58 ++ .../media/rockchip/vpu/rockchip_vpu_jpeg.c | 290 ++++++++ .../media/rockchip/vpu/rockchip_vpu_jpeg.h | 14 + 22 files changed, 3503 insertions(+), 2 deletions(-) create mode 100644 Documentation/devicetree/bindings/media/rockchip-vpu.txt create mode 100644 drivers/staging/media/rockchip/vpu/Kconfig create mode 100644 drivers/staging/media/rockchip/vpu/Makefile create mode 100644 drivers/staging/media/rockchip/vpu/TODO create mode 100644 drivers/staging/media/rockchip/vpu/rk3288_vpu_hw.c create mode 100644 drivers/staging/media/rockchip/vpu/rk3288_vpu_hw_jpeg_enc.c create mode 100644 drivers/staging/media/rockchip/vpu/rk3288_vpu_regs.h create mode 100644 drivers/staging/media/rockchip/vpu/rk3399_vpu_hw.c create mode 100644 drivers/staging/media/rockchip/vpu/rk3399_vpu_hw_jpeg_enc.c create mode 100644 drivers/staging/media/rockchip/vpu/rk3399_vpu_regs.h create mode 100644 drivers/staging/media/rockchip/vpu/rockchip_vpu.h create mode 100644 drivers/staging/media/rockchip/vpu/rockchip_vpu_common.h create mode 100644 drivers/staging/media/rockchip/vpu/rockchip_vpu_drv.c create mode 100644 drivers/staging/media/rockchip/vpu/rockchip_vpu_enc.c create mode 100644 drivers/staging/media/rockchip/vpu/rockchip_vpu_hw.h create mode 100644 drivers/staging/media/rockchip/vpu/rockchip_vpu_jpeg.c create mode 100644 drivers/staging/media/rockchip/vpu/rockchip_vpu_jpeg.h