From patchwork Fri Apr 18 08:54:17 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Ming Qian(OSS)" X-Patchwork-Id: 14057083 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 6D910C369AB for ; Fri, 18 Apr 2025 09:02:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:MIME-Version:Content-Type: Content-Transfer-Encoding:References:In-Reply-To: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:List-Owner; bh=Gf0jQyJXJbh0GIVslBpxdpDBoPcwDClwvnC7scn6OXI=; b=oLjPg0g+YG80Lus5qD7UtopDLS kMsdyFYKrvepfvBNGd2c0q33swDz/oLADCUKKazGMx26QWV/xWLUbMO/XXVBljpuoy88pkBNwD+k9 5cF0wq1whdbOq5ScM4NB1Gd4lh9BbpfAch6f8HVbhbRksGfYreKLJ1rfmys0vaEmylGoPIfVY1VPV sP0pQgr9Iu+8GSAoaddNbHUF4ejp0KkNNhMSKQ9I2vDqbXLaMuUHaTIWTNL1IhfOSjQvLTGC9BiGd ikPGQyVIPnBsXHVLsYA+1DDybh+/G17UnSVtprZsmaP6ZKRYZtbwg/tINiKl2ARVif999QWq+993a CddqOYHQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1u5hbq-0000000Fhcw-0eQb; Fri, 18 Apr 2025 09:02:06 +0000 Received: from mail-am7eur03on2062c.outbound.protection.outlook.com ([2a01:111:f403:260e::62c] helo=EUR03-AM7-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1u5hVA-0000000FgXY-1viZ for linux-arm-kernel@lists.infradead.org; Fri, 18 Apr 2025 08:55:13 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=L+s952ri/gBhvVKPfeQgqzisci214P1UUi3fDqx2ndSydjUQDwM5/PNP21b86MO0Tjs+de2QQpH6kqFfrL/7Tj25PrKJY/i5Ese7Je7OC3QnYqjunNhc7Kn38M0UGfYc+BcadZjOYAmhdNwDAss7MzOWMzDcS+1nktgHNBBx/2TJyf6J4cJMz1p+4N1HLziuIwxsiZjXLkLotWY4AHKYsyF+jU0zF0d7KP/tpwnh5rV3nH2hPEvZ6Srp+gIESf7UxvQChFtP6ATIZ3Zr2+PqlGC3ZCNUfsSds5MLY0q4dZSeDq2Vgoy6hjCFD0y9yv6hDsdxu2MHvIWTP4NsQWthBg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Gf0jQyJXJbh0GIVslBpxdpDBoPcwDClwvnC7scn6OXI=; b=fj175P9OERL5iPgQIRlr7lYF2TkQ05It+DWp/w3fBhuS9ZPbKQIFHsf3ZRwXIn+LLraLKO4QQaz/ap2Vz8XlTlZV87EANoxyowe316awBm+jQTudT4kGiXpB64M0tT+xEBOyoYRoDnIKFifXBw4W1Wtfy3W3MYbsgYN9kG8/9MFCl1wCIyOcLc52x8pzK3oi2LLJAuIsNp0er89g6t3Z0E6qWRZqcm/MU9/okG5GYfRB4FXBUfZU/8Nuqo9X4i0muiV1rPexqk+KjG7PX4g4k9LyT/UDHQOMPFL4Pgqs+xQ+3kgfMlLOenQpRCQa136FYYzG+ulakRZJhVonvV1qag== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=NXP1.onmicrosoft.com; s=selector1-NXP1-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Gf0jQyJXJbh0GIVslBpxdpDBoPcwDClwvnC7scn6OXI=; b=aRRP4lHNgiKEy+v67nelheeEDip2myXh0EH3yuFEWJUisGlvU/nkbFFKH5M5Apt7BnWblfzvW/BAZ7N9n6mVDpqAtSDsUzFQ5TDqn8MayXP6O5sbspqWGiD6ZxUsBN0wPfRMmkHDOHq/l7pqVwwVBFegn0piLUsjRaVMQmnDKAD92SMZjP+zVz4ixt+dYphGYbAHmhWaTSQU9heCg+5yRfJ9DtSTQM0cqwM2kAgAkDcDUy38KCf3/0Sq7ISvp4LKltOcOgJARm7ejH8OJ1iZUwI3DTfypX88/zSJZzmv7vSnQfrHlMlJRVLsw2W0qATv9iEh/ZHa1nXQfsdDb9juAg== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=oss.nxp.com; Received: from PAXPR04MB8254.eurprd04.prod.outlook.com (2603:10a6:102:1cd::24) by VI0PR04MB10638.eurprd04.prod.outlook.com (2603:10a6:800:268::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8655.22; Fri, 18 Apr 2025 08:55:07 +0000 Received: from PAXPR04MB8254.eurprd04.prod.outlook.com ([fe80::2755:55ac:5d6f:4f87]) by PAXPR04MB8254.eurprd04.prod.outlook.com ([fe80::2755:55ac:5d6f:4f87%4]) with mapi id 15.20.8655.022; Fri, 18 Apr 2025 08:55:07 +0000 From: ming.qian@oss.nxp.com To: mchehab@kernel.org, hverkuil-cisco@xs4all.nl Cc: nicolas@ndufresne.ca, sebastian.fricke@collabora.com, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, xiahong.bao@nxp.com, eagle.zhou@nxp.com, imx@lists.linux.dev, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH v3 2/4] media: docs: dev-decoder: Trigger dynamic source change for colorspace Date: Fri, 18 Apr 2025 16:54:17 +0800 Message-ID: <20250418085422.193-2-ming.qian@oss.nxp.com> X-Mailer: git-send-email 2.48.1.windows.1 In-Reply-To: <20250418085422.193-1-ming.qian@oss.nxp.com> References: <20250418085422.193-1-ming.qian@oss.nxp.com> X-ClientProxiedBy: SG2PR03CA0130.apcprd03.prod.outlook.com (2603:1096:4:91::34) To PAXPR04MB8254.eurprd04.prod.outlook.com (2603:10a6:102:1cd::24) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB8254:EE_|VI0PR04MB10638:EE_ X-MS-Office365-Filtering-Correlation-Id: ba534594-bb99-4d01-0b89-08dd7e56b77e X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|7416014|52116014|376014|366016|38350700014; X-Microsoft-Antispam-Message-Info: I0EixdZUMwcicsalLDgFjFunSlKh+SOww1/x1Z53bdb28o/i8xEEkYtIzUPd5/GqvwW1HjHsZCzs2oXFhrVnzy/DnrBKKeHywsnnCJ7ZC3FFoClNk9QqXnQiFBpPJ0hnFIFhiOAdI+MkslvgSLokTmA2hqYj6exvD5sFrT7Cz9x8wMhSkudRR9Jh6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7v3/ror3MmSVt+EOgEtPui639UGCNxafLLFl6AS5+Qg3idHVwLODFpoEmbyApQnrx8oKP/ULwFTTpE0lnF1c4YMaCB0FDXWXRoIr6OyYAttBviGT1Hm/xBuBtY0K6i5NDbjFLQhnDfo29tm7LRpwUcGfFKPrZQtf4NqRNWa3IUHIALWu1EjyrcHVXHMI44VK+42MT4VzfXfZ/pO4SNHtiOiHL0fxuwZmu1Gw8EylsZaT6ShOml+GaEqlHJvpt7LEONA= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PAXPR04MB8254.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(7416014)(52116014)(376014)(366016)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: CPSE7yr3l0iCZ684xHeMJG72zyVAq28Zvh5CCWzVmTJkL2ZuDKJQ6X+3+NRzFy4JKnKOBQLdfX/y6meGP3pZAawf50ufW1UabTs77f/s0zqA4E5Wc61o73qWdeSXUMRU2B873ABfRkDJhy2zDqbEcuWkv9Z6fgMvug93kHDiP6LsvvtUT75JZ7RDmpl1eA7RjimGUkcUyoaofq7lmhFIBoKMz3dC2YM+7L02nFO5OeWOKb6GcmCri+FHv5DRIPUv7igTGHzqJ9JVfFGfY53J5rVjwBDKhxjVyuv6uPoXx5xpecoSU8SlSmb78BoZyqRzDdWpZyTXSBvS7Bouy791KBv+dXnTwGoDUUBv+5CV3fwhlcVnBpT8Le+d8SqAS0omcybXpfIUtA3aA3KkTMKHIu5kR/8bBzNgkZphRMnB0cKLMtjfJALLFEz2sSIDpeMbOsF25uDl0Lutn+wg7NSTvjQeFoLVNBcAqEzFBC2dlgPmu/g1dylNDIkgemdRh5p7XQRkSEvK9A0Y1uArrQqTRZwecPLjVvZHZ5QzMa/0PSJTlwYBZfWIzl2wJgUx44feGyeIrzCUFb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-Id: ba534594-bb99-4d01-0b89-08dd7e56b77e X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB8254.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Apr 2025 08:55:07.3495 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: g2UDp5HIgKEni4ZdoClbXHuynozdqkAtH/E5p1EVMbf3A3NRJlXqMF2WG1m5UVycCl3OlpmUm/UxlDsOpoQriw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI0PR04MB10638 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250418_015512_498606_36BE9C43 X-CRM114-Status: GOOD ( 11.65 ) 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 From: Ming Qian If colorspace changes, the client needs to renegotiate the pipeline, otherwise the decoded frame may not be displayed correctly. When a colorspace change in the stream, the decoder sends a V4L2_EVENT_SOURCE_CHANGE event with changes set to V4L2_EVENT_SRC_CH_COLORSPACE. After client receive this source change event, then client can switch to the correct stream setting. And each frame can be displayed properly. So add colorspace as a trigger parameter for dynamic resolution change. Signed-off-by: Ming Qian --- v2 - Add V4L2_EVENT_SRC_CH_COLORSPACE for colorspace source change event .../userspace-api/media/v4l/dev-decoder.rst | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/Documentation/userspace-api/media/v4l/dev-decoder.rst b/Documentation/userspace-api/media/v4l/dev-decoder.rst index ef8e8cf31f90..51d6da3eea4a 100644 --- a/Documentation/userspace-api/media/v4l/dev-decoder.rst +++ b/Documentation/userspace-api/media/v4l/dev-decoder.rst @@ -784,8 +784,8 @@ before the sequence started. Last of the buffers will have the must check if there is any pending event and: * if a ``V4L2_EVENT_SOURCE_CHANGE`` event with ``changes`` set to - ``V4L2_EVENT_SRC_CH_RESOLUTION`` is pending, the `Dynamic Resolution - Change` sequence needs to be followed, + ``V4L2_EVENT_SRC_CH_RESOLUTION`` or ``V4L2_EVENT_SRC_CH_COLORSPACE`` is pending, + the `Dynamic Resolution Change` sequence needs to be followed, * if a ``V4L2_EVENT_EOS`` event is pending, the `End of Stream` sequence needs to be followed. @@ -932,13 +932,17 @@ reflected by corresponding queries): * the minimum number of buffers needed for decoding, -* bit-depth of the bitstream has been changed. +* bit-depth of the bitstream has been changed, + +* colorspace of the bitstream has been changed. Whenever that happens, the decoder must proceed as follows: 1. After encountering a resolution change in the stream, the decoder sends a ``V4L2_EVENT_SOURCE_CHANGE`` event with ``changes`` set to - ``V4L2_EVENT_SRC_CH_RESOLUTION``. + ``V4L2_EVENT_SRC_CH_RESOLUTION``, or a colorspace change in the stream, the + decoder sends a ``V4L2_EVENT_SOURCE_CHANGE`` event with ``changes`` set to + ``V4L2_EVENT_SRC_CH_COLORSPACE``. .. important:: @@ -946,6 +950,11 @@ Whenever that happens, the decoder must proceed as follows: values applying to the stream after the resolution change, including queue formats, selection rectangles and controls. +.. note:: + A ``V4L2_EVENT_SOURCE_CHANGE`` event with ``changes`` set to + ``V4L2_EVENT_SRC_CH_RESOLUTION`` will affect the allocation, but + ``V4L2_EVENT_SRC_CH_COLORSPACE`` won't. + 2. The decoder will then process and decode all remaining buffers from before the resolution change point.