From patchwork Wed Apr 6 20:23:42 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Estevam X-Patchwork-Id: 558440 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id EF706C433EF for ; Wed, 6 Apr 2022 21:27:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235795AbiDFV3r (ORCPT ); Wed, 6 Apr 2022 17:29:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33412 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234369AbiDFV1W (ORCPT ); Wed, 6 Apr 2022 17:27:22 -0400 Received: from mail-oa1-x2d.google.com (mail-oa1-x2d.google.com [IPv6:2001:4860:4864:20::2d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 299B733CC5B; Wed, 6 Apr 2022 13:23:59 -0700 (PDT) Received: by mail-oa1-x2d.google.com with SMTP id 586e51a60fabf-d39f741ba0so4145329fac.13; Wed, 06 Apr 2022 13:23:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=NFwRpN+axU2fGIRhuO/Nuug9sEEFRFzukZI+AiuZOds=; b=WhXgnCGPoRqJbX85ZWbjJuYGLaztt+bQldNU+pncfTNdX8JwNuyHXVlmTEfw2iaffE CQujLbbD0oPcJCwd1sJsorDeojA+fjwzl2uvooV07R1PjkD1Pu518HgyksWMQvLhOMuV s3wTDCKOUyBewzigkeNexPPew0lD5T8myF9GwrMH4/1UGuMA/QsFh7NYSUC/Y3RSGjA9 TV+gmLR2K2nXXzXOz/rQC4LRf8YyPDd1dkFDJvvBidXjzxuhO3hfbn2OHScHwwF/5WX2 eKuYXPyOTAx0GMIj3OutdBs2U+lVusm65ciCmhxerHCbddqj3V+1Gc7j7LbPsuGI9gOS sWkg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=NFwRpN+axU2fGIRhuO/Nuug9sEEFRFzukZI+AiuZOds=; b=rG+e11fs8WeYzEJJ9rgstivTcwwqXQu54o8lvu1hS8haHtRVc5FvJwTtqfTmQHV9TZ 9JFmiNfm74CGNR44jAwGDvGSu/LWI7VnVBsoxDtBtDzLdNMdv5fgMjXa992AsyLPbJho hw26yJ2KnTLVF09yMWSYGcDEqF8SqPmz9ME8iJMcdLDFSFZwAS5O8rmqYJ5+XV6MyNia mWZP/MagN94F6bxyTnIz10hs9SWUFPlEKzcDKsEOyKdvoPNHtLx0K8d5O0grH+ZHxLwZ SjKdALTsyPZTP43sHfsmf3REExFhusONOWGmer6k7W9QoLQUuDgykITtH7Vs+bAcWo5B a+1A== X-Gm-Message-State: AOAM530rImJ9DDp8VuMTDkqoOFn3Zkwowxw2cMWK/ejxxCN5XjNO2XxQ 4icicT1lo2pOFDEhZs5TJng= X-Google-Smtp-Source: ABdhPJyxZ/OEKdgOgCma1s+cWeIQMp/yodeOiisndZILS7EP9ws5PnYdbc+6B0ZM7xM6kCKfNGXa/g== X-Received: by 2002:a05:6870:9693:b0:de:e86c:8808 with SMTP id o19-20020a056870969300b000dee86c8808mr4753561oaq.278.1649276638206; Wed, 06 Apr 2022 13:23:58 -0700 (PDT) Received: from localhost.localdomain ([2804:14c:485:4b69:d779:c3b1:bb03:19d1]) by smtp.gmail.com with ESMTPSA id r23-20020a056830237700b005b2610517c8sm7497894oth.56.2022.04.06.13.23.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Apr 2022 13:23:57 -0700 (PDT) From: Fabio Estevam To: hverkuil-cisco@xs4all.nl Cc: nicolas.dufresne@collabora.com, kernel@iktek.de, p.zabel@pengutronix.de, linux-media@vger.kernel.org, stable@vger.kernel.org, Ezequiel Garcia , Fabio Estevam Subject: [PATCH v5 1/2] media: coda: Fix reported H264 profile Date: Wed, 6 Apr 2022 17:23:42 -0300 Message-Id: <20220406202343.139638-1-festevam@gmail.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org From: Nicolas Dufresne The CODA960 manual states that ASO/FMO features of baseline are not supported, so for this reason this driver should only report constrained baseline support. This fixes negotiation issue with constrained baseline content on GStreamer 1.17.1. ASO/FMO features are unsupported for the encoder and untested for the decoder because there is currently no userspace support. Neither GStreamer parsers nor FFMPEG parsers support ASO/FMO. Cc: stable@vger.kernel.org Fixes: 42a68012e67c2 ("media: coda: add read-only h.264 decoder profile/level controls") Signed-off-by: Nicolas Dufresne Signed-off-by: Ezequiel Garcia Tested-by: Pascal Speck Signed-off-by: Fabio Estevam Reviewed-by: Philipp Zabel --- Changes since v4: - None drivers/media/platform/chips-media/coda-common.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/media/platform/chips-media/coda-common.c b/drivers/media/platform/chips-media/coda-common.c index a57822b05070..53b2dd1b268c 100644 --- a/drivers/media/platform/chips-media/coda-common.c +++ b/drivers/media/platform/chips-media/coda-common.c @@ -2344,8 +2344,8 @@ static void coda_encode_ctrls(struct coda_ctx *ctx) V4L2_CID_MPEG_VIDEO_H264_CHROMA_QP_INDEX_OFFSET, -12, 12, 1, 0); v4l2_ctrl_new_std_menu(&ctx->ctrls, &coda_ctrl_ops, V4L2_CID_MPEG_VIDEO_H264_PROFILE, - V4L2_MPEG_VIDEO_H264_PROFILE_BASELINE, 0x0, - V4L2_MPEG_VIDEO_H264_PROFILE_BASELINE); + V4L2_MPEG_VIDEO_H264_PROFILE_CONSTRAINED_BASELINE, 0x0, + V4L2_MPEG_VIDEO_H264_PROFILE_CONSTRAINED_BASELINE); if (ctx->dev->devtype->product == CODA_HX4 || ctx->dev->devtype->product == CODA_7541) { v4l2_ctrl_new_std_menu(&ctx->ctrls, &coda_ctrl_ops, @@ -2426,7 +2426,7 @@ static void coda_decode_ctrls(struct coda_ctx *ctx) ctx->h264_profile_ctrl = v4l2_ctrl_new_std_menu(&ctx->ctrls, &coda_ctrl_ops, V4L2_CID_MPEG_VIDEO_H264_PROFILE, V4L2_MPEG_VIDEO_H264_PROFILE_HIGH, - ~((1 << V4L2_MPEG_VIDEO_H264_PROFILE_BASELINE) | + ~((1 << V4L2_MPEG_VIDEO_H264_PROFILE_CONSTRAINED_BASELINE) | (1 << V4L2_MPEG_VIDEO_H264_PROFILE_MAIN) | (1 << V4L2_MPEG_VIDEO_H264_PROFILE_HIGH)), V4L2_MPEG_VIDEO_H264_PROFILE_HIGH); From patchwork Wed Apr 6 20:23:43 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Estevam X-Patchwork-Id: 558441 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 25F17C433EF for ; Wed, 6 Apr 2022 21:27:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230415AbiDFV3m (ORCPT ); Wed, 6 Apr 2022 17:29:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50122 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236022AbiDFV1o (ORCPT ); Wed, 6 Apr 2022 17:27:44 -0400 Received: from mail-oi1-x232.google.com (mail-oi1-x232.google.com [IPv6:2607:f8b0:4864:20::232]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EDC8F33DC9C; Wed, 6 Apr 2022 13:24:02 -0700 (PDT) Received: by mail-oi1-x232.google.com with SMTP id t21so3578387oie.11; Wed, 06 Apr 2022 13:24:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=UsbI1bUf+oEzotxIP+Fs5/H08oH3yRAdv/ki6o157Es=; b=ccxnHQKij+OlcMfXfqKHSeZa3bCvcdW77WgeNF0pUY7TSAixSmhH/bMcO2deihTR/t ODmeuLfL+1wakaSzRSJB8t0js3Qb+3b/tEHxkyy2268QGHfOVAVUJcUJvZab7QjrYVTO 4D40WeiCn+yBb1oD3pqlDqLS+HvNgI/z3SVp20g9T0t6bD3+SEXgjic4LImKDI//O5V2 i5Yceiut2Vop8uT0WWmIDrRzZm01Oyf5Q7Oltv4yme6kj89C1Z/SeQbqCYQ+ZaWKxFW2 ec8uYzQXrqotoZ4z7Zys3PLhgS5mbSdyZ+e5KciL0CnyPw0gGWvP2WPa2QcOx4doivCf Tdmg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=UsbI1bUf+oEzotxIP+Fs5/H08oH3yRAdv/ki6o157Es=; b=lYBm/JebmIMvk/4r4zdPVU1+sWX1CXsEFfupiYY+RRUKS4weDJt6S+NzXGlOK7yo+N ZKJkxR7eXrNv60ba9aWXERpUwLcx2WbaK08sCixnscP0SVUzRF7PJYtvasw8ARpRRrjX Z0cuyzdGBqw03fADP7Jmtma4kyhim+0OEmXMaJH56bcUq2PAbDvhHtPdeTUWJBnANx+J 3kvcKCJWxKBuMiqna9MgQM/TNFK1QsB8RiUULaL//XhgjO1XYDbfxp6M1UT9OcbX89UI BLyof2+Bf8MFFkizs5JQUQqmWA3usGGIoImycmeMTV55v4ZOLprbgqEiv4mxBy/IHb32 Ez2g== X-Gm-Message-State: AOAM530cPqsDzRJ+5n/ZRLnYmBKEeryCyeDD9+ELN2pH8R3kUiB+ffbR OXiMuSAmTmxvcmPHmq7SDzE= X-Google-Smtp-Source: ABdhPJxy9TY1jqeDcDbToGRVt8MIGo0iRLxgaXjdmOVkd3NI8heidpFzW828vD1Ytv+6nL/dq3If+A== X-Received: by 2002:a05:6808:90d:b0:2ef:1f7e:3da2 with SMTP id w13-20020a056808090d00b002ef1f7e3da2mr4159039oih.196.1649276642236; Wed, 06 Apr 2022 13:24:02 -0700 (PDT) Received: from localhost.localdomain ([2804:14c:485:4b69:d779:c3b1:bb03:19d1]) by smtp.gmail.com with ESMTPSA id r23-20020a056830237700b005b2610517c8sm7497894oth.56.2022.04.06.13.23.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Apr 2022 13:24:01 -0700 (PDT) From: Fabio Estevam To: hverkuil-cisco@xs4all.nl Cc: nicolas.dufresne@collabora.com, kernel@iktek.de, p.zabel@pengutronix.de, linux-media@vger.kernel.org, stable@vger.kernel.org, Ezequiel Garcia , Fabio Estevam Subject: [PATCH v5 2/2] media: coda: Add more H264 levels for CODA960 Date: Wed, 6 Apr 2022 17:23:43 -0300 Message-Id: <20220406202343.139638-2-festevam@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220406202343.139638-1-festevam@gmail.com> References: <20220406202343.139638-1-festevam@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org From: Nicolas Dufresne Add H264 level 1.0, 4.1, 4.2 to the list of supported formats. While the hardware does not fully support these levels, it does support most of them. The constraints on frame size and pixel formats already cover the limitation. This fixes negotiation of level on GStreamer 1.17.1. Cc: stable@vger.kernel.org Fixes: 42a68012e67c2 ("media: coda: add read-only h.264 decoder profile/level controls") Suggested-by: Philipp Zabel Signed-off-by: Nicolas Dufresne Signed-off-by: Ezequiel Garcia Signed-off-by: Fabio Estevam Reviewed-by: Philipp Zabel --- Changes since v4: - Use the correct v3 for rebasing. drivers/media/platform/chips-media/coda-common.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/media/platform/chips-media/coda-common.c b/drivers/media/platform/chips-media/coda-common.c index 53b2dd1b268c..6d2989504b33 100644 --- a/drivers/media/platform/chips-media/coda-common.c +++ b/drivers/media/platform/chips-media/coda-common.c @@ -2359,12 +2359,15 @@ static void coda_encode_ctrls(struct coda_ctx *ctx) if (ctx->dev->devtype->product == CODA_960) { v4l2_ctrl_new_std_menu(&ctx->ctrls, &coda_ctrl_ops, V4L2_CID_MPEG_VIDEO_H264_LEVEL, - V4L2_MPEG_VIDEO_H264_LEVEL_4_0, - ~((1 << V4L2_MPEG_VIDEO_H264_LEVEL_2_0) | + V4L2_MPEG_VIDEO_H264_LEVEL_4_2, + ~((1 << V4L2_MPEG_VIDEO_H264_LEVEL_1_0) | + (1 << V4L2_MPEG_VIDEO_H264_LEVEL_2_0) | (1 << V4L2_MPEG_VIDEO_H264_LEVEL_3_0) | (1 << V4L2_MPEG_VIDEO_H264_LEVEL_3_1) | (1 << V4L2_MPEG_VIDEO_H264_LEVEL_3_2) | - (1 << V4L2_MPEG_VIDEO_H264_LEVEL_4_0)), + (1 << V4L2_MPEG_VIDEO_H264_LEVEL_4_0) | + (1 << V4L2_MPEG_VIDEO_H264_LEVEL_4_1) | + (1 << V4L2_MPEG_VIDEO_H264_LEVEL_4_2)), V4L2_MPEG_VIDEO_H264_LEVEL_4_0); } v4l2_ctrl_new_std(&ctx->ctrls, &coda_ctrl_ops,