Message ID | 20221022000506.221933-1-sebastian.fricke@collabora.com |
---|---|
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4242:0:0:0:0:0 with SMTP id s2csp961552wrr; Fri, 21 Oct 2022 17:07:53 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6efAUeBWbLVQ7e7vpJXgkZ+JCHn5VNNQBFnUISUQSY27FQlG5onk4X2nR49wU8mqBhMZns X-Received: by 2002:a17:906:846a:b0:78d:dfe6:4db5 with SMTP id hx10-20020a170906846a00b0078ddfe64db5mr17171910ejc.90.1666397273794; Fri, 21 Oct 2022 17:07:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666397273; cv=none; d=google.com; s=arc-20160816; b=FFrRHfGyBTEsdDySZ22SFLowNkHmHBf+XDGsuBZoUrj5kStztYum0ng6UlnGqdrpoW CzT22OqACUdqttcz127fGuZaLziH7eNDsvNDvlzUF/qOUT2HDcn0I1ecYLBv0QRgVXl6 iSWOOj9q14Lo7d76Ofm5u+uQV3CssTy21Ha8Sis/MEn11AMNLfbkUZ2mqhUJWEOO9Csw 0G0sweI0zj16mNjUQlFy7vw5qCunYUFSXBaiGMhFWu7eC9W/ziYiM/EtZB9k6UYB/RlM YGQQ3WDHDoN4qX6YgMJfrMDM9J8G7GW3Dg4yfZCv+U+xqvwp/TqpEVGBDX1zBh6l+SGE WyBA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=TGuKQ3auglFWpRtp8jwYbmLUuTscfmkrG42+KrGQ1PQ=; b=fZ0noyNr2O7gz4akV5jCTRfsHzjQk3d8bYRKEr0qNvgmnZ7fdfe+VaGjk2+ukh6nB5 zalSvSr7iikLn35ckJ7FR+Wqd1LrGWbtj6Rx3uYrlKEcRPI3vXzll3s35U5ipVP8oBor hH8LZOKkqI0AqSfRYGCIAHliKhUU8kyEtQLgPVcyDMz9dqMZYe16PVYaEXgCmQw6OytW 3vXQcA78fC5PYai01N7mKJuaDnutpRuO7Mv8YN83oXdXr4Aq/i9ZNvfWis/LJ5OXonf3 MgT5Wm4ty9AkW1L4WBXm/FzBa7+riTdWU72vcwtm/NOIoM92i8qz1C34g3qTrEsBPluy SPeg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=hLPZHRnV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t22-20020a1709067c1600b0078a76811e33si18069096ejo.408.2022.10.21.17.07.29; Fri, 21 Oct 2022 17:07:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=hLPZHRnV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229845AbiJVAHH (ORCPT <rfc822;pwkd43@gmail.com> + 99 others); Fri, 21 Oct 2022 20:07:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53136 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230171AbiJVAGn (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Fri, 21 Oct 2022 20:06:43 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [46.235.227.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 01A17297F21; Fri, 21 Oct 2022 17:05:54 -0700 (PDT) Received: from localhost (89-26-75-29.goll.dyn.salzburg-online.at [89.26.75.29]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: sebastianfricke) by madras.collabora.co.uk (Postfix) with ESMTPSA id BD79A6602379; Sat, 22 Oct 2022 01:05:09 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1666397109; bh=a3iEJRRx2i0AYVW3m+KefcvY47eYOOMzFjASGdT7sJU=; h=From:To:Cc:Subject:Date:From; b=hLPZHRnVBtpxCNvQUcdl8lfUUcw1i2Jy2LA4EwDkAYyrYVnuI9N0+6NT4p+lQL58Z 3ex17ZYt6O0MtQi0jcxvUwqjPPwBKtIjuwicdjKMduqTYzzgqm5tcM8n4nrVuTAWmx 0lv6HjuuygLw9heI/zwBYg1LyFo0VN8egwMH8dR0bb8AZL0rwR1Mu+EbGGiuhHEcbT SFTEhX5riFHDiYMQXNok/g7ljvJ8JzH24/YJRXKLem30+L4hQoxFhdgmRqVmq6CvQG JLUp7vMfjhB39ga25X33Vh5qevWkvovyuKKyZhANG4QAsvAM5xUs1tONntUY0DgEec qJTR4g8CHnTGQ== From: Sebastian Fricke <sebastian.fricke@collabora.com> To: linux-media@vger.kernel.org Cc: kernel@collabora.com, nas.chung@chipsnmedia.com, hverkuil@xs4all.nl, ezequiel@vanguardiasur.com.ar, linux-kernel@vger.kernel.org, nicolas.dufresne@collabora.com, p.zabel@pengutronix.de, dafna@fastmail.com Subject: [PATCH v10 0/7] Wave5 codec driver Date: Sat, 22 Oct 2022 02:04:59 +0200 Message-Id: <20221022000506.221933-1-sebastian.fricke@collabora.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747343836215257616?= X-GMAIL-MSGID: =?utf-8?q?1747344187992455388?= |
Series |
Wave5 codec driver
|
|
Message
Sebastian Fricke
Oct. 22, 2022, 12:04 a.m. UTC
The Wave5 codec driver is a stateful encoder/decoder. It is found on the J721S2 SoC, JH7100 SoC, ssd202d SoC. Etc. But current test report is based on J721S2 SoC and pre-silicon FPGA. The driver currently supports V4L2_PIX_FMT_HEVC, V4L2_PIX_FMT_H264. This driver has so far been tested on J721S2 EVM board and pre-silicon FPGA. Testing on J721S2 EVM board shows it working fine both decoder and encoder. The driver is successfully working with gstreamer v4l2 good-plugin without any modification. # v4l2-compliance -d0 Total for wave5-dec device /dev/video0: 44, Succeeded: 44, Failed: 0, Warnings: 0 # v4l2-compliance -d1 Buffer ioctls: fail: ../../../v4l-utils-1.18.1/utils/v4l2-compliance/v4l2-test-buffers.cpp(610): q.reqbufs(node, 1) test VIDIOC_REQBUFS/CREATE_BUFS/QUERYBUF: FAIL fail: ../../../v4l-utils-1.18.1/utils/v4l2-compliance/v4l2-test-buffers.cpp(753): q.reqbufs(node, 2) test VIDIOC_EXPBUF: FAIL test Requests: OK (Not Supported) Total for wave5-enc device /dev/video1: 44, Succeeded: 42, Failed: 2, Warnings: 2 changes since v9: * Move from staging to the media directory * Move coda driver to sub-directory * Fixes: * Use platform_get_irq instead of platform_get_resource to fetch the IRQ * General cleanups: * Add missing error messages to error conditions * Improve messages/variable names/comments, align parameter names across the driver * Use macros instead of magic numbers in multiple occassions * Reduce code duplication in multiple places * Fix whitespace, newline and tab alignment issues * Remove unused struct fields & commented out code * Convert signed integers to unsigned if signed is not necessary * Convert int/unsigned int to s32/u32, when the variable is assigned to the return of a register read or provided as a parameter for a register write (and vice versa) * Fix incorrect bitwise operators where logical operators are appropriate * Multiple smaller changes * Generalization: * Add new helper file providing generalized routines for vpu-dec & vpu-enc * Generalize luma & chroma table size calculation and stride calculation * Resource cleanup and error handling: * Add error handling to all calls with ignored return codes * Handle DMA resource cleanup properly * Fix insufficient instance cleanup while opening dec/enc changes since v8: * add 'wave5' to DEV_NAME * update to support Multi-stream * update to support loop test/dynamic resolution change * remove unnecessary memset, g_volatile, old version option changes since v7: * update v4l2-compliance test report * fix build error on linux-kernel 5.18.0-rc4 changes since v6: * update TODO file * get sram info from device tree changes since v5: * support NV12/NV21 pixelformat for encoder and decoder * handle adnormal exit and EOS changes since v4: * refactor functions in wave5-hw and fix bug reported by Daniel Palmer * rename functions and variables to better names * change variable types such as replacing s32 with u32 and int with bool * as appropriate changes since v3: * Fixing all issues commented by Dan Carpenter * Change file names to have wave5- prefix * In wave5_vpu_probe, enable the clocks before reading registers, as * commented from Daniel Palmer * Add more to the TODO list, changes since v2: Main fixes includes: * change the yaml and dirver code to support up to 4 clks (instead of * one) * fix Kconfig format * remove unneeded cast, * change var types * change var names, func names * checkpatch fixes changes since v1: Fix changes due to comments from Ezequiel and Dan Carpenter. Main fixes inclueds: * move all files to one dir 'wave5' * replace private error codes with standard error codes * fix extra spaces * various checkpatch fixes * replace private 'DPRINTK' macro with standard 'dev_err/dbg ..' * fix error handling * add more possible fixes to the TODO file Dafna Hirschfeld (1): media: chips-media: wave5: Add the vdi layer Nas Chung (3): media: chips-media: wave5: Add vpuapi layer media: chips-media: wave5: Add the v4l2 layer media: chips-media: wave5: Add TODO file Robert Beckett (2): dt-bindings: media: wave5: add yaml devicetree bindings media: chips-media: wave5: Add wave5 driver to maintainers file Sebastian Fricke (1): media: platform: chips-media: Move Coda to separate folder .../devicetree/bindings/media/wave5.yml | 73 + MAINTAINERS | 11 +- drivers/media/platform/chips-media/Kconfig | 18 +- drivers/media/platform/chips-media/Makefile | 6 +- .../media/platform/chips-media/coda/Kconfig | 18 + .../media/platform/chips-media/coda/Makefile | 6 + .../chips-media/{ => coda}/coda-bit.c | 0 .../chips-media/{ => coda}/coda-common.c | 0 .../chips-media/{ => coda}/coda-gdi.c | 0 .../chips-media/{ => coda}/coda-h264.c | 0 .../chips-media/{ => coda}/coda-jpeg.c | 0 .../chips-media/{ => coda}/coda-mpeg2.c | 0 .../chips-media/{ => coda}/coda-mpeg4.c | 0 .../platform/chips-media/{ => coda}/coda.h | 0 .../chips-media/{ => coda}/coda_regs.h | 0 .../chips-media/{ => coda}/imx-vdoa.c | 0 .../chips-media/{ => coda}/imx-vdoa.h | 0 .../platform/chips-media/{ => coda}/trace.h | 0 .../media/platform/chips-media/wave5/Kconfig | 12 + .../media/platform/chips-media/wave5/Makefile | 10 + drivers/media/platform/chips-media/wave5/TODO | 25 + .../platform/chips-media/wave5/wave5-helper.c | 175 + .../platform/chips-media/wave5/wave5-helper.h | 28 + .../platform/chips-media/wave5/wave5-hw.c | 3459 +++++++++++++++++ .../chips-media/wave5/wave5-regdefine.h | 654 ++++ .../platform/chips-media/wave5/wave5-vdi.c | 261 ++ .../platform/chips-media/wave5/wave5-vdi.h | 67 + .../chips-media/wave5/wave5-vpu-dec.c | 1399 +++++++ .../chips-media/wave5/wave5-vpu-enc.c | 1454 +++++++ .../platform/chips-media/wave5/wave5-vpu.c | 362 ++ .../platform/chips-media/wave5/wave5-vpu.h | 72 + .../platform/chips-media/wave5/wave5-vpuapi.c | 1115 ++++++ .../platform/chips-media/wave5/wave5-vpuapi.h | 1198 ++++++ .../chips-media/wave5/wave5-vpuconfig.h | 90 + .../chips-media/wave5/wave5-vpuerror.h | 454 +++ .../media/platform/chips-media/wave5/wave5.h | 94 + 36 files changed, 11040 insertions(+), 21 deletions(-) create mode 100644 Documentation/devicetree/bindings/media/wave5.yml create mode 100644 drivers/media/platform/chips-media/coda/Kconfig create mode 100644 drivers/media/platform/chips-media/coda/Makefile rename drivers/media/platform/chips-media/{ => coda}/coda-bit.c (100%) rename drivers/media/platform/chips-media/{ => coda}/coda-common.c (100%) rename drivers/media/platform/chips-media/{ => coda}/coda-gdi.c (100%) rename drivers/media/platform/chips-media/{ => coda}/coda-h264.c (100%) rename drivers/media/platform/chips-media/{ => coda}/coda-jpeg.c (100%) rename drivers/media/platform/chips-media/{ => coda}/coda-mpeg2.c (100%) rename drivers/media/platform/chips-media/{ => coda}/coda-mpeg4.c (100%) rename drivers/media/platform/chips-media/{ => coda}/coda.h (100%) rename drivers/media/platform/chips-media/{ => coda}/coda_regs.h (100%) rename drivers/media/platform/chips-media/{ => coda}/imx-vdoa.c (100%) rename drivers/media/platform/chips-media/{ => coda}/imx-vdoa.h (100%) rename drivers/media/platform/chips-media/{ => coda}/trace.h (100%) create mode 100644 drivers/media/platform/chips-media/wave5/Kconfig create mode 100644 drivers/media/platform/chips-media/wave5/Makefile create mode 100644 drivers/media/platform/chips-media/wave5/TODO create mode 100644 drivers/media/platform/chips-media/wave5/wave5-helper.c create mode 100644 drivers/media/platform/chips-media/wave5/wave5-helper.h create mode 100644 drivers/media/platform/chips-media/wave5/wave5-hw.c create mode 100644 drivers/media/platform/chips-media/wave5/wave5-regdefine.h create mode 100644 drivers/media/platform/chips-media/wave5/wave5-vdi.c create mode 100644 drivers/media/platform/chips-media/wave5/wave5-vdi.h create mode 100644 drivers/media/platform/chips-media/wave5/wave5-vpu-dec.c create mode 100644 drivers/media/platform/chips-media/wave5/wave5-vpu-enc.c create mode 100644 drivers/media/platform/chips-media/wave5/wave5-vpu.c create mode 100644 drivers/media/platform/chips-media/wave5/wave5-vpu.h create mode 100644 drivers/media/platform/chips-media/wave5/wave5-vpuapi.c create mode 100644 drivers/media/platform/chips-media/wave5/wave5-vpuapi.h create mode 100644 drivers/media/platform/chips-media/wave5/wave5-vpuconfig.h create mode 100644 drivers/media/platform/chips-media/wave5/wave5-vpuerror.h create mode 100644 drivers/media/platform/chips-media/wave5/wave5.h
Comments
On 02:04-20221022, Sebastian Fricke wrote: > The Wave5 codec driver is a stateful encoder/decoder. > It is found on the J721S2 SoC, JH7100 SoC, ssd202d SoC. Etc. > But current test report is based on J721S2 SoC and pre-silicon FPGA. > > The driver currently supports V4L2_PIX_FMT_HEVC, V4L2_PIX_FMT_H264. > > This driver has so far been tested on J721S2 EVM board and pre-silicon > FPGA. > > Testing on J721S2 EVM board shows it working fine both decoder and > encoder. > The driver is successfully working with gstreamer v4l2 good-plugin > without any modification. > > # v4l2-compliance -d0 > Total for wave5-dec device /dev/video0: 44, Succeeded: 44, Failed: 0, Warnings: 0 > > # v4l2-compliance -d1 > Buffer ioctls: > fail: ../../../v4l-utils-1.18.1/utils/v4l2-compliance/v4l2-test-buffers.cpp(610): q.reqbufs(node, 1) > test VIDIOC_REQBUFS/CREATE_BUFS/QUERYBUF: FAIL > fail: ../../../v4l-utils-1.18.1/utils/v4l2-compliance/v4l2-test-buffers.cpp(753): q.reqbufs(node, 2) > test VIDIOC_EXPBUF: FAIL > test Requests: OK (Not Supported) > > Total for wave5-enc device /dev/video1: 44, Succeeded: 42, Failed: 2, Warnings: 2 > > changes since v9: > > * Move from staging to the media directory > * Move coda driver to sub-directory > > * Fixes: > * Use platform_get_irq instead of platform_get_resource to fetch the IRQ > > * General cleanups: > * Add missing error messages to error conditions > * Improve messages/variable names/comments, align parameter names across the driver > * Use macros instead of magic numbers in multiple occassions > * Reduce code duplication in multiple places > * Fix whitespace, newline and tab alignment issues > * Remove unused struct fields & commented out code > * Convert signed integers to unsigned if signed is not necessary > * Convert int/unsigned int to s32/u32, when the variable is assigned to the > return of a register read or provided as a parameter for a register write > (and vice versa) > * Fix incorrect bitwise operators where logical operators are appropriate > * Multiple smaller changes > > * Generalization: > * Add new helper file providing generalized routines for vpu-dec & vpu-enc > * Generalize luma & chroma table size calculation and stride calculation > > * Resource cleanup and error handling: > * Add error handling to all calls with ignored return codes > * Handle DMA resource cleanup properly > * Fix insufficient instance cleanup while opening dec/enc > > changes since v8: > > * add 'wave5' to DEV_NAME > * update to support Multi-stream > * update to support loop test/dynamic resolution change > * remove unnecessary memset, g_volatile, old version option > > changes since v7: > > * update v4l2-compliance test report > * fix build error on linux-kernel 5.18.0-rc4 > > changes since v6: > > * update TODO file > * get sram info from device tree > > changes since v5: > > * support NV12/NV21 pixelformat for encoder and decoder > * handle adnormal exit and EOS > > changes since v4: > > * refactor functions in wave5-hw and fix bug reported by Daniel Palmer > * rename functions and variables to better names > * change variable types such as replacing s32 with u32 and int with bool > * as appropriate > > changes since v3: > > * Fixing all issues commented by Dan Carpenter > * Change file names to have wave5- prefix > * In wave5_vpu_probe, enable the clocks before reading registers, as > * commented from Daniel Palmer > * Add more to the TODO list, > > changes since v2: > > Main fixes includes: > * change the yaml and dirver code to support up to 4 clks (instead of > * one) > * fix Kconfig format > * remove unneeded cast, > * change var types > * change var names, func names > * checkpatch fixes > > changes since v1: > > Fix changes due to comments from Ezequiel and Dan Carpenter. Main fixes > inclueds: > * move all files to one dir 'wave5' > * replace private error codes with standard error codes > * fix extra spaces > * various checkpatch fixes > * replace private 'DPRINTK' macro with standard 'dev_err/dbg ..' > * fix error handling > * add more possible fixes to the TODO file > We see issues with the patchset. The decoder output contains garbage data randomly in the image. This is seen more for higher resolutions(>=1080p). The gstreamer pipeline for encoder fails with negotiation error as stated below. "vdec 4210000.video-codec: Invalid intra refresh mode: 0 (valid: 1-4)" > Dafna Hirschfeld (1): > media: chips-media: wave5: Add the vdi layer > > Nas Chung (3): > media: chips-media: wave5: Add vpuapi layer > media: chips-media: wave5: Add the v4l2 layer > media: chips-media: wave5: Add TODO file > > Robert Beckett (2): > dt-bindings: media: wave5: add yaml devicetree bindings > media: chips-media: wave5: Add wave5 driver to maintainers file > > Sebastian Fricke (1): > media: platform: chips-media: Move Coda to separate folder > > .../devicetree/bindings/media/wave5.yml | 73 + > MAINTAINERS | 11 +- > drivers/media/platform/chips-media/Kconfig | 18 +- > drivers/media/platform/chips-media/Makefile | 6 +- > .../media/platform/chips-media/coda/Kconfig | 18 + > .../media/platform/chips-media/coda/Makefile | 6 + > .../chips-media/{ => coda}/coda-bit.c | 0 > .../chips-media/{ => coda}/coda-common.c | 0 > .../chips-media/{ => coda}/coda-gdi.c | 0 > .../chips-media/{ => coda}/coda-h264.c | 0 > .../chips-media/{ => coda}/coda-jpeg.c | 0 > .../chips-media/{ => coda}/coda-mpeg2.c | 0 > .../chips-media/{ => coda}/coda-mpeg4.c | 0 > .../platform/chips-media/{ => coda}/coda.h | 0 > .../chips-media/{ => coda}/coda_regs.h | 0 > .../chips-media/{ => coda}/imx-vdoa.c | 0 > .../chips-media/{ => coda}/imx-vdoa.h | 0 > .../platform/chips-media/{ => coda}/trace.h | 0 > .../media/platform/chips-media/wave5/Kconfig | 12 + > .../media/platform/chips-media/wave5/Makefile | 10 + > drivers/media/platform/chips-media/wave5/TODO | 25 + > .../platform/chips-media/wave5/wave5-helper.c | 175 + > .../platform/chips-media/wave5/wave5-helper.h | 28 + > .../platform/chips-media/wave5/wave5-hw.c | 3459 +++++++++++++++++ > .../chips-media/wave5/wave5-regdefine.h | 654 ++++ > .../platform/chips-media/wave5/wave5-vdi.c | 261 ++ > .../platform/chips-media/wave5/wave5-vdi.h | 67 + > .../chips-media/wave5/wave5-vpu-dec.c | 1399 +++++++ > .../chips-media/wave5/wave5-vpu-enc.c | 1454 +++++++ > .../platform/chips-media/wave5/wave5-vpu.c | 362 ++ io.h is needed for devm_ioremap to work. > .../platform/chips-media/wave5/wave5-vpu.h | 72 + > .../platform/chips-media/wave5/wave5-vpuapi.c | 1115 ++++++ > .../platform/chips-media/wave5/wave5-vpuapi.h | 1198 ++++++ > .../chips-media/wave5/wave5-vpuconfig.h | 90 + > .../chips-media/wave5/wave5-vpuerror.h | 454 +++ > .../media/platform/chips-media/wave5/wave5.h | 94 + > 36 files changed, 11040 insertions(+), 21 deletions(-) > create mode 100644 Documentation/devicetree/bindings/media/wave5.yml > create mode 100644 drivers/media/platform/chips-media/coda/Kconfig > create mode 100644 drivers/media/platform/chips-media/coda/Makefile > rename drivers/media/platform/chips-media/{ => coda}/coda-bit.c (100%) > rename drivers/media/platform/chips-media/{ => coda}/coda-common.c (100%) > rename drivers/media/platform/chips-media/{ => coda}/coda-gdi.c (100%) > rename drivers/media/platform/chips-media/{ => coda}/coda-h264.c (100%) > rename drivers/media/platform/chips-media/{ => coda}/coda-jpeg.c (100%) > rename drivers/media/platform/chips-media/{ => coda}/coda-mpeg2.c (100%) > rename drivers/media/platform/chips-media/{ => coda}/coda-mpeg4.c (100%) > rename drivers/media/platform/chips-media/{ => coda}/coda.h (100%) > rename drivers/media/platform/chips-media/{ => coda}/coda_regs.h (100%) > rename drivers/media/platform/chips-media/{ => coda}/imx-vdoa.c (100%) > rename drivers/media/platform/chips-media/{ => coda}/imx-vdoa.h (100%) > rename drivers/media/platform/chips-media/{ => coda}/trace.h (100%) > create mode 100644 drivers/media/platform/chips-media/wave5/Kconfig > create mode 100644 drivers/media/platform/chips-media/wave5/Makefile > create mode 100644 drivers/media/platform/chips-media/wave5/TODO > create mode 100644 drivers/media/platform/chips-media/wave5/wave5-helper.c > create mode 100644 drivers/media/platform/chips-media/wave5/wave5-helper.h > create mode 100644 drivers/media/platform/chips-media/wave5/wave5-hw.c > create mode 100644 drivers/media/platform/chips-media/wave5/wave5-regdefine.h > create mode 100644 drivers/media/platform/chips-media/wave5/wave5-vdi.c > create mode 100644 drivers/media/platform/chips-media/wave5/wave5-vdi.h > create mode 100644 drivers/media/platform/chips-media/wave5/wave5-vpu-dec.c > create mode 100644 drivers/media/platform/chips-media/wave5/wave5-vpu-enc.c > create mode 100644 drivers/media/platform/chips-media/wave5/wave5-vpu.c > create mode 100644 drivers/media/platform/chips-media/wave5/wave5-vpu.h > create mode 100644 drivers/media/platform/chips-media/wave5/wave5-vpuapi.c > create mode 100644 drivers/media/platform/chips-media/wave5/wave5-vpuapi.h > create mode 100644 drivers/media/platform/chips-media/wave5/wave5-vpuconfig.h > create mode 100644 drivers/media/platform/chips-media/wave5/wave5-vpuerror.h > create mode 100644 drivers/media/platform/chips-media/wave5/wave5.h > > -- > 2.25.1 >
Hey Prasanth, Thanks for taking a look. On 31.10.2022 23:52, Prasanth Mantena wrote: >On 02:04-20221022, Sebastian Fricke wrote: >> The Wave5 codec driver is a stateful encoder/decoder. >> It is found on the J721S2 SoC, JH7100 SoC, ssd202d SoC. Etc. >> But current test report is based on J721S2 SoC and pre-silicon FPGA. >> >> The driver currently supports V4L2_PIX_FMT_HEVC, V4L2_PIX_FMT_H264. >> >> This driver has so far been tested on J721S2 EVM board and pre-silicon >> FPGA. >> >> Testing on J721S2 EVM board shows it working fine both decoder and >> encoder. >> The driver is successfully working with gstreamer v4l2 good-plugin >> without any modification. >> >> # v4l2-compliance -d0 >> Total for wave5-dec device /dev/video0: 44, Succeeded: 44, Failed: 0, Warnings: 0 >> >> # v4l2-compliance -d1 >> Buffer ioctls: >> fail: ../../../v4l-utils-1.18.1/utils/v4l2-compliance/v4l2-test-buffers.cpp(610): q.reqbufs(node, 1) >> test VIDIOC_REQBUFS/CREATE_BUFS/QUERYBUF: FAIL >> fail: ../../../v4l-utils-1.18.1/utils/v4l2-compliance/v4l2-test-buffers.cpp(753): q.reqbufs(node, 2) >> test VIDIOC_EXPBUF: FAIL >> test Requests: OK (Not Supported) >> >> Total for wave5-enc device /dev/video1: 44, Succeeded: 42, Failed: 2, Warnings: 2 >> >> changes since v9: >> >> * Move from staging to the media directory >> * Move coda driver to sub-directory >> >> * Fixes: >> * Use platform_get_irq instead of platform_get_resource to fetch the IRQ >> >> * General cleanups: >> * Add missing error messages to error conditions >> * Improve messages/variable names/comments, align parameter names across the driver >> * Use macros instead of magic numbers in multiple occassions >> * Reduce code duplication in multiple places >> * Fix whitespace, newline and tab alignment issues >> * Remove unused struct fields & commented out code >> * Convert signed integers to unsigned if signed is not necessary >> * Convert int/unsigned int to s32/u32, when the variable is assigned to the >> return of a register read or provided as a parameter for a register write >> (and vice versa) >> * Fix incorrect bitwise operators where logical operators are appropriate >> * Multiple smaller changes >> >> * Generalization: >> * Add new helper file providing generalized routines for vpu-dec & vpu-enc >> * Generalize luma & chroma table size calculation and stride calculation >> >> * Resource cleanup and error handling: >> * Add error handling to all calls with ignored return codes >> * Handle DMA resource cleanup properly >> * Fix insufficient instance cleanup while opening dec/enc >> >> changes since v8: >> >> * add 'wave5' to DEV_NAME >> * update to support Multi-stream >> * update to support loop test/dynamic resolution change >> * remove unnecessary memset, g_volatile, old version option >> >> changes since v7: >> >> * update v4l2-compliance test report >> * fix build error on linux-kernel 5.18.0-rc4 >> >> changes since v6: >> >> * update TODO file >> * get sram info from device tree >> >> changes since v5: >> >> * support NV12/NV21 pixelformat for encoder and decoder >> * handle adnormal exit and EOS >> >> changes since v4: >> >> * refactor functions in wave5-hw and fix bug reported by Daniel Palmer >> * rename functions and variables to better names >> * change variable types such as replacing s32 with u32 and int with bool >> * as appropriate >> >> changes since v3: >> >> * Fixing all issues commented by Dan Carpenter >> * Change file names to have wave5- prefix >> * In wave5_vpu_probe, enable the clocks before reading registers, as >> * commented from Daniel Palmer >> * Add more to the TODO list, >> >> changes since v2: >> >> Main fixes includes: >> * change the yaml and dirver code to support up to 4 clks (instead of >> * one) >> * fix Kconfig format >> * remove unneeded cast, >> * change var types >> * change var names, func names >> * checkpatch fixes >> >> changes since v1: >> >> Fix changes due to comments from Ezequiel and Dan Carpenter. Main fixes >> inclueds: >> * move all files to one dir 'wave5' >> * replace private error codes with standard error codes >> * fix extra spaces >> * various checkpatch fixes >> * replace private 'DPRINTK' macro with standard 'dev_err/dbg ..' >> * fix error handling >> * add more possible fixes to the TODO file >> > >We see issues with the patchset. The decoder output contains garbage >data randomly in the image. This is seen more for higher >resolutions(>=1080p). Thanks for the highlight, I am currently debugging that issue as well as an issue found with the encoder, which seems to be present since V9. I'll try to keep you updated but currently I am not finished with isolating the issue. >The gstreamer pipeline for encoder fails with negotiation error as >stated below. > >"vdec 4210000.video-codec: Invalid intra refresh mode: 0 (valid: 1-4)" Yes, I have noticed this issue as well and it as already fixed in my local tree, this was a refactoring error. > > >> Dafna Hirschfeld (1): >> media: chips-media: wave5: Add the vdi layer >> >> Nas Chung (3): >> media: chips-media: wave5: Add vpuapi layer >> media: chips-media: wave5: Add the v4l2 layer >> media: chips-media: wave5: Add TODO file >> >> Robert Beckett (2): >> dt-bindings: media: wave5: add yaml devicetree bindings >> media: chips-media: wave5: Add wave5 driver to maintainers file >> >> Sebastian Fricke (1): >> media: platform: chips-media: Move Coda to separate folder >> >> .../devicetree/bindings/media/wave5.yml | 73 + >> MAINTAINERS | 11 +- >> drivers/media/platform/chips-media/Kconfig | 18 +- >> drivers/media/platform/chips-media/Makefile | 6 +- >> .../media/platform/chips-media/coda/Kconfig | 18 + >> .../media/platform/chips-media/coda/Makefile | 6 + >> .../chips-media/{ => coda}/coda-bit.c | 0 >> .../chips-media/{ => coda}/coda-common.c | 0 >> .../chips-media/{ => coda}/coda-gdi.c | 0 >> .../chips-media/{ => coda}/coda-h264.c | 0 >> .../chips-media/{ => coda}/coda-jpeg.c | 0 >> .../chips-media/{ => coda}/coda-mpeg2.c | 0 >> .../chips-media/{ => coda}/coda-mpeg4.c | 0 >> .../platform/chips-media/{ => coda}/coda.h | 0 >> .../chips-media/{ => coda}/coda_regs.h | 0 >> .../chips-media/{ => coda}/imx-vdoa.c | 0 >> .../chips-media/{ => coda}/imx-vdoa.h | 0 >> .../platform/chips-media/{ => coda}/trace.h | 0 >> .../media/platform/chips-media/wave5/Kconfig | 12 + >> .../media/platform/chips-media/wave5/Makefile | 10 + >> drivers/media/platform/chips-media/wave5/TODO | 25 + >> .../platform/chips-media/wave5/wave5-helper.c | 175 + >> .../platform/chips-media/wave5/wave5-helper.h | 28 + >> .../platform/chips-media/wave5/wave5-hw.c | 3459 +++++++++++++++++ >> .../chips-media/wave5/wave5-regdefine.h | 654 ++++ >> .../platform/chips-media/wave5/wave5-vdi.c | 261 ++ >> .../platform/chips-media/wave5/wave5-vdi.h | 67 + >> .../chips-media/wave5/wave5-vpu-dec.c | 1399 +++++++ >> .../chips-media/wave5/wave5-vpu-enc.c | 1454 +++++++ >> .../platform/chips-media/wave5/wave5-vpu.c | 362 ++ > >io.h is needed for devm_ioremap to work. Do you mean this? ``` drivers/media/platform/chips-media/wave5/wave5-vpu.c 191: dev->vdb_register = devm_platform_ioremap_resource(pdev, 0); 192- if (IS_ERR(dev->vdb_register)) 193- return PTR_ERR(dev->vdb_register); ``` Because there is no `devm_ioremap` function call in the driver. And the `devm_platform_ioremap_resource`, seems to work just fine. Any clarification is highly appreciated for this comment. Sincerely, Sebastian Fricke > >> .../platform/chips-media/wave5/wave5-vpu.h | 72 + >> .../platform/chips-media/wave5/wave5-vpuapi.c | 1115 ++++++ >> .../platform/chips-media/wave5/wave5-vpuapi.h | 1198 ++++++ >> .../chips-media/wave5/wave5-vpuconfig.h | 90 + >> .../chips-media/wave5/wave5-vpuerror.h | 454 +++ >> .../media/platform/chips-media/wave5/wave5.h | 94 + >> 36 files changed, 11040 insertions(+), 21 deletions(-) >> create mode 100644 Documentation/devicetree/bindings/media/wave5.yml >> create mode 100644 drivers/media/platform/chips-media/coda/Kconfig >> create mode 100644 drivers/media/platform/chips-media/coda/Makefile >> rename drivers/media/platform/chips-media/{ => coda}/coda-bit.c (100%) >> rename drivers/media/platform/chips-media/{ => coda}/coda-common.c (100%) >> rename drivers/media/platform/chips-media/{ => coda}/coda-gdi.c (100%) >> rename drivers/media/platform/chips-media/{ => coda}/coda-h264.c (100%) >> rename drivers/media/platform/chips-media/{ => coda}/coda-jpeg.c (100%) >> rename drivers/media/platform/chips-media/{ => coda}/coda-mpeg2.c (100%) >> rename drivers/media/platform/chips-media/{ => coda}/coda-mpeg4.c (100%) >> rename drivers/media/platform/chips-media/{ => coda}/coda.h (100%) >> rename drivers/media/platform/chips-media/{ => coda}/coda_regs.h (100%) >> rename drivers/media/platform/chips-media/{ => coda}/imx-vdoa.c (100%) >> rename drivers/media/platform/chips-media/{ => coda}/imx-vdoa.h (100%) >> rename drivers/media/platform/chips-media/{ => coda}/trace.h (100%) >> create mode 100644 drivers/media/platform/chips-media/wave5/Kconfig >> create mode 100644 drivers/media/platform/chips-media/wave5/Makefile >> create mode 100644 drivers/media/platform/chips-media/wave5/TODO >> create mode 100644 drivers/media/platform/chips-media/wave5/wave5-helper.c >> create mode 100644 drivers/media/platform/chips-media/wave5/wave5-helper.h >> create mode 100644 drivers/media/platform/chips-media/wave5/wave5-hw.c >> create mode 100644 drivers/media/platform/chips-media/wave5/wave5-regdefine.h >> create mode 100644 drivers/media/platform/chips-media/wave5/wave5-vdi.c >> create mode 100644 drivers/media/platform/chips-media/wave5/wave5-vdi.h >> create mode 100644 drivers/media/platform/chips-media/wave5/wave5-vpu-dec.c >> create mode 100644 drivers/media/platform/chips-media/wave5/wave5-vpu-enc.c >> create mode 100644 drivers/media/platform/chips-media/wave5/wave5-vpu.c >> create mode 100644 drivers/media/platform/chips-media/wave5/wave5-vpu.h >> create mode 100644 drivers/media/platform/chips-media/wave5/wave5-vpuapi.c >> create mode 100644 drivers/media/platform/chips-media/wave5/wave5-vpuapi.h >> create mode 100644 drivers/media/platform/chips-media/wave5/wave5-vpuconfig.h >> create mode 100644 drivers/media/platform/chips-media/wave5/wave5-vpuerror.h >> create mode 100644 drivers/media/platform/chips-media/wave5/wave5.h >> >> -- >> 2.25.1 >>