From patchwork Thu Dec 5 09:24:49 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Neil Armstrong X-Patchwork-Id: 11274395 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5F9CA139A for ; Thu, 5 Dec 2019 09:25:20 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3B65D2464F for ; Thu, 5 Dec 2019 09:25:20 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="VOkxB85y"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=baylibre-com.20150623.gappssmtp.com header.i=@baylibre-com.20150623.gappssmtp.com header.b="jvHufdfy" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3B65D2464F Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-amlogic-bounces+patchwork-linux-amlogic=patchwork.kernel.org@lists.infradead.org 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=JSWkrRhq0M8i48IITUrvVolFweT6vo/DhV96gtMBZIk=; b=VOkxB85yphKoul QkCC7pZeUMrGDVtcHYpH7/21caeOFWtNkW+Y+BUe7nyrm4P2A9uFCN7m1UN/69Wxt+mPNkwH0/hom rTkL2fjObtLFg36wW7otvk3RhI/u/eSoeCveVOcjafdQRriJMHIrzlV/bGXFPQPv0lyF4+GrMxjoe gPYovV1jHf7rppT0YzgE5kM4KGZNIKpnnRB2wBSdY7bgtKI53XXe1oseMtgbTzmdG5DGm2TK/Z7ne Iwx5IIXIJGsSDZ0+ahbuDIb6VYYteBlJygv6RIhKzUwKRMx+OTXizMopQubx1ddySzcev8Ylddie+ /JIdZMECeJ71Geo4i5SA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1icnNv-0003vT-F1; Thu, 05 Dec 2019 09:25:19 +0000 Received: from mail-wm1-x342.google.com ([2a00:1450:4864:20::342]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1icnNa-0002Wn-Pk for linux-amlogic@lists.infradead.org; Thu, 05 Dec 2019 09:25:01 +0000 Received: by mail-wm1-x342.google.com with SMTP id q9so2797475wmj.5 for ; Thu, 05 Dec 2019 01:24:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=mBF644RxUTBZva0im+niDbPkyL2AEsuC+ZFykTwNHIk=; b=jvHufdfywsSJ0HvGIzqsFTbHETU81IekWnO0l26AzmkTTAa7gwuMH1lsx7yrrzARg8 mESZtima5ozmNO3vRaRMCjp15FqTL5zwSufZ6+Lfbd0KcpiBBAXTeTuc2su6FqnSLlzo PkhJ86WNgNijHeqHvopJM7YcU5GL0nlg6JpSpR33XOA2e8tpTBl7vR22glskgdaArJDg GKg+xOU7m/Z/8bKSfnM6G+McYokTd02Qw/YW3qwsArMn0EjzGZpsCcwfle7pXWXtVkGw PUa3WZn+OJaJ7sO5gV1FgxQe0ZhiOLHZcN52wLkPCA0GTCipPXbUnVrbP3jrGVMnbptL T1Dg== 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:mime-version :content-transfer-encoding; bh=mBF644RxUTBZva0im+niDbPkyL2AEsuC+ZFykTwNHIk=; b=jFSO80NSfj6OGeuaILwdMtbWYDwiQGzVibqWGiD0apmTEgZ4qlolCnvY4b27iwkA80 ymnxGzxk8fLOSfzONNPjDfQCr3FZhj4X9BQBdKIsT2RdHJ+f+j01o8DHnmLwx5teuDOF WmWfISYB0H874XfRre9QER2INm+Nvmw1xlMVE412CZhuJTn6/uGHw/+tVhKEwr9F5D7+ yrnFUZ3zEJcSnUhvu/PPRfJiuEy2lY/pryo1MCSb9R0CWz4EBWZ/0+PKbzG4XhXv1V6J vl5B07XSlJpRig8z7ohhNdV37UkclimXdLYBy4dL6AIzxcTBJkWYItonbzKKJgfgsq04 7hkA== X-Gm-Message-State: APjAAAX06lSGVxziyySfvptTelJ93NbuneTs3vtYbDyuV7R7ZgkoOnOM rCfx+5wBXjC0esSzedlHbNdusg== X-Google-Smtp-Source: APXvYqzb9PZe4p/FaxkjRz+yIx4cEG1Ar/uArvNnrvahc13Bn+ryPAUa9ho0yU4y6s6dzxJC54jQkA== X-Received: by 2002:a05:600c:22c8:: with SMTP id 8mr3810490wmg.178.1575537897038; Thu, 05 Dec 2019 01:24:57 -0800 (PST) Received: from bender.baylibre.local (wal59-h01-176-150-251-154.dsl.sta.abo.bbox.fr. [176.150.251.154]) by smtp.gmail.com with ESMTPSA id t5sm11642620wrr.35.2019.12.05.01.24.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Dec 2019 01:24:56 -0800 (PST) From: Neil Armstrong To: mchehab@kernel.org, hans.verkuil@cisco.com Subject: [PATCH 0/5] media: meson: vdec: Add VP9 decoding support Date: Thu, 5 Dec 2019 10:24:49 +0100 Message-Id: <20191205092454.26075-1-narmstrong@baylibre.com> X-Mailer: git-send-email 2.22.0 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191205_012458_831839_04979E3F X-CRM114-Status: UNSURE ( 7.97 ) X-CRM114-Notice: Please train this message. X-Spam-Score: 0.0 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:342 listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid X-BeenThere: linux-amlogic@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-amlogic@lists.infradead.org, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Neil Armstrong Sender: "linux-amlogic" Errors-To: linux-amlogic-bounces+patchwork-linux-amlogic=patchwork.kernel.org@lists.infradead.org Hello, This patchset aims to bring VP9 decoding support to Amlogic GXL, G12A & SM1 platforms for the amlogic stateful video decoder driver. With this, it passes v4l2-compliance with streaming on Amlogic G12A and Amlogic SM1 SoCs successfully using the stream at [1] with a fixed pyv4l2compliance script for VP9 at [2]. The original script kept the IVF headers in the stream, confusing the decoder. The fixed script only extracts the payload from the IVF container. The decoder has been tested using the Google CTS TestVectorsIttiam VP9 yuv420 samples, passing 82 resolutions test streams, with 13 fails by pixel differences and 3 timeouts. This patchset depends on : - G12A enablement at [3] - SM1 enablement at [4] - H.264 and compliance at [5] [1] https://github.com/superna9999/pyv4l2compliance/raw/tests/output/Jellyfish_1080_10s_5MB.vp9.hdr [2] https://github.com/superna9999/pyv4l2compliance [3] https://lore.kernel.org/linux-media/20191120111430.29552-1-narmstrong@baylibre.com [4] https://lore.kernel.org/linux-media/20191121101429.23831-1-narmstrong@baylibre.com [5] https://lore.kernel.org/linux-media/20191126093733.32404-1-narmstrong@baylibre.com The compliance log is: # v4l2-compliance --stream-from-hdr Jellyfish_1080_10s_5MB.vp9.hdr -s 200 v4l2-compliance SHA: 7ead0e1856b89f2e19369af452bb03fd0cd16793, 64 bits Compliance test for meson-vdec device /dev/video0: Driver Info: Driver name : meson-vdec Card type : Amlogic Video Decoder Bus info : platform:meson-vdec Driver version : 5.4.0 Capabilities : 0x84204000 Video Memory-to-Memory Multiplanar Streaming Extended Pix Format Device Capabilities Device Caps : 0x04204000 Video Memory-to-Memory Multiplanar Streaming Extended Pix Format Detected Stateful Decoder Required ioctls: test VIDIOC_QUERYCAP: OK Allow for multiple opens: test second /dev/video0 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 (Not Supported) 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 (Not Supported) test VIDIOC_G/S_AUDIO: OK (Not Supported) Inputs: 0 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) 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: 2 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 (Not Supported) Codec ioctls: test VIDIOC_(TRY_)ENCODER_CMD: OK (Not Supported) test VIDIOC_G_ENC_INDEX: OK (Not Supported) test VIDIOC_(TRY_)DECODER_CMD: OK Buffer ioctls: test VIDIOC_REQBUFS/CREATE_BUFS/QUERYBUF: OK test VIDIOC_EXPBUF: OK test Requests: OK (Not Supported) Test input 0: Streaming ioctls: test read/write: OK (Not Supported) test blocking wait: OK Video Capture Multiplanar: Captured 200 buffers test MMAP (select): OK Video Capture Multiplanar: Captured 200 buffers test MMAP (epoll): OK test USERPTR (select): OK (Not Supported) test DMABUF: Cannot test, specify --expbuf-device Total for meson-vdec device /dev/video0: 49, Succeeded: 49, Failed: 0, Warnings: 0 Maxime Jourdan (4): media: meson: vdec: add helpers for lossless framebuffer compression buffers media: meson: vdec: add common HEVC decoder support media: meson: vdec: add VP9 input support media: meson: vdec: add VP9 decoder support Neil Armstrong (1): media: meson: vdec: align stride on 32 bytes drivers/staging/media/meson/vdec/Makefile | 4 +- .../media/meson/vdec/codec_hevc_common.c | 285 ++++ .../media/meson/vdec/codec_hevc_common.h | 77 ++ drivers/staging/media/meson/vdec/codec_vp9.c | 1192 +++++++++++++++++ drivers/staging/media/meson/vdec/codec_vp9.h | 13 + drivers/staging/media/meson/vdec/esparser.c | 142 +- drivers/staging/media/meson/vdec/hevc_regs.h | 218 +++ drivers/staging/media/meson/vdec/vdec.c | 10 +- .../staging/media/meson/vdec/vdec_helpers.c | 31 +- .../staging/media/meson/vdec/vdec_helpers.h | 4 + drivers/staging/media/meson/vdec/vdec_hevc.c | 231 ++++ drivers/staging/media/meson/vdec/vdec_hevc.h | 13 + .../staging/media/meson/vdec/vdec_platform.c | 38 + 13 files changed, 2245 insertions(+), 13 deletions(-) create mode 100644 drivers/staging/media/meson/vdec/codec_hevc_common.c create mode 100644 drivers/staging/media/meson/vdec/codec_hevc_common.h create mode 100644 drivers/staging/media/meson/vdec/codec_vp9.c create mode 100644 drivers/staging/media/meson/vdec/codec_vp9.h create mode 100644 drivers/staging/media/meson/vdec/hevc_regs.h create mode 100644 drivers/staging/media/meson/vdec/vdec_hevc.c create mode 100644 drivers/staging/media/meson/vdec/vdec_hevc.h