From patchwork Wed Jan 11 16:59:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Gaignard X-Patchwork-Id: 42097 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp3433026wrt; Wed, 11 Jan 2023 09:03:56 -0800 (PST) X-Google-Smtp-Source: AMrXdXvQT6fueZV0lc+iw5Ld5rYga+fUiUMvQV7+31dMn670i8Wv+fYLdIFB7DYQqyPq3PNnytPk X-Received: by 2002:a17:906:a1c5:b0:7c1:2529:b25e with SMTP id bx5-20020a170906a1c500b007c12529b25emr60888123ejb.43.1673456636220; Wed, 11 Jan 2023 09:03:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673456636; cv=none; d=google.com; s=arc-20160816; b=OeoUeUwgFRRRRNcQcOzV9wRt1BsR+3IPu72GRuEAq263NDB8oh6yBYpUiZnG7nGDuq H+qxPe1nFhjXe0IR03Rw77wjvT9Fijn4M3aCzrhHesdD2/wVJkkh+NETpaDA9j/Y91Fa 8geyztstPgNTwWp1PuHjBtE1+B1WzkbmMMnp70Ty2ipycdeibl8UF8FUCWqywLNSIX5y q6VtP8S3WD6p3fTQuhIbYDPEg1mnpW0LRnexCKA/KdlT8YWjhML3X2cZ0OWQZMdpC6Gw y1MmwwZD9UlRi2UJt6XZyoDuERTg2agwv1j+Dk2W3W6UG77+almorTDzSjq2Y/Rkp9sx 30/g== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=KL0l6w5XuBm+HSZxkl4l/+2+/d5P/zeO9upNQmXwrq0=; b=LbE9lP0qHtAaXHSIXvPteWoM3k8mZga+i8/e5SUrKjEr2PZbXJOaaa2D/nMsEY/vAc UHWQjlvLjOG1zDXuXpzKSfT0vH81wejvT/tI62nwhDsc55/MXow7Q/V823QG/JZK3y9E Yt+bN6ljzSUoOl9/f/ia5pczGVnbgrEpWxVxlcWe7svZFUfvMl5rvrKfekVaXPBs6CAV iaYb3C1+YWDyrLAPlImlO9alWMpe1Dxqo4fu7AhU58vRv57L5b9dP2z+nTPHLYB/tZx1 jWJaD31H8xN3hKqXNQjbNCGlSu2v0c5ubUMn8At+sF/QvJ0ujz2CGSSoYEkiEB3sqMQp 7iiw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=YmZ4LZSL; 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 hs12-20020a1709073e8c00b007acbaeed9besi14844386ejc.398.2023.01.11.09.03.32; Wed, 11 Jan 2023 09:03:56 -0800 (PST) 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=YmZ4LZSL; 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 S239441AbjAKRAU (ORCPT + 99 others); Wed, 11 Jan 2023 12:00:20 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60824 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236446AbjAKQ7p (ORCPT ); Wed, 11 Jan 2023 11:59:45 -0500 Received: from madras.collabora.co.uk (madras.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e5ab]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C37DF13B; Wed, 11 Jan 2023 08:59:43 -0800 (PST) Received: from benjamin-XPS-13-9310.. (unknown [IPv6:2a01:e0a:120:3210:1ee3:efce:e4f6:17a3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: benjamin.gaignard) by madras.collabora.co.uk (Postfix) with ESMTPSA id 50CAF6602DAD; Wed, 11 Jan 2023 16:59:42 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1673456382; bh=WKnUc4065UFAP8ex+HL2CHU0GCNHlvHhtIo5+EmiUnM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YmZ4LZSLCgdZpuPr0KsbVHYBMCak0xwQV1bkCuHCR+fNcDISYDRM9l62BlIsoRejE Lmsf9hFSvGMEK3yV/UhBaWX8CviiO3D1n1bWrbbtWtEj7iHmoOcRokVlQUfWZV9XrE R0fWjj74iuOvHUZ/LlvuCznT1Vt0LVKv7Xny5REkheBaEdZZ1h3WXuotnFD715q0ve kw/fiz4lb69nzU0ODXmEWMolh96QJBxdC4HXB5BnSQ7SAOYAeA7L8e3uGmF2NVW3hn BXUouPh5wE8LHbGlKxGH/4+r+DLMAB/q65QUxs0++0jPXOyTpNiE+07LVN53N+Xk6h a1kDGYKyQIgmQ== From: Benjamin Gaignard To: ezequiel@vanguardiasur.com.ar, p.zabel@pengutronix.de, mchehab@kernel.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, heiko@sntech.de, daniel.almeida@collabora.com, nicolas.dufresne@collabora.co.uk Cc: linux-media@vger.kernel.org, linux-rockchip@lists.infradead.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, kernel@collabora.com, Benjamin Gaignard Subject: [PATCH v3 06/13] media: verisilicon: Save bit depth for AV1 decoder Date: Wed, 11 Jan 2023 17:59:24 +0100 Message-Id: <20230111165931.753763-7-benjamin.gaignard@collabora.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230111165931.753763-1-benjamin.gaignard@collabora.com> References: <20230111165931.753763-1-benjamin.gaignard@collabora.com> MIME-Version: 1.0 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: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1754746465860365976?= X-GMAIL-MSGID: =?utf-8?q?1754746465860365976?= Store bit depth information from AV1 sequence control. Signed-off-by: Benjamin Gaignard --- .../media/platform/verisilicon/hantro_drv.c | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/drivers/media/platform/verisilicon/hantro_drv.c b/drivers/media/platform/verisilicon/hantro_drv.c index 4500e1fc0f2c..8e93710dcfed 100644 --- a/drivers/media/platform/verisilicon/hantro_drv.c +++ b/drivers/media/platform/verisilicon/hantro_drv.c @@ -324,6 +324,25 @@ static int hantro_vp9_s_ctrl(struct v4l2_ctrl *ctrl) return 0; } +static int hantro_av1_s_ctrl(struct v4l2_ctrl *ctrl) +{ + struct hantro_ctx *ctx; + + ctx = container_of(ctrl->handler, + struct hantro_ctx, ctrl_handler); + + switch (ctrl->id) { + case V4L2_CID_STATELESS_AV1_SEQUENCE: + ctx->bit_depth = ctrl->p_new.p_av1_sequence->bit_depth; + break; + default: + return -EINVAL; + } + + return 0; +} + + static const struct v4l2_ctrl_ops hantro_ctrl_ops = { .try_ctrl = hantro_try_ctrl, }; @@ -336,6 +355,12 @@ static const struct v4l2_ctrl_ops hantro_vp9_ctrl_ops = { .s_ctrl = hantro_vp9_s_ctrl, }; +static const struct v4l2_ctrl_ops hantro_av1_ctrl_ops = { + .try_ctrl = hantro_try_ctrl, + .s_ctrl = hantro_av1_s_ctrl, +}; + + #define HANTRO_JPEG_ACTIVE_MARKERS (V4L2_JPEG_ACTIVE_MARKER_APP0 | \ V4L2_JPEG_ACTIVE_MARKER_COM | \ V4L2_JPEG_ACTIVE_MARKER_DQT | \ @@ -513,6 +538,7 @@ static const struct hantro_ctrl controls[] = { .codec = HANTRO_AV1_DECODER, .cfg = { .id = V4L2_CID_STATELESS_AV1_SEQUENCE, + .ops = &hantro_av1_ctrl_ops, }, }, { .codec = HANTRO_AV1_DECODER,