From patchwork Mon Oct 24 20:15:04 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Jernej_=C5=A0krabec?= X-Patchwork-Id: 13018070 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id B56DCC67871 for ; Mon, 24 Oct 2022 20:16:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :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=j4yOPmdSWN/0K1Hpxq6kLJBVatdM9LS+b22+On85GhU=; b=Sj3LkbF1fWex88 sQ5tsRUnXjlDS4Dv8ay0M2v2GyW114VGfcrjON0xGwUPE8j6R/sJUT122viKgZJDJBTzeKyHemySP pWW9SQXRjD1PO9NGL+ZB5Cjp++nr6jpE3bvakMCkyXBNKLRPZA+P2jcJcZ4XUtQ8+FvYEJW6H+N8S wZkjOovYiBsPxfunND+ms2GPq+IY7BnCk59savHLONswM9d0Ep1PqgECzx2nIdBSggxtA3uNeg+64 pGkAgoxY+mFV9tB11Zm5y33RsWLO68bwN6Au7cqkiDP8xsLyBWXdVn4vVbHa+SQ9NwDEzMUaEgmhf xpeSKBS09RmCAvgLtKuA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1on3rE-002tMk-9z; Mon, 24 Oct 2022 20:15:36 +0000 Received: from mail-ej1-x632.google.com ([2a00:1450:4864:20::632]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1on3rA-002tLN-HJ for linux-arm-kernel@lists.infradead.org; Mon, 24 Oct 2022 20:15:33 +0000 Received: by mail-ej1-x632.google.com with SMTP id ot12so7696787ejb.1 for ; Mon, 24 Oct 2022 13:15:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=1fBlLJXdA6H7C7X3qALVt9OFqOQbonL8kspTcSbYe8A=; b=YPJ3jwQsNmm9WLt/GBkLWWRa6lFn8eahlu81M8lp72RvYGLMe/rQjA2qPa5v1u4tT6 90ivSVYqP66OxTklswMOTjjr9ecvUkAP0NUIauygidG6sWAb1j1q05ALUBQxKfn0aTu5 2S3QwjiaKOaIMvBqG9wc3wTVwidG1wG8FEuhFE+iEE2VUjwRX7c+FY1I7Xdn55PK08z9 i2ufSZEQzWz2r7uSmuMUBEkFRjVqHQY1evrOLHZ5Fk2qSSqIk/Jn+sTiLw0wQLqe4tal 36VZBHwYk13cnxp/sU7GMLV7E/HHAvlWE1h6zbYbhyPiwxfyyLicgnWx9g4h+13XZg8z xLMg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=1fBlLJXdA6H7C7X3qALVt9OFqOQbonL8kspTcSbYe8A=; b=oitOnYchfC7Yst7v4aWemOiegVcsUNhwIE37HK4N3aBfDWclbk/PEmaaul7XFbIo/c 4HNHeR1clq1/A5Zx6CRgknnrUwkxw2X1rqgHgjIdwsSuAcDHD7hrqpUWWp70wV0wXV73 19aAAR3G2LkJdy2k851tFMmIifQEchqiBIKYQC7rKJJf92GTnoMDJLfnUEj+KpvX0ETz YXEBqBoQXM0R/zigr0MwabQu/25LYxyeCq5Pu1Umef3yvxQ5EtQunj2N8CN6ViTFKqtu ib0sXnuVjSLYuv6afrPEvel4d/wTnHDAO5maY7AanRrHboznhby10dHbRPzCQ+qbIlEk 5CNg== X-Gm-Message-State: ACrzQf1ebW8naZy3jLNiOH5jwkkQWsNJMb3f9YQqUZOtzXSG7fMwpMni 4VVJTSDrbrs8uVys/V/b2Fc= X-Google-Smtp-Source: AMsMyM6Tfi2MudIbF6SuC3N6qkh7fPJgYp0ed+IaKSyzxHBs7xvcwSqolHobZJoh1xVju7+sSEmzxA== X-Received: by 2002:a17:907:7e87:b0:78e:2dc3:945 with SMTP id qb7-20020a1709077e8700b0078e2dc30945mr29430002ejc.326.1666642529414; Mon, 24 Oct 2022 13:15:29 -0700 (PDT) Received: from kista.localdomain (82-149-19-102.dynamic.telemach.net. [82.149.19.102]) by smtp.gmail.com with ESMTPSA id op7-20020a170906bce700b0073d638a7a89sm332023ejb.99.2022.10.24.13.15.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Oct 2022 13:15:28 -0700 (PDT) From: Jernej Skrabec To: mripard@kernel.org, paul.kocialkowski@bootlin.com Cc: mchehab@kernel.org, gregkh@linuxfoundation.org, wens@csie.org, samuel@sholland.org, hverkuil-cisco@xs4all.nl, linux-media@vger.kernel.org, linux-staging@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org, Jernej Skrabec Subject: [PATCH 00/11] media: cedrus: Format handling improvements and 10-bit HEVC support Date: Mon, 24 Oct 2022 22:15:04 +0200 Message-Id: <20221024201515.34129-1-jernej.skrabec@gmail.com> X-Mailer: git-send-email 2.38.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221024_131532_595268_174E253A X-CRM114-Status: GOOD ( 10.90 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org While my first intention was to just add 10-bit HEVC handling, I noticed a few format handling issues and a bit of redundancy in some cases. Final result is that driver now sticks to stateless decoder rules better. Format handling improvements: 1. Default format selection is now based on HW capabilities. Before, MPEG2 was hardcoded but some Cedrus variants don't actually support it. 2. Controls are registered only if related codec is supported by HW. 3. Untiled output format is preferred, if supported, over tiled one. All display engine cores support untiled format, but only first generation supports tiled one. I hope this makes Cedrus eligible for destaging. Best regards, Jernej Jernej Skrabec (11): media: cedrus: remove superfluous call media: cedrus: Add format reset helpers media: cedrus: use helper to set default formats media: cedrus: Add helper for checking capabilities media: cedrus: Filter controls based on capability media: cedrus: set codec ops immediately media: cedrus: Remove cedrus_codec enum media: cedrus: prefer untiled capture format media: cedrus: initialize controls a bit later media: cedrus: Adjust buffer size based on control values media: cedrus: h265: Support decoding 10-bit frames drivers/staging/media/sunxi/cedrus/cedrus.c | 97 +++++----- drivers/staging/media/sunxi/cedrus/cedrus.h | 22 +-- .../staging/media/sunxi/cedrus/cedrus_dec.c | 4 +- .../staging/media/sunxi/cedrus/cedrus_h264.c | 2 +- .../staging/media/sunxi/cedrus/cedrus_h265.c | 37 +++- .../staging/media/sunxi/cedrus/cedrus_hw.c | 18 +- .../staging/media/sunxi/cedrus/cedrus_hw.h | 2 +- .../staging/media/sunxi/cedrus/cedrus_mpeg2.c | 2 +- .../staging/media/sunxi/cedrus/cedrus_regs.h | 16 ++ .../staging/media/sunxi/cedrus/cedrus_video.c | 166 ++++++++++-------- .../staging/media/sunxi/cedrus/cedrus_video.h | 2 + .../staging/media/sunxi/cedrus/cedrus_vp8.c | 2 +- 12 files changed, 225 insertions(+), 145 deletions(-) --- 2.38.1