From patchwork Fri Jul 28 09:06:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Ripard X-Patchwork-Id: 12756 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:918b:0:b0:3e4:2afc:c1 with SMTP id s11csp311371vqg; Fri, 28 Jul 2023 02:38:31 -0700 (PDT) X-Google-Smtp-Source: APBJJlFWTs11rQloK0aAQ3L5KXNOZnvs+uU9aEjn4/aUzaIdd/Cl7NrlLTOdbztCOCFFnuZC7cMe X-Received: by 2002:a05:6512:201b:b0:4fd:fadb:e6e4 with SMTP id a27-20020a056512201b00b004fdfadbe6e4mr1240520lfb.69.1690537111031; Fri, 28 Jul 2023 02:38:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690537110; cv=none; d=google.com; s=arc-20160816; b=s0sRsZ0pr9GXGt+q+bSiIE+CFA1/A6Mld486Iha3dicx4dFV18zjMiKsGjXc+jxMmP tDJNZr2bh+SeWcj95ADwF5xkWrKRcXPnd0Ekka2eNtmH+RQo2/Y7jMI7APUDpyhlEt1E mJDMAOGCO39ZcFa8l1JXdHmy1L1pwHFYd5ZRphC+h66c7SP4+UJtFROws1p2IdvuOJgy 7ms45VldL5aIgbyipPzwW8bXPA4xfIR48KyFcFfn0rx+LW67zXFe91Hm7AHY/+WHtAd3 yOH1saiXITC1TsE0jQjMJPQKVXpOtI1p3mlPKF0QH3TJRUGesEwahWBBC8tzWydcCaua KUww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:content-transfer-encoding:mime-version :message-id:date:subject:from:dkim-signature; bh=SFGhirgEHgIoUzdpBjoeNLM2hfJYWKhb+MUvTc0SpGc=; fh=r3YnEVRF2ge3yIgpTE2H86lvFoURZyw1nrIW71mPVsw=; b=rrqUDWIF5+MJQwFpqzBIGoW8xm8yLTG+As9Sk0vIeqvZjwzHrZUOOTlkuKgWInAIWi 13Lsg7+RIv0WLuF98JuAnWT4CBQsNIPX7LpV4pls8PQiGwpRiQxsibM58/mNoUF0E2vY fKr5tNl1lQcJwpFnd6RY1yV2ZqzjKYCu+p5YUkexLOjBU7hyO7WKlTgVL9G8EWj0O6Up hcPKtk1GykNOIsvjdbu2uPeBb44E+V5dAZQB0kYegeUg4AhghYkVrzU+G4grrl328jEt RJwIwKhxF40dD1eluzUMuHzx/jlQ+k6WtDdX3mB6ntRH2tIzT8dnqQEmeOghypgknQMe HoTA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=L03GYaCq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v18-20020a056402185200b0052229f4ef42si2262235edy.192.2023.07.28.02.38.07; Fri, 28 Jul 2023 02:38:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=L03GYaCq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235218AbjG1JGa (ORCPT + 99 others); Fri, 28 Jul 2023 05:06:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57182 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235052AbjG1JGY (ORCPT ); Fri, 28 Jul 2023 05:06:24 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 99A3930E1; Fri, 28 Jul 2023 02:06:22 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 0B8A462085; Fri, 28 Jul 2023 09:06:22 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1666FC433C8; Fri, 28 Jul 2023 09:06:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1690535181; bh=z71umijlxmTAL6fmeqF7sXIHYBkziN7MrblCPM0z1qU=; h=From:Subject:Date:To:Cc:From; b=L03GYaCqlbKhW+nIfq+i8DR2wabhrsTy4zMBGpLFcCZUGMjx61km5LmkcDQgjzQ21 S6uRT8J12TQlt8GG4PtIEo0Bv1tfp5XskUIYVnI7VMLa8NhplyGWoTbMldT69FiM3H SnoQsE2WRuKtFpZCSNeM7CiC7j8fULtqmuXZX555nKm9a34cnqdizl7zW+GyZS+oem G8xv3uIggct0Dp+i4ZgTyGpcv2F68z3fSiXVC+nM1r+cf4KJECMfn5T+747Jl10NtV yEbPefhAvU4iHd94JrwjBZXNbJ+jw8vvVOwJ4g5lC5kEgXRPZRzFC0bHK2oEbqiysq EkQSM4X+wg5jQ== From: Maxime Ripard Subject: [PATCH v3 00/11] drm: kunit: Switch to kunit actions Date: Fri, 28 Jul 2023 11:06:13 +0200 Message-Id: <20230728-kms-kunit-actions-rework-v3-0-952565ccccfe@kernel.org> MIME-Version: 1.0 X-B4-Tracking: v=1; b=H4sIAAWFw2QC/43NwQ7CIAyA4VcxnMVACUM9+R7GwwZ1IyiYMqdm2 bvLdtKL8fg37deRZSSPme1XIyMcfPYpllDrFbNdHVvk3pVmIEAJIwUP18zDPfqe17Yvy5kTPhI Frp2slKnA7lTDyvmN8OyfC308le587hO9lk+DnKd/oIPkghsAq7fOgDVwCEgRL5tELZvVAT4k+ CVBkaTRQprG6apuvqRpmt4wTD9qCwEAAA== To: David Airlie , Daniel Vetter , Maarten Lankhorst , Thomas Zimmermann , Emma Anholt Cc: =?utf-8?q?Ma=C3=ADra_Canal?= , Javier Martinez Canillas , dri-devel@lists.freedesktop.org, David Gow , linux-kselftest@vger.kernel.org, kunit-dev@googlegroups.com, linux-kernel@vger.kernel.org, Maxime Ripard , Brendan Higgins X-Mailer: b4 0.12.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=2216; i=mripard@kernel.org; h=from:subject:message-id; bh=z71umijlxmTAL6fmeqF7sXIHYBkziN7MrblCPM0z1qU=; b=owGbwMvMwCX2+D1vfrpE4FHG02pJDCmHWzkXrdfJTwr95F2i8+Cv1DTxK8/NejVFbBTe7Y0tz d3J73+yo5SFQYyLQVZMkSVG2HxJ3KlZrzvZ+ObBzGFlAhnCwMUpABPJ2cnI8GKBgLPzfDsnbtew 80s2iL+odN63kWN+loHf7Ysq367IvGdk+PV4xXkz8UpG/qDfNc+t16at9v+U+MUkzWl2ud1nkx5 9DgA= X-Developer-Key: i=mripard@kernel.org; a=openpgp; fpr=BE5675C37E818C8B5764241C254BCFC56BF6CE8D X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1772656641610911222 X-GMAIL-MSGID: 1772656641610911222 Hi, Since v6.5-rc1, kunit gained a devm/drmm-like mechanism that makes tests resources much easier to cleanup. This series converts the existing tests to use those new actions where relevant. Let me know what you think, Maxime Signed-off-by: Maxime Ripard --- Changes in v3: - Fixed the build cast warnings by switching to wrapper functions - Link to v2: https://lore.kernel.org/r/20230720-kms-kunit-actions-rework-v2-0-175017bd56ab@kernel.org Changes in v2: - Fix some typos - Use plaltform_device_del instead of removing the call to platform_device_put after calling platform_device_add - Link to v1: https://lore.kernel.org/r/20230710-kms-kunit-actions-rework-v1-0-722c58d72c72@kernel.org --- Maxime Ripard (11): drm/tests: helpers: Switch to kunit actions drm/tests: client-modeset: Remove call to drm_kunit_helper_free_device() drm/tests: modes: Remove call to drm_kunit_helper_free_device() drm/tests: probe-helper: Remove call to drm_kunit_helper_free_device() drm/tests: helpers: Create a helper to allocate a locking ctx drm/tests: helpers: Create a helper to allocate an atomic state drm/vc4: tests: pv-muxing: Remove call to drm_kunit_helper_free_device() drm/vc4: tests: mock: Use a kunit action to unregister DRM device drm/vc4: tests: pv-muxing: Switch to managed locking init drm/vc4: tests: Switch to atomic state allocation helper drm/vc4: tests: pv-muxing: Document test scenario drivers/gpu/drm/tests/drm_client_modeset_test.c | 8 -- drivers/gpu/drm/tests/drm_kunit_helpers.c | 141 +++++++++++++++++++++++- drivers/gpu/drm/tests/drm_modes_test.c | 8 -- drivers/gpu/drm/tests/drm_probe_helper_test.c | 8 -- drivers/gpu/drm/vc4/tests/vc4_mock.c | 12 ++ drivers/gpu/drm/vc4/tests/vc4_test_pv_muxing.c | 115 +++++++------------ include/drm/drm_kunit_helpers.h | 7 ++ 7 files changed, 198 insertions(+), 101 deletions(-) --- base-commit: d7b3af5a77e8d8da28f435f313e069aea5bcf172 change-id: 20230710-kms-kunit-actions-rework-5d163762c93b Best regards,