From patchwork Wed Mar 9 17:36:35 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Estevam X-Patchwork-Id: 12775361 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 566A3C433FE for ; Wed, 9 Mar 2022 17:37:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237076AbiCIRht (ORCPT ); Wed, 9 Mar 2022 12:37:49 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41404 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235297AbiCIRhp (ORCPT ); Wed, 9 Mar 2022 12:37:45 -0500 Received: from mail-ot1-x335.google.com (mail-ot1-x335.google.com [IPv6:2607:f8b0:4864:20::335]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BF41CD4C88; Wed, 9 Mar 2022 09:36:46 -0800 (PST) Received: by mail-ot1-x335.google.com with SMTP id z9-20020a05683020c900b005b22bf41872so2236760otq.13; Wed, 09 Mar 2022 09:36:46 -0800 (PST) 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=PgK1M8J0dVJ6RVTqlqMCHnwEvT6e6UBM7IaZoLPjgsw=; b=R/iKkOGPfQEa7dGp1dXqRfsUoJxSvotbvMPJ+Lk6EheV5BHYUHoXUUkEIK4OhYd9Za /ge5CEnG/Sxx9vpX0y2fdiK7NtqgoEoyiEmQUDPolKykTXVB/JCkncQlsApGWZbzf9YI qd/vL1czM2knHDETRhQz0FAuLazJzJvm4zHnQR6Sf5hNkFokdfpYHK+yI5h3XY4JBVKl sxsX9SH3DdrKvl7i7csc4vRnPHrKhGDPFHV/WgbD5ENS3KmEIntrkHyHzr2LE18jXrfa rv9wreRPfvzM7NYpW/rG3dFvAlc9UICcMrSIY0IC7iqo23E6dBp4opRWxNQ9Ee6KUdFS DLrw== 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=PgK1M8J0dVJ6RVTqlqMCHnwEvT6e6UBM7IaZoLPjgsw=; b=cp1yOC3iOH0W8Ycm9iSxyNptPw2fOK2icdIRoNhvd88jDeW8ZvG3cpisSTpqO4XTXv GW3DZ633y32oyafwCeYWU2kH+UOp12sXByN9MF5fp6BBJc73yD4KmAPbeFJGIcTPcLmJ xSYEp9PgyQBplZ2l7F4k3gyH3ch5skH4S3gzLLns2Nft7UUxVvUzmhONpWcN+MsCOot3 OpEIGfqhDldCujtxYdNfKlDwiTqs9K4X5/Z2+t9ItgkCif+r9jU8BCEd9xk0ovOG9BW6 Hzxf4iaQARtCeUSXtp0GiqSe9tWw/3q/vHKGLecaBxRvjK6/a5a8S9uk9eY4oyVxygVX HQqQ== X-Gm-Message-State: AOAM5312F13Gd2/pIbZBUpcmsqnmp8xj+RRQ7KDnxsDjqA5E5mxVUG5b Ii7eq43UnCCIEnwHOYzu4TY= X-Google-Smtp-Source: ABdhPJyX4dDmHXW52QFwQ4mJAKy0pSjJXDjod5GzY9hG+QdInHCnmf9zqckuFJHWxIvsSDrfNmuyig== X-Received: by 2002:a05:6830:1deb:b0:5b2:308f:e5b7 with SMTP id b11-20020a0568301deb00b005b2308fe5b7mr442871otj.332.1646847405880; Wed, 09 Mar 2022 09:36:45 -0800 (PST) Received: from localhost.localdomain ([2804:14c:485:4b69:34e1:d0f:6368:c8ce]) by smtp.gmail.com with ESMTPSA id o17-20020a9d5c11000000b005b2611a13edsm1220891otk.61.2022.03.09.09.36.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Mar 2022 09:36:45 -0800 (PST) From: Fabio Estevam To: hverkuil-cisco@xs4all.nl Cc: p.zabel@pengutronix.de, linux-media@vger.kernel.org, nicolas.dufresne@collabora.com, ezequiel@collabora.com, kernel@iktek.de, stable@vger.kernel.org, Fabio Estevam Subject: [PATCH v3 1/2] media: coda: Fix reported H264 profile Date: Wed, 9 Mar 2022 14:36:35 -0300 Message-Id: <20220309173636.1879419-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 v2: - None. Only addded Philipp' Reviewed-by tag. drivers/media/platform/coda/coda-common.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/media/platform/coda/coda-common.c b/drivers/media/platform/coda/coda-common.c index 1eed69d29149..280d77f1567c 100644 --- a/drivers/media/platform/coda/coda-common.c +++ b/drivers/media/platform/coda/coda-common.c @@ -2334,8 +2334,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, @@ -2416,7 +2416,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 Mar 9 17:36:36 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Estevam X-Patchwork-Id: 12775362 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 67D49C433F5 for ; Wed, 9 Mar 2022 17:38:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236597AbiCIRiM (ORCPT ); Wed, 9 Mar 2022 12:38:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41598 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236622AbiCIRht (ORCPT ); Wed, 9 Mar 2022 12:37:49 -0500 Received: from mail-ot1-x32f.google.com (mail-ot1-x32f.google.com [IPv6:2607:f8b0:4864:20::32f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E52EA101F05; Wed, 9 Mar 2022 09:36:49 -0800 (PST) Received: by mail-ot1-x32f.google.com with SMTP id 17-20020a9d0611000000b005b251571643so2277163otn.2; Wed, 09 Mar 2022 09:36:49 -0800 (PST) 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=TOmGz3bt6vb4hFgw3uud8EFYKeOnqhNNOTXYfsPbvM8=; b=kXKOJmI/+7SU2IuaZRT7arv9r6+bXJEoLbKMxk/7U1plsL9U2xEvqon6DFE8nmJLsL WvM5uhmaiSskJ52iRxNympVi7G4iD1uoZigDk5ySkWDvmI2mQx3xaNK0UUgCvCkrdFQX C2estlXvyz7FC4YSuDp+keLDortAWBA+oicqyZXZyw6l+cw0SOc6FnTRD79gxAP5/mOp f7XwoHlCqyF2ifiXoRujt2dWsNAZ4DoxmOLiPmn2xum5+ubl+kNN5b5SaH54jGkBa0D5 L1c2+c9PHg8JPW/ZeiSSUOy1O2pwwtlhvDeK1rYi/ZLmYLAFyklJVy/RnaP+RCiVpQTH YcUw== 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=TOmGz3bt6vb4hFgw3uud8EFYKeOnqhNNOTXYfsPbvM8=; b=IKY7lSrw5zdFAEbWluXNHQ25nzCZ0c5A/wHKgeLHkyxPghBym3ouq3PEnTP8MWbCgP ix58LYLw10JhXxOfv4bmefi0208/WW2DB58Rgpq5XXW+YZFIKN993yTJfkscM2A+RqyA rmaHW5yCKSp7/XMpCJUgZFFcWAFZdCa7pTnv5xiLv+ReJIFdmeVa/gniDTucGriAYKwk XSBJzqbdnLO8fbqC2qMAprCrHtgt0NEUzvJ/Ajw0ZpuNys4rTRzSMPDsq/tJQS0SCOq5 XdEQwJfZdxthfO/VWYeHElRR/ruGJREHbK+TrOHyeIJ4xNQ5KYg6Rx62OztPz1GocM1X aLfw== X-Gm-Message-State: AOAM5306WLQI4IQJVr4sw3aAEZSdTbzf8dqeivjBrjqE6nXT6M1xHBR3 OEkAzkMBMs2m3TSTw8f5S9LZUPIbD48= X-Google-Smtp-Source: ABdhPJwS4GrbmBgJ4g6TnaE+fn43IecLtUbN0HG7b3PjvdCVu0tBrYWcroJE/vtS77WcKDdU4VGAtA== X-Received: by 2002:a05:6830:2012:b0:5b2:4a95:2281 with SMTP id e18-20020a056830201200b005b24a952281mr440571otp.47.1646847409248; Wed, 09 Mar 2022 09:36:49 -0800 (PST) Received: from localhost.localdomain ([2804:14c:485:4b69:34e1:d0f:6368:c8ce]) by smtp.gmail.com with ESMTPSA id o17-20020a9d5c11000000b005b2611a13edsm1220891otk.61.2022.03.09.09.36.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Mar 2022 09:36:48 -0800 (PST) From: Fabio Estevam To: hverkuil-cisco@xs4all.nl Cc: p.zabel@pengutronix.de, linux-media@vger.kernel.org, nicolas.dufresne@collabora.com, ezequiel@collabora.com, kernel@iktek.de, stable@vger.kernel.org, Fabio Estevam Subject: [PATCH v3 2/2] media: coda: Add more H264 levels for CODA960 Date: Wed, 9 Mar 2022 14:36:36 -0300 Message-Id: <20220309173636.1879419-2-festevam@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220309173636.1879419-1-festevam@gmail.com> References: <20220309173636.1879419-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 v2: - Remove 5.0 level and use Phillip's suggestion to get the correct levels being reported by v4l2h264enc: h264_level 0x00990a67 (menu) : min=0 max=13 default=11 value=11 0: 1 5: 2 8: 3 9: 3.1 10: 3.2 11: 4 12: 4.1 13: 4.2 drivers/media/platform/coda/coda-common.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/media/platform/coda/coda-common.c b/drivers/media/platform/coda/coda-common.c index 280d77f1567c..da8bc1f87ba0 100644 --- a/drivers/media/platform/coda/coda-common.c +++ b/drivers/media/platform/coda/coda-common.c @@ -2349,12 +2349,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,