From patchwork Wed Aug 1 21:07:11 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ezequiel Garcia X-Patchwork-Id: 10553011 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 E6B9713BB for ; Wed, 1 Aug 2018 21:07:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 619062B681 for ; Wed, 1 Aug 2018 21:07:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 565E22B697; Wed, 1 Aug 2018 21:07:54 +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=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,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 CD3132B687 for ; Wed, 1 Aug 2018 21:07:53 +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:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: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=dtCfhQuU8/VR+ODQwbl7npE1whvVKIc2T8VblWCUbdI=; b=Hc+ O9uOmXp5XlJfPFYwcO74VRzZkSW+f8hPWzGzLtcvg24leSUXGn2i1XyG3nXvh/3V3S08ZY6aXW+vK eba+r+bArRo+9g774kYdVlx5qEncNXGaMG0XMKzNgub5ZMhtLr+kXgMHsxX/ouOcwQ4sF30EgKxKv 5PoJcsROF8LLq2YldACKFlegnFqCCqiF+SGmk+8aNYUTalutwWR73quZ1xvyg0ZfWAkzYUsXcmnsX rnoQ0YTNlBLjmPPPueTyE+bEqK8F4SzcnbLhO94pwtWNO0riSJvKHr8Ik4xzLdJpTJCd+nNjoDaXV NLBRaRqDyKpGcrRHw9aDy6DFMoNJvFQ==; 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 1fkyLV-0004oP-4P; Wed, 01 Aug 2018 21:07:49 +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 1fkyLN-0004mM-Ib for linux-rockchip@lists.infradead.org; Wed, 01 Aug 2018 21:07:43 +0000 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: ezequiel) with ESMTPSA id 6AD68276E59 From: Ezequiel Garcia To: linux-media@vger.kernel.org Subject: [PATCH v2 0/3] Add Rockchip VPU JPEG encoder Date: Wed, 1 Aug 2018 18:07:11 -0300 Message-Id: <20180801210714.1620-1-ezequiel@collabora.com> X-Mailer: git-send-email 2.18.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180801_140741_756720_AB5DCEC4 X-CRM114-Status: UNSURE ( 9.06 ) X-CRM114-Notice: Please train this message. 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: Nicolas Dufresne , Tomasz Figa , linux-rockchip@lists.infradead.org, Hans Verkuil , kernel@collabora.com, Ezequiel Garcia MIME-Version: 1.0 Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP This series adds support for JPEG encoding via the VPU block present in Rockchip platforms. Currently, support for RK3288 and RK3399 is included. The hardware produces a Raw JPEG format (i.e. works as a JPEG accelerator). It requires quantization tables provided by the application, and uses standard huffman tables, as recommended by the JPEG specification. In order to support this, the series introduces a new pixel format, and a new pair of controls, V4L2_CID_JPEG_{LUMA,CHROMA}_QUANTIZATION allowing userspace to specify the quantization tables. Userspace is then responsible to add the required headers and tables to the produced raw payload, to produce a JPEG image. Compliance ========== # v4l2-compliance -d 0 -s Ezequiel Garcia (1): media: add Rockchip VPU driver Shunqian Zheng (2): media: Add JPEG_RAW format media: Add controls for jpeg quantization tables .../media/uapi/v4l/pixfmt-compressed.rst | 5 + drivers/media/platform/Kconfig | 12 + drivers/media/platform/Makefile | 1 + drivers/media/platform/rockchip/vpu/Makefile | 8 + .../platform/rockchip/vpu/rk3288_vpu_hw.c | 127 +++ .../rockchip/vpu/rk3288_vpu_hw_jpege.c | 156 ++++ .../platform/rockchip/vpu/rk3288_vpu_regs.h | 442 ++++++++++ .../platform/rockchip/vpu/rk3399_vpu_hw.c | 127 +++ .../rockchip/vpu/rk3399_vpu_hw_jpege.c | 165 ++++ .../platform/rockchip/vpu/rk3399_vpu_regs.h | 601 ++++++++++++++ .../platform/rockchip/vpu/rockchip_vpu.h | 270 +++++++ .../platform/rockchip/vpu/rockchip_vpu_drv.c | 416 ++++++++++ .../platform/rockchip/vpu/rockchip_vpu_enc.c | 763 ++++++++++++++++++ .../platform/rockchip/vpu/rockchip_vpu_enc.h | 25 + .../platform/rockchip/vpu/rockchip_vpu_hw.h | 67 ++ drivers/media/v4l2-core/v4l2-ctrls.c | 4 + drivers/media/v4l2-core/v4l2-ioctl.c | 1 + include/uapi/linux/v4l2-controls.h | 3 + include/uapi/linux/videodev2.h | 1 + 19 files changed, 3194 insertions(+) create mode 100644 drivers/media/platform/rockchip/vpu/Makefile create mode 100644 drivers/media/platform/rockchip/vpu/rk3288_vpu_hw.c create mode 100644 drivers/media/platform/rockchip/vpu/rk3288_vpu_hw_jpege.c create mode 100644 drivers/media/platform/rockchip/vpu/rk3288_vpu_regs.h create mode 100644 drivers/media/platform/rockchip/vpu/rk3399_vpu_hw.c create mode 100644 drivers/media/platform/rockchip/vpu/rk3399_vpu_hw_jpege.c create mode 100644 drivers/media/platform/rockchip/vpu/rk3399_vpu_regs.h create mode 100644 drivers/media/platform/rockchip/vpu/rockchip_vpu.h create mode 100644 drivers/media/platform/rockchip/vpu/rockchip_vpu_drv.c create mode 100644 drivers/media/platform/rockchip/vpu/rockchip_vpu_enc.c create mode 100644 drivers/media/platform/rockchip/vpu/rockchip_vpu_enc.h create mode 100644 drivers/media/platform/rockchip/vpu/rockchip_vpu_hw.h