From patchwork Mon Aug 12 07:08:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "jackson.lee" X-Patchwork-Id: 99146 Received: from ny.mirrors.kernel.org ([147.75.199.223]) by linuxtv.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1sdPAg-0004T6-34 for patchwork@linuxtv.org; Mon, 12 Aug 2024 07:08:52 +0000 Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id E7DBB1C21482 for ; Mon, 12 Aug 2024 07:08:49 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2994B15351C; Mon, 12 Aug 2024 07:08:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chipsnmedia.com header.i=@chipsnmedia.com header.b="hqWesXsb" X-Original-To: linux-media@vger.kernel.org Received: from SLXP216CU001.outbound.protection.outlook.com (mail-koreacentralazon11021080.outbound.protection.outlook.com [40.107.42.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1479E1509BF; Mon, 12 Aug 2024 07:08:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.42.80 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723446524; cv=fail; b=EigYdK4Nv4oSDAobmWumPtAqTzfZDQ38BpS4mBPAGHupLF9th7gEjQCPtrpM6pBU5BKQCKyxj4ecUZKJdTBqW8M95EPReviakXkbDzpS7lgB4/mQS3oSlNvmT5g6smDhkKg9Cfek1+8zf/dZ50FoegvRBY9SpW/mxTcXjhj37KU= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723446524; c=relaxed/simple; bh=KzqF/BYoVOAk4ZeaeOrZUqcMjbwnR3OW3/wPyuBJY3o=; h=From:To:Cc:Subject:Date:Message-Id:Content-Type:MIME-Version; b=dTSvFgi3+0zxpYJJn8CqEuG5FQNUX9+cQ1R0aRSCdDt22mISN2kKkHw7NkceiShr/qg7fI3O9k0eflZpeDFH9MA/vxX5YiMx0JYE0pY6jDWJsVi3phmpGpzodxhGCJfuncsBdT66gmS7O/3DCKmpJFXORRcj7DsKd3mB8ZwI7G8= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=chipsnmedia.com; spf=pass smtp.mailfrom=chipsnmedia.com; dkim=pass (1024-bit key) header.d=chipsnmedia.com header.i=@chipsnmedia.com header.b=hqWesXsb; arc=fail smtp.client-ip=40.107.42.80 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=chipsnmedia.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chipsnmedia.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=k+BhthuWVaaHf55FmTWklcIgQq+lDPcn3A58LANWMPm05Q7rgybVh7xV41ZiUhpdglaCIlg6lK4pyQ30mmaV5r5HrEcOOny0jpIc0D8OvOxw6wiJDnWBmp2RbqWDL/dG63hSn7Yw5yLaPSrr6YW5obbnNT0931eQ7pPV/uULK/F/RQzDglQCuD+6s+cf4/ORXowtQIeS2moBznG0s90tiPV0GN6LSOq/C5HxVFjk7lAtJypRpradEebAFYlyTJfSUN7DEPkoz1g1O+kBlDnzkDaEOy7OL5bFNFI1iSPnHB8N5StCkzsqfwdlYqHJbIjHAqanynUPwXJz3XXs8IfmLg== 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=brB67GLI1wOpzyD84CFjzweb0TbuHeKLCjyDLcDkzjQ=; b=QRbTEGhK4mJO5kzIVh42dYxuzsBF1lf8fnVXhUSpeUGvbvnXXlF42w7ql2ZaoPcrrOtf4h11Ez4gewc1Qm/OV2TEUgRvr4Lcrfdd/6sv86GhOoG36GNuvp6H1I87jw17QlIvPdQj5XeQDYeHj+4JeDYj+4H4DUa/TTpOIXOz/oGT5RQOm2rFxaw5Kc7DvebTjxn1O1ERN02HKDki2sv1ULly7R9dh/iZvta9gsPW6yimwMkBj7wx89uCGuA8B4UnsRorOxnpYeXg6gGJKQUZ7Lt/4Dt90DI11ayAsdtT8owwsPZz+Du6zd8qu9JR1GYTRo793rnk7CiGtCH/imu+Xw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=chipsnmedia.com; dmarc=pass action=none header.from=chipsnmedia.com; dkim=pass header.d=chipsnmedia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chipsnmedia.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=brB67GLI1wOpzyD84CFjzweb0TbuHeKLCjyDLcDkzjQ=; b=hqWesXsbZKPQ+bV2WX0WrKPOVy/yVGm5qjF5YdztAC/d/wkt+sz1OUFr1Xw1I19SByUuRwPVbDD6PChQMxzjqERtAWKN3oLOuLyDztGKs0tWhF436LOs5yCWrzNL30RakrzUHcGiaSW9ix/C1o0pp35l4B1FTM/KCgY9Vlw7QkM= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=chipsnmedia.com; Received: from SE1P216MB1303.KORP216.PROD.OUTLOOK.COM (2603:1096:101:15::5) by SL2P216MB1530.KORP216.PROD.OUTLOOK.COM (2603:1096:101:33::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7849.20; Mon, 12 Aug 2024 07:08:39 +0000 Received: from SE1P216MB1303.KORP216.PROD.OUTLOOK.COM ([fe80::b711:5ab1:b5a4:d01b]) by SE1P216MB1303.KORP216.PROD.OUTLOOK.COM ([fe80::b711:5ab1:b5a4:d01b%7]) with mapi id 15.20.7849.019; Mon, 12 Aug 2024 07:08:39 +0000 From: "Jackson.lee" To: mchehab@kernel.org, nicolas@ndufresne.ca, sebastian.fricke@collabora.com Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, hverkuil@xs4all.nl, nas.chung@chipsnmedia.com, lafley.kim@chipsnmedia.com, b-brnich@ti.com, jackson.lee@chipsnmedia.com Subject: [RESEND PATCH v7 0/4] Add features to an existing driver Date: Mon, 12 Aug 2024 16:08:19 +0900 Message-Id: <20240812070823.125-1-jackson.lee@chipsnmedia.com> X-Mailer: git-send-email 2.34.1 X-ClientProxiedBy: SL2P216CA0154.KORP216.PROD.OUTLOOK.COM (2603:1096:101:35::18) To SE1P216MB1303.KORP216.PROD.OUTLOOK.COM (2603:1096:101:15::5) Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SE1P216MB1303:EE_|SL2P216MB1530:EE_ X-MS-Office365-Filtering-Correlation-Id: 5f822aa4-dba6-4cfb-fbcc-08dcba9d9730 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|366016|376014|52116014|38350700014; X-Microsoft-Antispam-Message-Info: +ODTPoidaw0W7temHGxqSHi3ZpkRyQYmmdr8hdoKCIZlo6aBhgExS1nye2HRiEYvcusnjovvL03VVjdlMgFwY4/NAg3bZdjCoxGLO8m1RioobITf3upm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G7+ORUhGnt9UZZl6E4w/QPYDe076eOg3xSFBMZP5Vy2imN5njAT/ATsy/Jx6GLuCzZDrrNVcWuSI9GQtCicqBDxVOzcMZNtAPBx84pkArSKPtXsQlspbtm4urD/RnJMwTY3cGpXg6DIU84CcBVW3Vqq5pJ1nYjVBQKweJBR2darb9s9UKm+q3V7rRq+1AGjAGQ6mmy0vX9Bb++7aEc/Xq5jpdw== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SE1P216MB1303.KORP216.PROD.OUTLOOK.COM;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(366016)(376014)(52116014)(38350700014);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: lRGJ41dm0l2apts1Uyy7/Fg/i3sXMeCl+L5e/bZqS+nrLYFssBu/3XqZXfY21umpfqbMvgD0luDPfRVtFnwIG3KvtB0Be6eV/HdTSeOcfNUZNQqOil6vW9wmD45Ti8Q7THF0+v+I9KfmgnQ6GIGm94cWTa6h3KI3a/+OuQnWLFEGrJOyuQM+9dHRxyvSG5KQ+tGylMTHM6wUOo5X6naHM+FK7KGY79OmvOxZVkITvrJL1N7IT2gGjAqwEvuCljVcgnX+QSVWw95asKPJ60VuNARV4OayzDYgTlvKCWIasa+pr7plAHzfpVktxJGj85ssqofHafQbx4J8dJEZOfTbuh47FbkSVa6+Ws8G380PKnwe10wxnWu5GHfzRuRv0YbSNKRoT0nPtgKVFB0yfGCTYo/e1bLmFaIctXrg5xJIZaBN4RAwftx2VPbhSTqQjlVqFH+o0IY62mj1fSKVb1sck2Nvuf0DNtx8UjN4TfFcBoz/Cv3mWR2mRYcAp8IpHl9YUO0SCAyOasOgONafH0wAFcG/6vfhlhpbl9NmawbmwpoSHkgD5RX1GqR1TetOOggmJ08MGtfnuaNck6QS83//GSjzM6pN12bPqCDx5fHqqDePXoWnFGXabirz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d9730 X-MS-Exchange-CrossTenant-AuthSource: SE1P216MB1303.KORP216.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Aug 2024 07:08:39.0132 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4d70c8e9-142b-4389-b7f2-fa8a3c68c467 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: hJu8H73R8z8CLDtxY1qDnMI1yIhKxE9jlphghZXevM75leNIvoq+/yr1c/9wPodgBHfWESoG/V6ZMbWHK7ht61ooJSoCTZJceHjAdHw4C2A= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SL2P216MB1530 X-LSpam-Score: -6.3 (------) X-LSpam-Report: No, score=-6.3 required=5.0 tests=ARC_SIGNED=0.001,ARC_VALID=-0.1,BAYES_00=-1.9,DKIM_SIGNED=0.1,DKIM_VALID=-0.1,DKIM_VALID_AU=-0.1,DMARC_MISSING=0.001,HEADER_FROM_DIFFERENT_DOMAINS=0.5,MAILING_LIST_MULTI=-1,RCVD_IN_VALIDITY_CERTIFIED=-3,RCVD_IN_VALIDITY_RPBL=1.31,RCVD_IN_VALIDITY_SAFE=-2,SPF_HELO_NONE=0.001,SPF_PASS=-0.001 autolearn=ham autolearn_force=no The wave5 codec driver is a stateful encoder/decoder. The following patches is for supporting yuv422 inpuy format, supporting runtime suspend/resume feature and extra things. v4l2-compliance results: ======================== v4l2-compliance 1.24.1, 64 bits, 64-bit time_t Buffer ioctls: warn: v4l2-test-buffers.cpp(693): VIDIOC_CREATE_BUFS not supported warn: v4l2-test-buffers.cpp(693): VIDIOC_CREATE_BUFS not supported test VIDIOC_REQBUFS/CREATE_BUFS/QUERYBUF: OK test VIDIOC_EXPBUF: OK test Requests: OK (Not Supported) Total for wave5-dec device /dev/video0: 45, Succeeded: 45, Failed: 0, Warnings: 2 Total for wave5-enc device /dev/video1: 45, Succeeded: 45, Failed: 0, Warnings: 0 Fluster test results: ===================== Running test suite JCT-VC-HEVC_V1 with decoder GStreamer-H.265-V4L2-Gst1.0 Using 1 parallel job(s) Ran 132/147 tests successfully in 89.870 secs (1 test fails because of not supporting to parse multi frames, 1 test fails because of a missing frame and slight corruption, 2 tests fail because of sizes which are incompatible with the IP, 11 tests fail because of unsupported 10 bit format) Running test suite JVT-AVC_V1 with decoder GStreamer-H.264-V4L2-Gst1.0 Using 1 parallel job(s) Ran 77/135 tests successfully in 30.364 secs (58 fail because the hardware is unable to decode MBAFF / FMO / Field / Extended profile streams.) Change since v6: ================ * For [PATCH v4 2/4] media: chips-media: wave5: Support runtime suspend/resume - Change autosuspend delay to 100ms - Add to enable/disable hrtimer in the runtime suspend/resume function for hw not using irq Change since v5: ================ * For [PATCH v4 3/4] media: chips-media: wave5: Use helpers to calculate bytesperline and sizeimage. - Fix v4l2-compliance error for the vidioc_enum_framesizes * For [PATCH v4 1/4] media: chips-media: wave5: Support SPS/PPS generation for each IDR - Remove warning messages for the checkpatch.pl script Change since v4: ================ * For [PATCH v4 2/4] media: chips-media: wave5: Support runtime suspend/resume - Fix warning message * For [PATCH v4 3/4] media: chips-media: wave5: Use helpers to calculate bytesperline and sizeimage. - Fix warning message - add Reviewed-By tag * For [PATCH v4 4/4] media: chips-media: wave5: Support YUV422 raw pixel-formats on the encoder - add Reviewed-By tag Change since v3: ================= * For [PATCH v4 1/4] media: chips-media: wave5: Support SPS/PPS generation for each IDR - add Reviewed-By tag * For [PATCH v4 2/4] media: chips-media: wave5: Support runtime suspend/resume - add Reviewed-By tag * For [PATCH v4 3/4] media: chips-media: wave5: Use helpers to calculate bytesperline and sizeimage. - modify the commit message - define three framesize structures for decoder * For [PATCH v4 4/4] media: chips-media: wave5: Support YUV422 raw pixel-formats on the encoder - modify the commit message - use the v4l2_format_info to calculate luma, chroma size Change since v2: ================= * For [PATCH v3 0/4] media: chips-media: wave5: Support SPS/PPS generation for each IDR - add the suggested _SHIFT suffix * For [PATCH v3 1/4] media: chips-media: wave5: Support runtime suspend/resume - change a commit message * For [PATCH v3 2/4] media: chips-media: wave5: Use helpers to calculate bytesperline and sizeimage - add pix_fmt_type parameter into wave5_update_pix_fmt function - add min/max width/height values into dec_fmt_list Change since v1: ================= * For [PATCH v2 0/4] media: chips-media: wave5: Support SPS/PPS generation for each IDR - define a macro for register addresses * For [PATCH v2 1/4] media: chips-media: wave5: Support runtime suspend/resume - add auto suspend/resume * For [PATCH v2 2/4] media: chips-media: wave5: Use helpers to calculate bytesperline and sizeimage - use helper functions to calculate bytesperline and sizeimage * For [PATCH v2 3/4] media: chips-media: wave5: Support YUV422 raw pixel-formats on the encoder - remove unnecessary codes Change since v0: ================= The DEFAULT_SRC_SIZE macro was defined using multiple lines, To make a simple define, tab and multiple lines has been removed, The macro is defined using one line. Jackson.lee (4): media: chips-media: wave5: Support SPS/PPS generation for each IDR media: chips-media: wave5: Support runtime suspend/resume media: chips-media: wave5: Use helpers to calculate bytesperline and sizeimage. media: chips-media: wave5: Support YUV422 raw pixel-formats on the encoder. .../platform/chips-media/wave5/wave5-helper.c | 37 +- .../platform/chips-media/wave5/wave5-helper.h | 5 + .../platform/chips-media/wave5/wave5-hw.c | 30 +- .../chips-media/wave5/wave5-vpu-dec.c | 321 +++++++----------- .../chips-media/wave5/wave5-vpu-enc.c | 313 +++++++++-------- .../platform/chips-media/wave5/wave5-vpu.c | 50 +++ .../platform/chips-media/wave5/wave5-vpu.h | 5 +- .../platform/chips-media/wave5/wave5-vpuapi.c | 33 +- .../platform/chips-media/wave5/wave5-vpuapi.h | 1 + .../chips-media/wave5/wave5-vpuconfig.h | 27 +- .../media/platform/chips-media/wave5/wave5.h | 3 + 11 files changed, 460 insertions(+), 365 deletions(-)