From patchwork Mon Mar 4 19:25:18 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Ezequiel Garcia X-Patchwork-Id: 10838327 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 0988617E0 for ; Mon, 4 Mar 2019 19:26:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EBEED2B1CE for ; Mon, 4 Mar 2019 19:26:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E9CEE2B26E; Mon, 4 Mar 2019 19:26:45 +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=ham 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 447D02B1EC for ; Mon, 4 Mar 2019 19:26:45 +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=vCQYGq/ttnuIBPoEneX10wTaujyouVrO0xK01HSX11c=; b=LH6eYFi5d5uhL0 ZunGqGkbsdQ1E1wNln1Y/kp3JCznu9BL0aWju07Sw32V718MmbJw88Bo9qTUKP+esuM2ELkX8hAn4 /Trb/TqHObqeLv42ju5ZHlNt+QOo3CJNOvK3DkOq3mdrnf6U7zEwVA61CSE0oUDCPNoY1zrDvUfq5 BK6Gq/Ig4kxSd8CF7Ae+n7VKZ38cA/MXQ0cnM0KhmHJKdtn2OfmWoBD6g7+2ipjvRgcie66WO2wy7 yaIihxgJq8uJ8BDDqzehhRdvw07OivoCoslsfjkdomswBj8syJ84Tr4gsJ7EA/BlVyCd6SMDdIU4M /B1HEYcEC3wV2RmtCBIw==; 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 1h0tEW-0003DR-Dq; Mon, 04 Mar 2019 19:26:40 +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 1h0tET-0003Cp-Ch for linux-rockchip@lists.infradead.org; Mon, 04 Mar 2019 19:26:39 +0000 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: ezequiel) with ESMTPSA id C923A276DFA From: Ezequiel Garcia To: linux-media@vger.kernel.org Subject: [PATCH v2 00/11] Add MPEG-2 decoding to Rockchip VPU Date: Mon, 4 Mar 2019 16:25:18 -0300 Message-Id: <20190304192529.14200-1-ezequiel@collabora.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190304_112637_695276_90BBD3ED X-CRM114-Status: GOOD ( 10.71 ) 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 , Heiko Stuebner , Jonas Karlman , Tomasz Figa , linux-rockchip@lists.infradead.org, Hans Verkuil , 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 This series introduces the decoding infrastructure that will be used to add support for other codecs such as VP8, VP9 and H.264. As explained in the cover letter for the v1 patchset, the driver is now exposing two video device nodes. The VPU encoder is exposed on /dev/video0, and the VPU decoder is exposed on /dev/video1. Both devices are tied to the same memory-to-memory queue, and same media device /dev/media0. Therefore there are two media graphs: ┌────────────────────────────────┐ │ rockchip,rk3399-vpu-enc-source │ │ /dev/video0 │ └────────────────────────────────┘ ┃ ┃ ▼ ┌────────────────────────────────┐ │ rockchip,rk3399-vpu-enc-proc │ └────────────────────────────────┘ ┃ ┃ ▼ ┌────────────────────────────────┐ │ rockchip,rk3399-vpu-enc-sink │ │ /dev/video0 │ └────────────────────────────────┘ ┌────────────────────────────────┐ │ rockchip,rk3399-vpu-dec-source │ │ /dev/video1 │ └────────────────────────────────┘ ┃ ┃ ▼ ┌────────────────────────────────┐ │ rockchip,rk3399-vpu-dec-proc │ └────────────────────────────────┘ ┃ ┃ ▼ ┌────────────────────────────────┐ │ rockchip,rk3399-vpu-dec-sink │ │ /dev/video1 │ └────────────────────────────────┘ Of course, this work has been possible thanks to Jonas Karlman, who did the initial MPEG-2 decoding work and also got mpv+ffmpeg working using the Request API. This driver can be tested using mpv+ffmpeg for the video decoding side, and the Panfrost mesa driver for rendering. I should be posting instructions to set all of this up, and also will be submitting the support for H264, VP8 and VP9, hopefully very soon. v2: * Fixed some minor issues brought up by v4l2-compliance. * Fixed bytesused wrongly assigned 0 on the MPEG-2 decoder. * Addressed comments from Hans and Tomasz on the pixel format helpers. Ezequiel Garcia (10): rockchip/vpu: Rename pixel format helpers media: Introduce helpers to fill pixel format structs rockchip/vpu: Use pixel format helpers rockchip/vpu: Use v4l2_m2m_buf_copy_metadata rockchip/vpu: Cleanup macroblock alignment rockchip/vpu: Cleanup JPEG bounce buffer management rockchip/vpu: Open-code media controller register rockchip/vpu: Support the Request API rockchip/vpu: Add decoder boilerplate rockchip/vpu: Add support for non-standard controls Jonas Karlman (1): rockchip/vpu: Add support for MPEG-2 decoding drivers/media/v4l2-core/v4l2-common.c | 186 ++++++ drivers/staging/media/rockchip/vpu/Makefile | 5 +- .../media/rockchip/vpu/rk3288_vpu_hw.c | 4 +- .../rockchip/vpu/rk3288_vpu_hw_jpeg_enc.c | 4 +- .../media/rockchip/vpu/rk3399_vpu_hw.c | 61 +- .../rockchip/vpu/rk3399_vpu_hw_jpeg_enc.c | 10 +- .../rockchip/vpu/rk3399_vpu_hw_mpeg2_dec.c | 263 +++++++++ .../staging/media/rockchip/vpu/rockchip_vpu.h | 115 +++- .../media/rockchip/vpu/rockchip_vpu_common.h | 10 + .../media/rockchip/vpu/rockchip_vpu_dec.c | 558 ++++++++++++++++++ .../media/rockchip/vpu/rockchip_vpu_drv.c | 440 ++++++++++++-- .../media/rockchip/vpu/rockchip_vpu_enc.c | 152 ++--- .../media/rockchip/vpu/rockchip_vpu_hw.h | 42 ++ .../media/rockchip/vpu/rockchip_vpu_jpeg.c | 25 + .../media/rockchip/vpu/rockchip_vpu_mpeg2.c | 61 ++ include/media/v4l2-common.h | 32 + 16 files changed, 1795 insertions(+), 173 deletions(-) create mode 100644 drivers/staging/media/rockchip/vpu/rk3399_vpu_hw_mpeg2_dec.c create mode 100644 drivers/staging/media/rockchip/vpu/rockchip_vpu_dec.c create mode 100644 drivers/staging/media/rockchip/vpu/rockchip_vpu_mpeg2.c