From patchwork Wed Mar 9 14:33:21 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Estevam X-Patchwork-Id: 12775156 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 6864AC433EF for ; Wed, 9 Mar 2022 14:33:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233550AbiCIOet (ORCPT ); Wed, 9 Mar 2022 09:34:49 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36232 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229703AbiCIOes (ORCPT ); Wed, 9 Mar 2022 09:34:48 -0500 Received: from mail-oi1-x22c.google.com (mail-oi1-x22c.google.com [IPv6:2607:f8b0:4864:20::22c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1B87C3BA60; Wed, 9 Mar 2022 06:33:50 -0800 (PST) Received: by mail-oi1-x22c.google.com with SMTP id q189so2803127oia.9; Wed, 09 Mar 2022 06:33:50 -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=t2XrzvV53Hq99R7iC1cFXjuoe4N7fIB4/waYIPl8IPw=; b=BpV5fqjXq5es6c97DPQfjqmyvEdTvSRdTfHQt1wUvS/994UGM2pMJbWLddMFpsbLeH xYJ7vaRrakk0Pc7qve626tjtUbl/1nx2SFZcGGoJLfpONTiLfoikR8ECuNM+Xkp546ZY rr9C6qcfSd9e+/vG1omKz5aUSMzkgKxqc9SXA4OX79/glKW5MGRgBoGwYrvEYbRTUCXw Gg6Ohx1R6VCZk5eUPhYsdOMP8LrQ0FTSfj0CStZ2aC0nyP5RkHlluEf6b2N3qqh0EYso Zev56GVb5fUonybt0t5wTEvtuXypUK/hjE2FgvUZlhxIKyv3AIauu31+cv2Wa9g6J9e3 wvNA== 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=t2XrzvV53Hq99R7iC1cFXjuoe4N7fIB4/waYIPl8IPw=; b=U81Mko5jUfiSaoG5LSPBtCwRTvVPLeGWoPJOIxKR7yAx25lcAG3Lw8JJHekg4KOa6U q74LDMhS/fvYXpC07q2VT0VKaIZovz+tQjSI9/9hJflV72nN5XJgWlS/w9JRKAWJgU9S 7T8Jx0RJelFatYS6MILViU++SH981I7O8lTjMH5/ARCuS+OWf1TeVLbYsi5IqYBatcpe MCAXxnaFqlBqkff+r59iJUR/aszdGxWzV+ZF+8oO+K2e5Q6cqSPNUfKqyOKNw+plLRSD NWVHtTgctxRDVIZU+5ncww6TAM0EfPQgsxp6p8O0SQvHhUH0v1ucCS9pyMd2TVvc/9WN bJDw== X-Gm-Message-State: AOAM5307GtjGJfI/3Cz5pAa/NpGMgBRMRIpCWnPyKjDa2qMcpZJye638 ffwISjJ9+S0RATuYFEWAk3ge7xUh6L0= X-Google-Smtp-Source: ABdhPJwt26KommPJT+5b9UKMFX7xZAKHpxjko3GjWgEpoDs/sffCt+3Rz7emim2bvYd7vCahNxPrgA== X-Received: by 2002:a05:6808:10c6:b0:2d9:a01a:4bbc with SMTP id s6-20020a05680810c600b002d9a01a4bbcmr6284246ois.227.1646836429347; Wed, 09 Mar 2022 06:33:49 -0800 (PST) Received: from localhost.localdomain ([2804:14c:485:4b69:9f7c:9178:2645:4362]) by smtp.gmail.com with ESMTPSA id j25-20020a4ad199000000b003171dfeb5bfsm1007362oor.15.2022.03.09.06.33.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Mar 2022 06:33: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 v2 1/2] media: coda: Fix reported H264 profile Date: Wed, 9 Mar 2022 11:33:21 -0300 Message-Id: <20220309143322.1755281-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 v1: - Followed Phillip's suggestion to change the commit message to say that ASO/FMO features are unsupported for the encoder and untested for the decoder because there is no userspace support. https://patchwork.kernel.org/project/linux-media/patch/20200717034923.219524-1-ezequiel@collabora.com/ - Added Pascal's Tested-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 a57822b05070..53b2dd1b268c 100644 --- a/drivers/media/platform/coda/coda-common.c +++ b/drivers/media/platform/coda/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 Mar 9 14:33:22 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Estevam X-Patchwork-Id: 12775157 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 90C4BC433FE for ; Wed, 9 Mar 2022 14:33:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233553AbiCIOex (ORCPT ); Wed, 9 Mar 2022 09:34:53 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36418 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233551AbiCIOew (ORCPT ); Wed, 9 Mar 2022 09:34:52 -0500 Received: from mail-oi1-x236.google.com (mail-oi1-x236.google.com [IPv6:2607:f8b0:4864:20::236]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 467054090A; Wed, 9 Mar 2022 06:33:53 -0800 (PST) Received: by mail-oi1-x236.google.com with SMTP id n7so2827623oif.5; Wed, 09 Mar 2022 06:33:53 -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=M1b50c+WKpVTFCjWYgMcD8MnA9YQprdxUUGnxlUxFyE=; b=BKRmxwrg0l5+pesZjwKBN7gR0PtX03ClY+5YnxudE6AAywCh2WOm3qxMNGgc6SfNuR mmyqQmQXlTI2P0+E+792K13OOKTppudr0w9KPV4J2gW7/90i7vGdtvO59WfzbE2Z7fAy SsF892LQGts05rqHqhZEYxPST8/BPaf/sgpwgCgQK5lK6bepZxnH9CVeQAyniwrzHWxu BMRrsi9PQRC/FbLDOctXbxfoyCS7dzk0SsgadtXo3Ajw3N/jtf3QJUOhI8PBhmArQM7e W3B4bVY92UQF0U6VCuQHhZ4K10yPob1uyvPoSIyc+ZPTyFYrdBd6croFeVyWeLGiVxCH OPDg== 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=M1b50c+WKpVTFCjWYgMcD8MnA9YQprdxUUGnxlUxFyE=; b=gsJRAkcF1DLQlYlUxrkr5I3+pqQEUlnEd9jlkvVzJJgM/yIXgV762jeVkrjA9noAt1 Kh8UnT9R8cv9+RJh95+XIrGEoTZTo4gq0tBfHmmYEeb4pOG8z/WNPZqfI8gkk03pjFJF VdFPNCqsFnXUl8MbytN5EvFOa+KhW5HnYGKr4nx2XgCwkbvgbNbgVKegbgo0FhuQiSlp a9MdJHe4+AtNHftjrvEhrLqS0DBfB0tpfnx++8M6L1NIBZQ0LtuGIVobNJNJvxM2CsGL vHSpwtwSJpmDAV34sqwk0hKmRCMWzHP2/Lz1ipXe2s7DhUkAHRgC6OGaHhqEfFi5YRVd HgJQ== X-Gm-Message-State: AOAM533JNqGn69z9btJIFuEAI5LqbCoE91MH78G9MSJjhQNYzfMOgHyw MhWh7dNMAGIwqy/vQXWJulebgg3Jdn8= X-Google-Smtp-Source: ABdhPJxeIFe9Xi1Na4kiR29mb6qrfjO4Eg25raZT4ZG4VYPTgeBFHwaiQlUdNpYlrEEsqbU/XL5EZA== X-Received: by 2002:a05:6808:209e:b0:2da:4de9:e632 with SMTP id s30-20020a056808209e00b002da4de9e632mr301299oiw.214.1646836432626; Wed, 09 Mar 2022 06:33:52 -0800 (PST) Received: from localhost.localdomain ([2804:14c:485:4b69:9f7c:9178:2645:4362]) by smtp.gmail.com with ESMTPSA id j25-20020a4ad199000000b003171dfeb5bfsm1007362oor.15.2022.03.09.06.33.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Mar 2022 06:33:52 -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 v2 2/2] media: coda: Add more H264 levels for CODA960 Date: Wed, 9 Mar 2022 11:33:22 -0300 Message-Id: <20220309143322.1755281-2-festevam@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220309143322.1755281-1-festevam@gmail.com> References: <20220309143322.1755281-1-festevam@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org From: Nicolas Dufresne This add H264 level 4.1, 4.2 and 5.0 to the list of supported formats. While the hardware does not fully support these levels, it do 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") Signed-off-by: Nicolas Dufresne Signed-off-by: Ezequiel Garcia Tested-by: Pascal Speck Signed-off-by: Fabio Estevam --- Changes since v1: - None - only added Pascal's Tested-by tag. drivers/media/platform/coda/coda-common.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/media/platform/coda/coda-common.c b/drivers/media/platform/coda/coda-common.c index 53b2dd1b268c..f1234ad24f65 100644 --- a/drivers/media/platform/coda/coda-common.c +++ b/drivers/media/platform/coda/coda-common.c @@ -2364,7 +2364,10 @@ static void coda_encode_ctrls(struct coda_ctx *ctx) (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) | + (1 << V4L2_MPEG_VIDEO_H264_LEVEL_5_0)), V4L2_MPEG_VIDEO_H264_LEVEL_4_0); } v4l2_ctrl_new_std(&ctx->ctrls, &coda_ctrl_ops, @@ -2437,7 +2440,7 @@ static void coda_decode_ctrls(struct coda_ctx *ctx) ctx->dev->devtype->product == CODA_7541) max = V4L2_MPEG_VIDEO_H264_LEVEL_4_0; else if (ctx->dev->devtype->product == CODA_960) - max = V4L2_MPEG_VIDEO_H264_LEVEL_4_1; + max = V4L2_MPEG_VIDEO_H264_LEVEL_5_0; else return; ctx->h264_level_ctrl = v4l2_ctrl_new_std_menu(&ctx->ctrls,