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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (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 E086CC47DB3 for ; Mon, 29 Jan 2024 15:26:37 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id F263010F785; Mon, 29 Jan 2024 15:26:36 +0000 (UTC) Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2053.outbound.protection.outlook.com [40.107.92.53]) by gabe.freedesktop.org (Postfix) with ESMTPS id 8C9C111299E; Mon, 29 Jan 2024 15:26:35 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Psny0RXjZAW76/ZR09U+vcfSjL5LuaZyLUElKi0kDscNugOpg5YLgb3RVvPUqbOiVxv4imXX7y58mu94nO8XHzP1OuLi21qx07PLT0AcNEv1MLLAuOYtrgiuLUmEEqHk1dVeFK45DYrDvDfYHCpUioqwuxpyrnrdInFt5qh9aSL+AiMmXzggO3zGX2RP2lyDqlikA3GbqRuNyoUiUEjQqL6mjfBavYvsMJT5IrLbHJVTr6a9QAKaqaJQlirll8lJj8LCf94/gRxx+eNy2zeJ87DN/XUrROnTTVF6WBpWnhah+YdQ//7lnzOnT3nuLLpRNa1ALCmK2EnuAKnFe6L+TA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=rnorqQGDhu9gzkLbx7C3ZbEoLgKkp1oPgitcQqPdElk=; b=AFMpX5SYRGhmmPB1bOi6YkHpHuvMOZ8puf1cQvAE8B5c83unhEOaLWsTmco1I9MO6LC/yAEBt5RwgmE9a8sMHi2k48Yw7CJBp8PjbAiW1UopgbXwjQKz83VWcBGnyCTBlp97lnkgH4TtE4hkZcJguEFaqo5gkwuxa4HOGDaq4b1Jn9/V9htwHEfK5lsCay9+fOfpWjohUs8vxaBMmCtTjyXMgB/s0nqTmIC9JKyDs7NVJDQvznQuEPZPAUdmIkPPCEE5W6xYObeatSxDJsSBQC0CQowlGL/h1rBKmMWNQ//AltuZWC8mfE/Yf7s1+UTp1IqGfbW87KNZKXjrGWaksw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=rnorqQGDhu9gzkLbx7C3ZbEoLgKkp1oPgitcQqPdElk=; b=dgtsyPWgQe1L9k8fmir9m4e73vz3r78Scs5vMMnprCjWHqCtRubCVueDYR47EfDPXzHyatoJMylk99Z9HdnMmwDPCYgQwFP1u23Imgi7sKt9DgzmoHYzerbuhqdwwkjWwAhkHaikcY1je32D3ePeOLv3xQVwPUGMLYC+4Nva564= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; Received: from PH7PR12MB5685.namprd12.prod.outlook.com (2603:10b6:510:13c::22) by SJ2PR12MB8652.namprd12.prod.outlook.com (2603:10b6:a03:53a::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7228.33; Mon, 29 Jan 2024 15:26:29 +0000 Received: from PH7PR12MB5685.namprd12.prod.outlook.com ([fe80::e1fb:4123:48b1:653]) by PH7PR12MB5685.namprd12.prod.outlook.com ([fe80::e1fb:4123:48b1:653%4]) with mapi id 15.20.7228.029; Mon, 29 Jan 2024 15:26:29 +0000 Message-ID: Date: Mon, 29 Jan 2024 16:26:20 +0100 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v4 0/8] drm/amd/display: Introduce KUnit to Display Mode Library Content-Language: en-US To: Rodrigo Siqueira , Alex Deucher , Xinhui.Pan@amd.com, David Airlie , Daniel Vetter , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Harry Wentland , Leo Li , Nicholas Choi , Daniel Latypov , David Gow , hersenxs.wu@amd.com, magalilemes00@gmail.com References: <20240126155022.1184856-1-Rodrigo.Siqueira@amd.com> From: =?UTF-8?Q?Christian_K=C3=B6nig?= In-Reply-To: <20240126155022.1184856-1-Rodrigo.Siqueira@amd.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-ClientProxiedBy: FR2P281CA0149.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:98::10) To PH7PR12MB5685.namprd12.prod.outlook.com (2603:10b6:510:13c::22) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PH7PR12MB5685:EE_|SJ2PR12MB8652:EE_ X-MS-Office365-Filtering-Correlation-Id: 7b5f255f-36c7-4248-2e34-08dc20deaa64 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 5yMN8QIc0jV1xV3Gxua7TtbNprMgp3rQ5QiqaQO+9LUG4PhEE5s9Iu4Vb99+beumFgJ1qwL5afqTPGu1VB6ob2ZYQrJV0BLeyOkxRSG6gw24TnDttZLUkUp1XwWvEPKBfnkPE5PyYwSTS2KieYIN+qaTM4qAdaRBQKDePQyzVKQUgwp1ZNAvhlsiEIo1W75WGfQxy/9A+/fE2gGC7itXkgAJosBtbnMdy0nE0hvho4NYiq4IFniBqO7HlOSEXiyLxmajGOesACAymNx7Qd4vBGkV1+bUyeSDGyOyCpUnWV4Q0yrm209YSSNOQisO3IGYbt3M1z6o2kmWBZeR57ooUEYEQIP+RmWQ84YiTfr5g8QMauEg8kBiI/NTMI7FzY9CabQM0dIJADYFRo4woNXgus2kibK/chEwos+Z08vX1GSzjX811Es2KWcDNFvDwhmC41eMhB2yFMo8dGHVKdF9gxGI9DJx/OZ+xqP8gfd7Y55/iTlB880rzQGHs+nGE5GIKbTBOpgaMo1yXWEmKhGRIAFtKGjgJ2edLqsvteAxBE2fNkHrQ1edvb50Am1OUBrbpMfEVtXDAe7m75+sKB3DlpP3oJy6LoR9UZDDv7G8pY7f8SyDyJWlPNdZPAi5d5E6DndCoTWw8PzK6Ar7JFS5kkNCCz7jIix7UZ35ItcL8zc= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PH7PR12MB5685.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(39860400002)(366004)(396003)(346002)(376002)(136003)(230922051799003)(451199024)(1800799012)(186009)(64100799003)(8936002)(8676002)(316002)(66946007)(66556008)(66476007)(7416002)(4326008)(110136005)(26005)(83380400001)(31686004)(478600001)(6666004)(31696002)(38100700002)(86362001)(2906002)(5660300002)(6486002)(966005)(54906003)(2616005)(6512007)(6506007)(36756003)(921011)(66574015)(41300700001)(66899024)(43740500002)(45980500001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?MWpVUkwyN1luWW5KYVhYdFFjOU1hZWs0M0NhQXJpWFJ2c2hHTmhTOUs5Z3pQ?= =?utf-8?B?RVpqb2FYTkpicHZSdXJ0MnNybHVDak9GZEdGck5BZVYxdGM2eVV1TUJ4ZFpU?= =?utf-8?B?dmRHQ1FUd1FoUVV3dUhSTUlqYTZHN2FScXNJNnBLR1pDV0FVUzhxeXQzVHpY?= =?utf-8?B?YU9xR1JYbEEyOVljR0c2c28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5?= =?utf-8?B?ZjQ0ckh0RVByVEEyWWlRUnpFSW1kc29yc0sxeWgxckhuZ2YwVzRoYVBYOW1h?= =?utf-8?B?aGRxL0pDSFVxb1cydElBTm5NNC9DTG91eU1XTFVEcW1Oc1NWVlBDYkt5Vk9V?= =?utf-8?Q?ZRoM=3D?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7b5f255f-36c7-4248-2e34-08dc20deaa64 X-MS-Exchange-CrossTenant-AuthSource: PH7PR12MB5685.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Jan 2024 15:26:29.7061 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: QmW/5FhK2pjrHp0JT9EeW/GwBNQIIhBCuwYikmmdikNq4jMG74JuA3DSAaJfDVJ/ X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ2PR12MB8652 X-BeenThere: amd-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion list for AMD gfx List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: tales.aparecida@gmail.com, Trevor Woerner , javierm@redhat.com, dri-devel@lists.freedesktop.org, mwen@igalia.com, =?UTF-8?Q?Ma=C3=ADra_Canal?= , amd-gfx@lists.freedesktop.org, Isabella Basso , andrealmeid@riseup.net, kunit-dev@googlegroups.com Errors-To: amd-gfx-bounces@lists.freedesktop.org Sender: "amd-gfx" That we include so many C files with relative paths seems to be odd. Apart from that looks good to me. Christian. Am 26.01.24 um 16:48 schrieb Rodrigo Siqueira: > In 2022, we got a great patchset from a GSoC project introducing unit > tests to the amdgpu display. Since version 3, this effort was put on > hold, and now I'm attempting to revive it. I'll add part of the original > cover letter at the bottom of this cover letter, but you can read all > the original messages at: > > https://lore.kernel.org/amd-gfx/20220912155919.39877-1-mairacanal@riseup.net/ > > Anyway, this new version changes are: > - Rebase and adjust conflicts. > - Rewrite part of the dc_dmub_srv_test to represent a real scenario that > simulates some parameter configuration for using 4k144 and 4k240 > displays. > > Thanks > Siqueira > > Original cover letter > > Hello, > > This series is version 3 of the introduction of unit testing to the > AMDPGU driver [1]. > > Our main goal is to bring unit testing to the AMD display driver; in > particular, we'll focus on the Display Mode Library (DML) for DCN2.0, > DMUB, and some of the DCE functions. This implementation intends to > help developers to recognize bugs before they are merged into the > mainline and also makes it possible for future code refactors of the > AMD display driver. > > For the implementation of the tests, we decided to go with the Kernel > Unit Testing Framework (KUnit). KUnit makes it possible to run test > suites on kernel boot or load the tests as a module. It reports all test > case results through a TAP (Test Anything Protocol) in the kernel log. > Moreover, KUnit unifies the test structure and provides tools to > simplify the testing for developers and CI systems. > > In regards to CI pipelines, we believe kunit_tool [2] provides > ease of use, but we are also working on integrating KUnit into IGT [3]. > > Since the second version, we've chosen a mix of approaches to integrate > KUnit tests into amdgpu: > 1. Tests that use static functions are included through guards [4]. > 2. Tests without static functions are included through a Makefile. > > We understand that testing static functions is not ideal, but taking into > consideration that this driver relies heavily on static functions with > complex behavior which would benefit from unit testing, otherwise, black-box > tested through public functions with dozens of arguments and sometimes high > cyclomatic complexity. > > The first seven patches represent what we intend to do for the rest of the > DML modules: systematic testing of the DML functions, especially mathematically > complicated functions. Also, it shows how simple it is to add new tests to the DML. > > Among the tests, we highlight the dcn20_fpu_test, which, had it existed > then, could catch the defects introduced to dcn20_fpu.c by 8861c27a6c [5] > later fixed by 9ad5d02c2a [6]. > > In this series, there's also an example of how unit tests can help avoid > regressions and keep track of changes in behavior. > > [..] > > Isabella Basso (1): > drm/amd/display: Introduce KUnit tests to display_rq_dlg_calc_20 > > Magali Lemes (1): > drm/amd/display: Introduce KUnit tests for dcn20_fpu > > MaĆ­ra Canal (5): > drm/amd/display: Introduce KUnit tests to the bw_fixed library > drm/amd/display: Introduce KUnit tests to the display_mode_vba library > drm/amd/display: Introduce KUnit to dcn20/display_mode_vba_20 library > drm/amd/display: Introduce KUnit tests to dc_dmub_srv library > Documentation/gpu: Add Display Core Unit Test documentation > > Tales Aparecida (1): > drm/amd/display: Introduce KUnit tests for fixed31_32 library > > .../gpu/amdgpu/display/display-test.rst | 88 ++ > Documentation/gpu/amdgpu/display/index.rst | 1 + > drivers/gpu/drm/amd/display/Kconfig | 52 + > drivers/gpu/drm/amd/display/Makefile | 2 +- > drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c | 4 + > .../dc/dml/dcn20/display_mode_vba_20.c | 4 + > .../dc/dml/dcn20/display_rq_dlg_calc_20.c | 4 + > drivers/gpu/drm/amd/display/tests/Makefile | 18 + > .../display/tests/dc/basics/fixpt31_32_test.c | 232 +++++ > .../amd/display/tests/dc/dc_dmub_srv_test.c | 159 ++++ > .../tests/dc/dml/calcs/bw_fixed_test.c | 323 +++++++ > .../tests/dc/dml/dcn20/dcn20_fpu_test.c | 561 +++++++++++ > .../dc/dml/dcn20/display_mode_vba_20_test.c | 888 ++++++++++++++++++ > .../dml/dcn20/display_rq_dlg_calc_20_test.c | 124 +++ > .../tests/dc/dml/display_mode_vba_test.c | 741 +++++++++++++++ > 15 files changed, 3200 insertions(+), 1 deletion(-) > create mode 100644 Documentation/gpu/amdgpu/display/display-test.rst > create mode 100644 drivers/gpu/drm/amd/display/tests/Makefile > create mode 100644 drivers/gpu/drm/amd/display/tests/dc/basics/fixpt31_32_test.c > create mode 100644 drivers/gpu/drm/amd/display/tests/dc/dc_dmub_srv_test.c > create mode 100644 drivers/gpu/drm/amd/display/tests/dc/dml/calcs/bw_fixed_test.c > create mode 100644 drivers/gpu/drm/amd/display/tests/dc/dml/dcn20/dcn20_fpu_test.c > create mode 100644 drivers/gpu/drm/amd/display/tests/dc/dml/dcn20/display_mode_vba_20_test.c > create mode 100644 drivers/gpu/drm/amd/display/tests/dc/dml/dcn20/display_rq_dlg_calc_20_test.c > create mode 100644 drivers/gpu/drm/amd/display/tests/dc/dml/display_mode_vba_test.c >