From patchwork Mon Jan 15 17:13:47 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Micha=C5=82_Winiarski?= X-Patchwork-Id: 13519859 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 67C47C47422 for ; Mon, 15 Jan 2024 17:14:15 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id ADA4B10E33D; Mon, 15 Jan 2024 17:14:14 +0000 (UTC) Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.115]) by gabe.freedesktop.org (Postfix) with ESMTPS id B4EAC10E333; Mon, 15 Jan 2024 17:14:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1705338852; x=1736874852; h=from:to:cc:subject:date:message-id:in-reply-to: references:content-transfer-encoding:mime-version; bh=yRMxCdjoqIkD75SEuJzObVSQ7nqozqsXnQwiAAoCr5k=; b=ZW27j3xPR2nF9Zk+UByt/CfyMLWgNP8SHrpIhEq1/t5RUgCW0nrZwfRO EP2L91NVxfqcWv8U3o8r/P6YSLUgC/wIqljVQZ3v5uucq/gxTBzglhmYe icQPw9O7GqOPfyKGV58lGZOpwo79dcYEZ1mJjZreXl3Lgb13GKQTGjeu5 CZDAf1WclROimHNHpCHr1qH56DENqKEAd44Z13X9VqwtxM9jKrEFoutFk SgfTzTeuWhVKhcDBi8qwaXG+g5n+5L7nDvnwAxFi9cd9eD2mDscAzbI67 f99ki1BbeRrniyhNNdI3zfyPitAwa1CebbYGUZ0EPUx1oQ+yviA7ICQNw g==; X-IronPort-AV: E=McAfee;i="6600,9927,10954"; a="399336721" X-IronPort-AV: E=Sophos;i="6.04,197,1695711600"; d="scan'208";a="399336721" Received: from fmviesa002.fm.intel.com ([10.60.135.142]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Jan 2024 09:14:12 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.04,197,1695711600"; d="scan'208";a="18189248" Received: from orsmsx603.amr.corp.intel.com ([10.22.229.16]) by fmviesa002.fm.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 15 Jan 2024 09:14:11 -0800 Received: from orsmsx611.amr.corp.intel.com (10.22.229.24) by ORSMSX603.amr.corp.intel.com (10.22.229.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Mon, 15 Jan 2024 09:14:11 -0800 Received: from orsmsx602.amr.corp.intel.com (10.22.229.15) by ORSMSX611.amr.corp.intel.com (10.22.229.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Mon, 15 Jan 2024 09:14:10 -0800 Received: from ORSEDG602.ED.cps.intel.com (10.7.248.7) by orsmsx602.amr.corp.intel.com (10.22.229.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35 via Frontend Transport; Mon, 15 Jan 2024 09:14:10 -0800 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (104.47.59.169) by edgegateway.intel.com (134.134.137.103) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.35; Mon, 15 Jan 2024 09:14:10 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JxrAG7DgHuM0I+Mf+Kh++Ukeqni1bgCvagY6DpnKiQMy2RvNEdZxEoHcTrexExAoBIBbhVevfyEoe+sz/FMwxxx4hYXYa2X4iz0XWId9oINBuRNIsZ1JP0IOVXpD6+8CITYAKpmvh+KpmQUEHuDIdfynVYN+5pDt6/Lc48rL6Hqn38Bo6JNPZEJv/Yhd2ZO+6NzAn2tgkZhUqERr7vPjRPE3+bYdZXFOYKG2CDx+BQIRkRhroBDiHlGZQ/pEzkg7QWpsFNCZ/ji9sDPBsE4Uodxv9HmCbkCNZR1mHCa2kauBsN648RbagJjKZOnBquAVmeuwKs4kNDo/AlyZ9J0GCA== 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=dkhLHh0crXwXx0APrqjN+/BQ8dQyd7xvanE/ap6H1sA=; b=QCfyQjbv8bUDNugwO17lYHTfZSlp7D97+rQMa2oPkyqZtANCdhOUJpjzcPWtfxG2JN6ISjymFtPZK74+4LAUVaeX0EFSgf3Y1jP7eOPjkVfMGfSH02gBmQCJdh56SlksgNXiGAjbZfuBepacm993kqLrdMUFMlfCw0uOoyMmd6OL7kEg1khV3rwLVWxYA9w2OfVvPxScmUDJsiEpkXN/JeayptEvFSyLzkdYhVqvA31aUGlGRDfrkXQ1MwiAyuDphmvIyWw3bf8qwuc1BpZiuzpyRW5kip639op06d9R45Cc1VPAtWtSeW5DTOttSH9zfQrcWBZhxH3tPHniXlLM/g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; Received: from DM4PR11MB5373.namprd11.prod.outlook.com (2603:10b6:5:394::7) by CY5PR11MB6391.namprd11.prod.outlook.com (2603:10b6:930:38::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7181.18; Mon, 15 Jan 2024 17:14:08 +0000 Received: from DM4PR11MB5373.namprd11.prod.outlook.com ([fe80::f105:47dd:6794:6821]) by DM4PR11MB5373.namprd11.prod.outlook.com ([fe80::f105:47dd:6794:6821%4]) with mapi id 15.20.7181.020; Mon, 15 Jan 2024 17:14:08 +0000 From: =?utf-8?q?Micha=C5=82_Winiarski?= To: , , Subject: [PATCH v5 1/5] drm/managed: Add drmm_release_action Date: Mon, 15 Jan 2024 18:13:47 +0100 Message-ID: <20240115171351.504264-2-michal.winiarski@intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240115171351.504264-1-michal.winiarski@intel.com> References: <20240115171351.504264-1-michal.winiarski@intel.com> X-ClientProxiedBy: VI1P195CA0070.EURP195.PROD.OUTLOOK.COM (2603:10a6:802:59::23) To DM4PR11MB5373.namprd11.prod.outlook.com (2603:10b6:5:394::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM4PR11MB5373:EE_|CY5PR11MB6391:EE_ X-MS-Office365-Filtering-Correlation-Id: ca5f2ebb-04d2-4f8a-cb22-08dc15ed6294 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: pPkwDmBr21Q4b9G+OnCaQRJeje0rgn0WaWkhE0B1NBnrvG4wl0pgOTkhkrjmAc/WnikfaL4xXbpYroVOy4opZIpYxFgzaSOQEZnbTZ5bOfOUgl0OLCWZVhPmxHf4GSxmKG/TStKcmS8J9uX/ra4587grosIPQrrj114OOXnWE+4R5Coe9Anq4LtLBAjBGmQP7dZ4AdF8KOXyTznsdryAxQ6I4PcO6yDjijP6ghlw+dEAiJFjsivjt2nLUV1ibEZH7Nt5uSoa6KPp3BN/CSRj90JLz7VZAs0p5mZYy/ScUUAANO+uJdDCVPE2ZBvfkgMcatqHr8/WSRAPecqg+JfZVxOTvK1wFTfKS4G0EFrYVa2PRbICcgUl8dGad+5ZkzbDNsPqwUwZBCnGya35zpNdWlSJq6rgGOoZ4FYPFETOIy+YokGGi23HQKhYoGe9VYLpjewQ9U0BGEDhUB6Q8rh70vhToLxyYsXPEKbKS7cyf8eelvJS2F+7561lmCTbHTXKaFLH7opFMZIkTDXzrcdrU6gzbjJi7T0PCaZ8NXshkNmdvBIraYaWjhha2t7yl1wD X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM4PR11MB5373.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(136003)(346002)(39860400002)(366004)(376002)(396003)(230922051799003)(451199024)(186009)(64100799003)(1800799012)(66946007)(6506007)(1076003)(6666004)(2616005)(478600001)(82960400001)(66476007)(86362001)(316002)(6486002)(83380400001)(66556008)(26005)(54906003)(5660300002)(8676002)(36756003)(6512007)(41300700001)(7416002)(38100700002)(4326008)(8936002)(2906002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?j4njZhPL5l1w6rvq9NUbkHjgyagP?= =?utf-8?q?ykSyEKM5Hs3I2QKmpRMv15t1DQbF3mQDzt8EJbeSqMEYyLAgfgU6MX/kGFj4AC0mF?= =?utf-8?q?kmOO1cUIJy6yPbo1AJQa/CbkP2a+2BaCYgX31dSAkQgMCSCPgQoXs2+0P3E5yIu6P?= =?utf-8?q?ZuQryU9JGLaMkCxL43wbazAvvGVH2M5iMR5P+/Xq4iNueWTsnpmbpSPwybzGnuUx+?= =?utf-8?q?apptogfrL8bzVHxHUJ+NfosgEg2ZIwbIV9xqnX+88t6x3+H2RPzVTiURKcMzv1QQ2?= =?utf-8?q?20N00FXcDjlRC4go9+Cq8HG1mgaX56Y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ldTk+BRa+iGOHhL/U9oE+FJeU8UNePTGz3zuwIdCXdNSSNaTsDj4?= =?utf-8?q?dJ0aZ+x8Zsj1NqyBiJ4TgMjxbWUcXB79hzTKCZ5OZP/AS1QzOCS2It3L+kNsqW9cB?= =?utf-8?q?1lU7L5upFuL0FvGdFJTBNhsuZxpNJImI4NiL1usWgNvKHmOc0b6FhB7GjpsvC0rQL?= =?utf-8?q?6QV2I75WqN7y4wUVDqE/WlMHNPU977BUDswDnqfLI4C+BDTnnb28FMzvjW1mIe30G?= =?utf-8?q?fRv5YGE5UvnlWf0dv4QQoywaPGpsARUclSmY4bBRlvA/2FyE8KRUpHRxnErtFNMo3?= =?utf-8?q?NKrjBZdaGHlwjUT5a1oSX19rhqKkd43wFCgYredNrhiC37Ghj00bG7GfG4Hiom+Yr?= =?utf-8?q?02H0Q/NHOArugI6/gMb2IuyghttUSoDxtA=3D=3D?= X-MS-Exchange-CrossTenant-Network-Message-Id: ca5f2ebb-04d2-4f8a-cb22-08dc15ed6294 X-MS-Exchange-CrossTenant-AuthSource: DM4PR11MB5373.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Jan 2024 17:14:08.6374 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: D1gwLzPAeeLR3bv7MZfbkFuBpVoQ6mA/yDA4C9hO2tgqA1c8Pz+x5V27y4XxhPNy6L9IXUbRDgFcs0M2NiCBf18HN6OVdrCF+qE4pYl7mf8= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY5PR11MB6391 X-OriginatorOrg: intel.com X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Micha=C5=82_Winiarski?= , =?utf-8?q?Ma=C3=ADra_Canal?= , Javier Martinez Canillas , Maxime Ripard , Thomas Zimmermann , Rodrigo Vivi , David Airlie , Michal Wajdeczko Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Similar to devres equivalent, it allows to call the "release" action directly and remove the resource from the managed resources list. Signed-off-by: Michał Winiarski Reviewed-by: Maxime Ripard --- drivers/gpu/drm/drm_managed.c | 39 +++++++++++++++++++++++++++++++++++ include/drm/drm_managed.h | 4 ++++ 2 files changed, 43 insertions(+) diff --git a/drivers/gpu/drm/drm_managed.c b/drivers/gpu/drm/drm_managed.c index bcd111404b128..7646f67bda4e4 100644 --- a/drivers/gpu/drm/drm_managed.c +++ b/drivers/gpu/drm/drm_managed.c @@ -176,6 +176,45 @@ int __drmm_add_action_or_reset(struct drm_device *dev, } EXPORT_SYMBOL(__drmm_add_action_or_reset); +/** + * drmm_release_action - release a managed action from a &drm_device + * @dev: DRM device + * @action: function which would be called when @dev is released + * @data: opaque pointer, passed to @action + * + * This function calls the @action previously added by drmm_add_action() + * immediately. + * The @action is removed from the list of cleanup actions for @dev, + * which means that it won't be called in the final drm_dev_put(). + */ +void drmm_release_action(struct drm_device *dev, + drmres_release_t action, + void *data) +{ + struct drmres *dr_match = NULL, *dr; + unsigned long flags; + + spin_lock_irqsave(&dev->managed.lock, flags); + list_for_each_entry_reverse(dr, &dev->managed.resources, node.entry) { + if (dr->node.release == action) { + if (!data || (data && *(void **)dr->data == data)) { + dr_match = dr; + del_dr(dev, dr_match); + break; + } + } + } + spin_unlock_irqrestore(&dev->managed.lock, flags); + + if (WARN_ON(!dr_match)) + return; + + action(dev, data); + + free_dr(dr_match); +} +EXPORT_SYMBOL(drmm_release_action); + /** * drmm_kmalloc - &drm_device managed kmalloc() * @dev: DRM device diff --git a/include/drm/drm_managed.h b/include/drm/drm_managed.h index ad08f834af408..f547b09ca0239 100644 --- a/include/drm/drm_managed.h +++ b/include/drm/drm_managed.h @@ -45,6 +45,10 @@ int __must_check __drmm_add_action_or_reset(struct drm_device *dev, drmres_release_t action, void *data, const char *name); +void drmm_release_action(struct drm_device *dev, + drmres_release_t action, + void *data); + void *drmm_kmalloc(struct drm_device *dev, size_t size, gfp_t gfp) __malloc; /** From patchwork Mon Jan 15 17:13:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Micha=C5=82_Winiarski?= X-Patchwork-Id: 13519862 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 3F339C47258 for ; Mon, 15 Jan 2024 17:14:25 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C6D4410E35C; Mon, 15 Jan 2024 17:14:22 +0000 (UTC) Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.100]) by gabe.freedesktop.org (Postfix) with ESMTPS id B3B9B10E056; Mon, 15 Jan 2024 17:14:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1705338856; x=1736874856; h=from:to:cc:subject:date:message-id:in-reply-to: references:content-transfer-encoding:mime-version; bh=oRt1PE8Mp9dItS8/V5Q0vCBHnyNNC+QhmnH/h42znpI=; b=EeFdoObXJcaORhiFPCY7qtjC9+3Z+cvvYFYRfS3YZPW13frWCLwGsQxu vUtPAaPz1RavlgphoKWW5qctZW2Kp0jJew8TVaDfqorExX5G/ylZf8wCn 7VraZLKpy6YOK9avl0rFNHGfW5VzX+G/kXOm6++gguTcGq7dJhfMcrOYJ 0H0SW4mvUWK0KIHxZ9arOYKsegDCQPth1H717g4qiImQqsC1HcJsnvdkb Us46tJb6XGYyBa+gtPMSUEQ/3VcpNKkA0LRnHpWToFLfS+XPuL2NV7StM Rq6G8HjknYXrldCQCQP4LYoqGc+cLS6CTDIis1O3Oy5d3LBi9iTVqxsz3 g==; X-IronPort-AV: E=McAfee;i="6600,9927,10954"; a="466039515" X-IronPort-AV: E=Sophos;i="6.04,197,1695711600"; d="scan'208";a="466039515" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Jan 2024 09:14:16 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10954"; a="783856854" X-IronPort-AV: E=Sophos;i="6.04,197,1695711600"; d="scan'208";a="783856854" Received: from fmsmsx603.amr.corp.intel.com ([10.18.126.83]) by orsmga002.jf.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 15 Jan 2024 09:14:15 -0800 Received: from fmsmsx612.amr.corp.intel.com (10.18.126.92) by fmsmsx603.amr.corp.intel.com (10.18.126.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Mon, 15 Jan 2024 09:14:14 -0800 Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) by fmsmsx612.amr.corp.intel.com (10.18.126.92) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Mon, 15 Jan 2024 09:14:14 -0800 Received: from FMSEDG603.ED.cps.intel.com (10.1.192.133) by fmsmsx610.amr.corp.intel.com (10.18.126.90) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35 via Frontend Transport; Mon, 15 Jan 2024 09:14:14 -0800 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (104.47.59.169) by edgegateway.intel.com (192.55.55.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.35; Mon, 15 Jan 2024 09:14:14 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CqFoP2Le8kixzr+mTVdKiqBgKlV3y2qVR1T49h0evewggbIJIjFWkyq8RZ9Bygtp8yPDWUTRvInPA0IwMyK+G1JU0KxUoovsFmPJ0GJ0cr/S627ihNkR1f9ZOwOmqvz0ARyCyRBs1GEUR1SznhHllCq2ee02LeRYlECbi0/eN/dr21vYtWe+pz10QK4wdzNOLpzj1NCPG1ZlUmKDRey2HWlWNTgWjMyVMWLNbuiad/4MknNDP+ZUqXkRaGqOFJI1fShe/MjzIYWRnggOVy5EinFKYQ68t46BZwxO8VGhwyFJ/hR2Aazp9WwpYfU1ocRiTuXQ16Gbr9W1jatOmOQ0DQ== 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=keoyW9JrFE6jvN+v9KL3q2vFjWhsPTlfgMRVkNThUzk=; b=cEObNcxI5V21gKlxczafSYwAiCluBZnygptXRvH/4w5NC+y5yxRAyv72HFkAl0PQM3f7rt7Pxto4NIpe10szWs15QixTE4AI+QyLon1hRhmiNlW389t/lGPy/c8OaIy87OAZ4OuTCE3t5HBCCkX1AQNblV/wwhs28BG+fXyUXrYuMlrT2+yt9qu6UOLdJ2QM3wsEGMye68298K3IldSetj+QkAt9IbIMt5wve5i6c46/ticicD8kDecYQ83CidFrUyTg3FFuGqFoRFM4NLAm48lEjWhBCHHBMlXVT0tJXKGsPH4/3vgpbt3dtiPKkVABl/By0eFT9VudAmglQ6soSw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; Received: from DM4PR11MB5373.namprd11.prod.outlook.com (2603:10b6:5:394::7) by CY5PR11MB6391.namprd11.prod.outlook.com (2603:10b6:930:38::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7181.18; Mon, 15 Jan 2024 17:14:11 +0000 Received: from DM4PR11MB5373.namprd11.prod.outlook.com ([fe80::f105:47dd:6794:6821]) by DM4PR11MB5373.namprd11.prod.outlook.com ([fe80::f105:47dd:6794:6821%4]) with mapi id 15.20.7181.020; Mon, 15 Jan 2024 17:14:11 +0000 From: =?utf-8?q?Micha=C5=82_Winiarski?= To: , , Subject: [PATCH v5 2/5] drm/tests: managed: Rename the suite name to match other DRM tests Date: Mon, 15 Jan 2024 18:13:48 +0100 Message-ID: <20240115171351.504264-3-michal.winiarski@intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240115171351.504264-1-michal.winiarski@intel.com> References: <20240115171351.504264-1-michal.winiarski@intel.com> X-ClientProxiedBy: FR0P281CA0237.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:b2::9) To DM4PR11MB5373.namprd11.prod.outlook.com (2603:10b6:5:394::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM4PR11MB5373:EE_|CY5PR11MB6391:EE_ X-MS-Office365-Filtering-Correlation-Id: 2a3d3a27-e6c2-46ff-a17c-08dc15ed6464 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Zp6L5Bd3tOUf+VQNmVr/W9pLigNlLddLsjbJYW1txl4gbBeMJd9NQUadR9lmvfh6tV1EAIekTVRDVFmTclI+7sJUQ1PvoHYF/AobAEBqwMv2Fg+FetOW8rnYS4xAxYoHVDAGLhefVTLVOZYfK8SYqeJwS7MdEPpl2MzQ2SdeTqLUrXlBd40oX2EUE85p4IAnrf9Kyax6kBeVX1vY0yvchNua6BYZZ9fCKvfye0nM0r/wEBNlcQG7Hn1rGVQac9fVbv5ffmVcO2J8TaACtCqrNR7WY4iE/wRfFgStEpIqnbkcie5DZ+STqt21FKMg91ytKkufE20OFAIvIogj26sEOH9YAFUj10xAWB08JaSP9ONptOWNverr8PJV8ySAZixn9NOa0tKtJgE5AvEFMSuCa6w277Q9B/1CUQx/grWMBtQ7d5BM1U/3kGxPRXoWLev4k+DsxF9O9ssnbyJxW+nfmlDPnWkXfRGXkn+Yk8bhC+kOeGeoN8Slcm0ao4GBf2p86vSoA4RvuZsAlr14K+CnqqvWImWh2T5MWE5zMwep/SVLxKLyyeqO7opkcANw2GGI X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM4PR11MB5373.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(136003)(346002)(39860400002)(366004)(376002)(396003)(230922051799003)(451199024)(186009)(64100799003)(1800799012)(66946007)(6506007)(1076003)(6666004)(2616005)(478600001)(82960400001)(66476007)(86362001)(316002)(6486002)(83380400001)(66556008)(26005)(54906003)(5660300002)(8676002)(36756003)(6512007)(41300700001)(7416002)(4744005)(38100700002)(4326008)(8936002)(2906002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?9HAVaVhc3Kfbn9dQxdFlJlUAkTjn?= =?utf-8?q?JHYYLFnubn2C/FZcG44PVrHgIP0ua5WUThADTjsp1GwDhSEtqnchwgTk7r4NYB50w?= =?utf-8?q?UibgXz/iTV4SZrXk+jvJ4U0cguaFtEqu6FD7quixRM7mSQhVsORE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JaADaEiGqpbzI?= =?utf-8?q?J8PPrXFu4Pn/nsLlqFDZ7Q/TrmBKUBUxTEEKIz3SHUlVeeWoBmYZOfYnD2sSncc/n?= =?utf-8?q?t1yENsCmHBGf6Hz9Aj49ZROhVHqpjog2OMrYWIjoyLdty4THh02jh09XaqqWzZ/mC?= =?utf-8?q?h6l6EkS0l12buEDOScGskOqyvi6Z1kGSyHZvQsAStWR5l4Auu98ZPBugSqVvok6RG?= =?utf-8?q?rrTQQ814X9i0IBGCPgowD8nS7H8IQ2spfQe26lY98NYu6XInwQVDjVahXSyb7k3HR?= =?utf-8?q?e7YHghp/ZwitYpfO/o9BpLtx31o7rnP8B+zYXci2v7SudNsa75vR+/XpN8hkg0pi7?= =?utf-8?q?tqgJkx7XqoyXmfmUW5NANMPpg5Ntylk1x1GzmK8u28jEeaJqnw/7d9BFCekHXAosa?= =?utf-8?q?1TijBkzwRhkLl/IRfouooe+4+TgoiHvoySEhyA3z39cXuBD+N63E+6JgE/9DXXLjS?= =?utf-8?q?bIaahM9rNmEaxxBQ6vGZMnd8+0tKJ8vfnRIgIL3o/IvQRVliNYFByNvMJX3jwpls1?= =?utf-8?q?NyK++7lP0xMappYwXQk7F+6UqWw7bQ/iOQ=3D=3D?= X-MS-Exchange-CrossTenant-Network-Message-Id: 2a3d3a27-e6c2-46ff-a17c-08dc15ed6464 X-MS-Exchange-CrossTenant-AuthSource: DM4PR11MB5373.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Jan 2024 17:14:11.6526 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: CYbyH+pmwZhIZ81/qde4Kq+3vvh5Bimfb93UvLZw/2INDGzWPGMk/+MVbyvXb/kPmXroz0voPU6+CeQdnTNNecpEJ/f5HXCmDiZU/VTME+g= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY5PR11MB6391 X-OriginatorOrg: intel.com X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Micha=C5=82_Winiarski?= , =?utf-8?q?Ma=C3=ADra_Canal?= , Javier Martinez Canillas , Maxime Ripard , Thomas Zimmermann , Rodrigo Vivi , David Airlie , Michal Wajdeczko Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" DRM tests use "_" rather than "-" as word separator. Rename the test suite to match other tests. Signed-off-by: Michał Winiarski --- drivers/gpu/drm/tests/drm_managed_test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/tests/drm_managed_test.c b/drivers/gpu/drm/tests/drm_managed_test.c index 1652dca11d30c..f85dada4de0a9 100644 --- a/drivers/gpu/drm/tests/drm_managed_test.c +++ b/drivers/gpu/drm/tests/drm_managed_test.c @@ -61,7 +61,7 @@ static struct kunit_case drm_managed_tests[] = { }; static struct kunit_suite drm_managed_test_suite = { - .name = "drm-test-managed", + .name = "drm_managed", .test_cases = drm_managed_tests }; From patchwork Mon Jan 15 17:13:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Micha=C5=82_Winiarski?= X-Patchwork-Id: 13519860 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 8DEDFC47422 for ; Mon, 15 Jan 2024 17:14:20 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 015D110E056; Mon, 15 Jan 2024 17:14:20 +0000 (UTC) Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.7]) by gabe.freedesktop.org (Postfix) with ESMTPS id E613110E056; Mon, 15 Jan 2024 17:14:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1705338858; x=1736874858; h=from:to:cc:subject:date:message-id:in-reply-to: references:content-transfer-encoding:mime-version; bh=l5jgVpTX7BgM1wV0yfftev5dmoEkscpbjIvJLex704s=; b=gBlkkAi0WCvhkAWMenE674IE7ZRv9tznp9tZ7aOwjTOZ+WWf7CnVoMnj /7q6ajcc3N3ditJz3K6hdxEtLThn43/uHQ6A0AclEHzn+yF3uEwWe/Un6 w5OxcnIz44sI5XGYwyn8w0akAKN98IJrlcdSW6TLEXTtFNnvcqs90uPo9 YFFh2skmTx8jow5E8YZRwEXjo+uGLzqaiBLKNy3MxCWJ1nms1I5NtXIOQ La7vPRi9ua6CCKLobNs3BLly3jqZZqdrfz49U7pbtwmWHxJyDjLmRZ5f2 2tukDJSAXUhBYgHV10ALpg9jpcjsjZpfZmk6Ht24h2c8Af/317MTXY1ZV g==; X-IronPort-AV: E=McAfee;i="6600,9927,10954"; a="21139050" X-IronPort-AV: E=Sophos;i="6.04,197,1695711600"; d="scan'208";a="21139050" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmvoesa101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Jan 2024 09:14:17 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10954"; a="854063853" X-IronPort-AV: E=Sophos;i="6.04,197,1695711600"; d="scan'208";a="854063853" Received: from fmsmsx601.amr.corp.intel.com ([10.18.126.81]) by fmsmga004.fm.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 15 Jan 2024 09:14:17 -0800 Received: from fmsmsx612.amr.corp.intel.com (10.18.126.92) by fmsmsx601.amr.corp.intel.com (10.18.126.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Mon, 15 Jan 2024 09:14:16 -0800 Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) by fmsmsx612.amr.corp.intel.com (10.18.126.92) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Mon, 15 Jan 2024 09:14:16 -0800 Received: from FMSEDG603.ED.cps.intel.com (10.1.192.133) by fmsmsx610.amr.corp.intel.com (10.18.126.90) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35 via Frontend Transport; Mon, 15 Jan 2024 09:14:16 -0800 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (104.47.59.169) by edgegateway.intel.com (192.55.55.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.35; Mon, 15 Jan 2024 09:14:16 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=D3SAmul7HmyKTzpnDG0mWEI9tmoxyxM9TzoII0ltO3IVk5TyOWk+Ijus0HwwmifJsLH893LZO+LSQHMSwUd0HpPbKkGMk0tUiyuyej3CEvauraTdEEOAQZsEeTgI+mS89Y2x4VQNtIRASB5++s/nDlagKaA+AwZRYuELcd3IUWuYDhascrgYzv7YW6m/+FRWcdsgiK1629DOfk2WZ5aao30CxD5Dhw2x2BJg4YL54/wcV0AKc/S/Tz9VBAfY23Mlsp5To1fr3nX/LGrWsWvYjysx2K6jeQN6Vf8+T796+WFZI5/MeB8FLCLpu8DeQ0ONA/ur8HqChcSSDFKTmbuqFg== 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=TKmUpEHsTAA5LmPQv0vhb4Dg/mkUpxJtyPu13qA2vcs=; b=QMKAPeiNVQ8a1mjuR3vjGx9YzH+ciWano6VcywvBJA69s7zu8LbXecndsz+A9rGwr1o12nltaODalUsWrk4lHrBAnF0l/fgfkt/NSo7wKdcSSgskkergrbLVh5Fwq3lxaqCVxxZOOA/U1PcAjolOyTUJgh3wmjINNhOuNtAYV2d/eJayBr4DQ57QDbMO/P7s4leHb7U3EuQyZEswofOLmlF6FoAI/3wCKEVmYuzt/s6jO82M3+JbzXgTKe9ssCGm47wn9WV12RC/u9JmTEm46DKSPu6nlM9RMAOvFVcGS6B26j7jbJofpsEulC2RRFTmVyEtmiEFhzqbaIHl4kj9bg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; Received: from DM4PR11MB5373.namprd11.prod.outlook.com (2603:10b6:5:394::7) by CY5PR11MB6391.namprd11.prod.outlook.com (2603:10b6:930:38::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7181.18; Mon, 15 Jan 2024 17:14:14 +0000 Received: from DM4PR11MB5373.namprd11.prod.outlook.com ([fe80::f105:47dd:6794:6821]) by DM4PR11MB5373.namprd11.prod.outlook.com ([fe80::f105:47dd:6794:6821%4]) with mapi id 15.20.7181.020; Mon, 15 Jan 2024 17:14:14 +0000 From: =?utf-8?q?Micha=C5=82_Winiarski?= To: , , Subject: [PATCH v5 3/5] drm/tests: managed: Add comments about test intent Date: Mon, 15 Jan 2024 18:13:49 +0100 Message-ID: <20240115171351.504264-4-michal.winiarski@intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240115171351.504264-1-michal.winiarski@intel.com> References: <20240115171351.504264-1-michal.winiarski@intel.com> X-ClientProxiedBy: FR3P281CA0166.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:a0::9) To DM4PR11MB5373.namprd11.prod.outlook.com (2603:10b6:5:394::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM4PR11MB5373:EE_|CY5PR11MB6391:EE_ X-MS-Office365-Filtering-Correlation-Id: 0a9afb84-5494-468e-d523-08dc15ed6630 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: bsagvStO+ebbMnoPwyEnj96TDRiNFHNRZgOiDltMQbw20m1cGOb4tP0c5aV4TSG7+mRMCsCSHTIwHaxUFCHINSj44ejr/+l4pMtqOTABrbKEvv9af94uQDn+GkAMDEUNzhn7XhLdYjrzhKL5C1Ly2BNI4AB5NasfPhoDdvHV6g+iYYBjgFAIw2CFUhZ/+4QzRkIJuEC68uhM4Kn/oVYnuxr431qr9Ktn0qFkEIT0rLAXJ+AaVwlshm+if9cIbHOVg189Jm6INKD6oiSmoydBNADmUhQwj85Z8RdHCIdeGoiRxBJfOjSUDp0U2hUwWxYod+AVHdFIrvUP0J2ZeZt2DT4HjBaVJ9Yhn+ZV8WlmGgbJVgyYGj83nxxE7kLAdL+tnbPgNxpJ4KIjh5O4oYaHurfLAOnFwshtqzJ5ykcfkavRDKqNbJF6PXSYmUbAPf98qlaryJk+cS5kFiP3tTq9eZ7XHax2Vg2ji8vz+VSLPRBXhjbhKYJODA7VfJOd+vnz0/YztTjrUKTJprkfnnAlDbIGj/PQ1pyuEGJypKgqOr/5uz8HXKw0RVmVOM7BwKdR X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM4PR11MB5373.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(136003)(346002)(39860400002)(366004)(376002)(396003)(230922051799003)(451199024)(186009)(64100799003)(1800799012)(66946007)(6506007)(1076003)(6666004)(2616005)(478600001)(82960400001)(66476007)(86362001)(316002)(6486002)(66556008)(26005)(54906003)(5660300002)(8676002)(36756003)(6512007)(41300700001)(7416002)(38100700002)(4326008)(8936002)(2906002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?M7bdD4PWeWWsGMtA1tTuccucUuws?= =?utf-8?q?kHKi6VLEo0DU4EOlo/zWqRlk6Aac8gSExQsg/j/ypLlAbehZ3Q2VtKSbb8J40qRJh?= =?utf-8?q?/L7gPxaO3kAdhlmqRxUp9g775m242TozQOlT2wvJ7prt9LCFSMPkropUC351wc1pO?= =?utf-8?q?h7YD23hr+DZQUo+KtNPUHtZanYo2jvGHVqQTQJqTLZBC8HHq+2c/KXu4fXhtdUWii?= =?utf-8?q?/lZF0fix7n4vHlnrMkbFlz8EqTv2f9JRvX+9BkrQmrtySo2/UkQgo8G4PoeNFOlqM?= =?utf-8?q?SAFSQ1vYN4n55SU76EvQaWdo5x2FFg2wEzsiijaHo4dAI+AETp+sEcbfr46GAaau0?= =?utf-8?q?fSwx1/fNEfvSC0KqdFo073nJkFX5YIs1i3p5vSG9cJvasfLofn0gTrlQojzzMRv78?= =?utf-8?q?gUTYzqHV7NQRCTKL5jID/0lyv+FKIgp/r95dW7xvdCP1mlf8cr0MasXFfGKfv1Per?= =?utf-8?q?+x79pAJbaa4lPNOG2rXsgwZi5uI+I05Cg1iMgMTGyuw0mHfc3WYSUorMA6Z/QKS/a?= =?utf-8?q?W2zQngnvsxk0/PSiy6F6I5loXYv7QICRSgC9LnwhrUVXh2cEA6f8SGLLZlYCWPipd?= =?utf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PG69rtUiahoeMGi0T6wX4UhAx1ofAEQFTDfXzwkiOb79KdPFi0GlWjFUr?= =?utf-8?q?EtAD7stbtWyLPr0JkGihL1lSdZLlA20Atw=3D=3D?= X-MS-Exchange-CrossTenant-Network-Message-Id: 0a9afb84-5494-468e-d523-08dc15ed6630 X-MS-Exchange-CrossTenant-AuthSource: DM4PR11MB5373.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Jan 2024 17:14:14.6721 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: y7+5XYVt1wlySRf5RpGAJUcmoWB+5Wxqg7LjPPqAO3AKSDu79/7ncg2Aw8yeEDf7OEcDIYt/rALN5mzUYvwkNFdjj6Htz5yiVmMSWA+VCCM= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY5PR11MB6391 X-OriginatorOrg: intel.com X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Micha=C5=82_Winiarski?= , =?utf-8?q?Ma=C3=ADra_Canal?= , Javier Martinez Canillas , Maxime Ripard , Thomas Zimmermann , Rodrigo Vivi , David Airlie , Michal Wajdeczko Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Add comments explaining the intention behind the test and certain implementation details related to device lifetime. Signed-off-by: Michał Winiarski --- drivers/gpu/drm/tests/drm_managed_test.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/gpu/drm/tests/drm_managed_test.c b/drivers/gpu/drm/tests/drm_managed_test.c index f85dada4de0a9..b5cf46d9f5cf8 100644 --- a/drivers/gpu/drm/tests/drm_managed_test.c +++ b/drivers/gpu/drm/tests/drm_managed_test.c @@ -24,6 +24,10 @@ static void drm_action(struct drm_device *drm, void *ptr) wake_up_interruptible(&priv->action_wq); } +/* + * The test verifies that the release action is called automatically when the + * device is released. + */ static void drm_test_managed_run_action(struct kunit *test) { struct managed_test_priv *priv; @@ -38,6 +42,11 @@ static void drm_test_managed_run_action(struct kunit *test) dev = drm_kunit_helper_alloc_device(test); KUNIT_ASSERT_NOT_ERR_OR_NULL(test, dev); + /* + * DRM device can't be embedded in priv, since priv->action_done needs + * to remain allocated beyond both parent device and drm_device + * lifetime. + */ drm = __drm_kunit_helper_alloc_drm_device(test, dev, sizeof(*drm), 0, DRIVER_MODESET); KUNIT_ASSERT_NOT_ERR_OR_NULL(test, drm); From patchwork Mon Jan 15 17:13:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Micha=C5=82_Winiarski?= X-Patchwork-Id: 13519861 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 805D6C47422 for ; Mon, 15 Jan 2024 17:14:23 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C031810E353; Mon, 15 Jan 2024 17:14:22 +0000 (UTC) Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.7]) by gabe.freedesktop.org (Postfix) with ESMTPS id 602EA10E34F; Mon, 15 Jan 2024 17:14:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1705338860; x=1736874860; h=from:to:cc:subject:date:message-id:in-reply-to: references:content-transfer-encoding:mime-version; bh=8Dh8wTx4iSOMWjRrki215AMLxAvFo/rjwYyFI7+uuvg=; b=cnWXZbWQWfyNmR7VjGVlbo5nfx344kobaGkH0UyL9Nq1v4N0X7zKIdGk 22uIrsSbq2rdJRyisT0wsEucE5+c6VntVN7wAB4lmTYy1fVGVEsv5p68m P8Y6EVxoqASKn61MtKtNZStHnBFKea0TWv5nz+ofk5diejx+yfZu1asco 24PkovbH49CllBBmuNj9w32d7A+AowmHKThxv5Q3ciFqmGWY4JaJgfmwp eU1WBmUXpy81r26dR5Pp2vXvcgavCAJH17jmoJk0iWp8V+mz1PJPrUmPO //ZVHIPa01oH+yhn0c1TAnMuOASFBYCiVz/cwARXFQ9suvXWN3ZP0wFBZ g==; X-IronPort-AV: E=McAfee;i="6600,9927,10954"; a="21139058" X-IronPort-AV: E=Sophos;i="6.04,197,1695711600"; d="scan'208";a="21139058" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmvoesa101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Jan 2024 09:14:20 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10954"; a="854063866" X-IronPort-AV: E=Sophos;i="6.04,197,1695711600"; d="scan'208";a="854063866" Received: from fmsmsx601.amr.corp.intel.com ([10.18.126.81]) by fmsmga004.fm.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 15 Jan 2024 09:14:20 -0800 Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) by fmsmsx601.amr.corp.intel.com (10.18.126.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Mon, 15 Jan 2024 09:14:19 -0800 Received: from FMSEDG603.ED.cps.intel.com (10.1.192.133) by fmsmsx610.amr.corp.intel.com (10.18.126.90) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35 via Frontend Transport; Mon, 15 Jan 2024 09:14:19 -0800 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (104.47.59.169) by edgegateway.intel.com (192.55.55.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.35; Mon, 15 Jan 2024 09:14:19 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jeoA4CDSHt5/8V7xW/1AZHR7S3OPW1fqhtHppcExyZ118WuBB/THogGqlkCDSJFZgzb5A3PeqzqNbBHoa5fM/+ePA2XNPOFIpDpYM1e7neKHdIYRoCfNuM0C/boIzPHVCV6fvIq05EyaW3vwPU2N3DMeqRYO4xhPRrJg+r87iQFb/mSbqZRVsCVks2c90P3t5kxqym8vena8C2yeXIcH4GCZ2FENh7vKO9gNU4GxJDKFfSHlwI8Jiki8Wcu+QL8yzq2KGSu+TYirwJUaCzZj2pVi/vqyGyjHe3of7QgbJZCbSLtYQvKBku5pgMnO3ZuofjCZXFVpvhGkYNMIYHajgg== 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=YTT7RD8ggPmqsumV0FqAc1SmuGLprf292fW+WgMvISc=; b=G4TikFw5KJUz33L3tmgfSnfvxd9nSfMeqlkC7kG41f6LFtysq5Z0ZXYxGrCZAZIAmzylkUIik3aWb1kXGZ1mKA/68LraCUBuuZm4l48sqijkb7uB1WUk0SS+4sXYbzXDro6Lir+K5lUUzWDumyV/YzFaytcFh3Ea+hEAf6L0FprleKSXOsGKN56tj63GOQLKFw3CznjahhKFfkPJgTTws85p9sRTwguX8ICMbw56C2VF9AiszNqWUPHN6K1XPR+3ekzACT9FuNwAcdNlXQtbVqvgDGuhKvbijj+pqEcyA/XX/Mn3cgvRB41v5pk1q1ZJjrB4yYXJ1tuHYC2lqtSO3Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; Received: from DM4PR11MB5373.namprd11.prod.outlook.com (2603:10b6:5:394::7) by CY5PR11MB6391.namprd11.prod.outlook.com (2603:10b6:930:38::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7181.18; Mon, 15 Jan 2024 17:14:17 +0000 Received: from DM4PR11MB5373.namprd11.prod.outlook.com ([fe80::f105:47dd:6794:6821]) by DM4PR11MB5373.namprd11.prod.outlook.com ([fe80::f105:47dd:6794:6821%4]) with mapi id 15.20.7181.020; Mon, 15 Jan 2024 17:14:17 +0000 From: =?utf-8?q?Micha=C5=82_Winiarski?= To: , , Subject: [PATCH v5 4/5] drm/tests: managed: Extract device initialization into test init Date: Mon, 15 Jan 2024 18:13:50 +0100 Message-ID: <20240115171351.504264-5-michal.winiarski@intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240115171351.504264-1-michal.winiarski@intel.com> References: <20240115171351.504264-1-michal.winiarski@intel.com> X-ClientProxiedBy: FR0P281CA0198.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:ad::8) To DM4PR11MB5373.namprd11.prod.outlook.com (2603:10b6:5:394::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM4PR11MB5373:EE_|CY5PR11MB6391:EE_ X-MS-Office365-Filtering-Correlation-Id: e961c0ef-03c0-4849-f8cc-08dc15ed67ea X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 8FSZy1hIdnSzpiMI0JI5hfL7PNiRfkoKgbkJHgratIFg6YhwtHvASugSZbBQJENdFoNdTdSFJPG61ALwyRIesJ9YwTEG3NLOZzBHEQORouthVirQ318B4pJU08K8vbS3OyBEF5XaFvmTH/gzcnHQ/qHXvlWFo0DZ8RIbpQ48RJ/Wbn81RXXmqcPlDBJRQBSgVHP0AF0MqbIMxIeWr72Kdi8EBqpLUAohIwgU936WAVB2AYf1s5avpXPXJ+Jy1jTPR5+ET3Tau9r+rLWukM2BVGA4edIM1Mw1zSHiSOig7DiHBFBe+7stjxhDdgMUQf02BVJqfsa0qb+dr4BouzHhx/hzQq0rGcz2flEB7AbHZsbdjBgCrX3yf0GCBrkm16XyvrGb0tf33NILXq3wBbl5zk1o3N0VVwZPTmxo13eCYfBBxzUheoIAafaY8K9MeJKHCGTY2N8/tP5caON20VJoc0D+vgllBh+5ouLfUlXXZw1FdotR4zlxw73AZHjFl9MA3rwxxyBwsZCYn01hCPTo0LgLc7y8TMkudHGgEjdsSC4= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM4PR11MB5373.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(136003)(346002)(39860400002)(366004)(376002)(396003)(230922051799003)(451199024)(186009)(64100799003)(1800799012)(66946007)(6506007)(1076003)(6666004)(2616005)(478600001)(82960400001)(66476007)(86362001)(316002)(6486002)(83380400001)(66556008)(26005)(54906003)(5660300002)(8676002)(36756003)(6512007)(41300700001)(7416002)(38100700002)(4326008)(8936002)(2906002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?9lvFkTxYJcssO8zariMFuaMgB6iA?= =?utf-8?q?FUhfcQZSdkf9UwcX3X5dtbbdU+2YWJzjPZlxp5Yd3yfWTYfg/UgRR3bEvu85m9o+w?= =?utf-8?q?s4OBu4NX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rpqXXLfIiLzodebJ9wGF7MBX1Q9rx4A/lqNPG+9K92mNuzVJxIvLdZHTcH?= =?utf-8?q?E6TXBcU1DpSoo7sMV7EAoOrKzhbvqiSYSBIzIwip0qdH6rP33GyODbtvCWKJujf1+?= =?utf-8?q?ZkevAXZlZaGuZj2yjYIB91ljD7vR5q21yNJh43Q/DAePyGBPi7IC3c+n9JaM8rNos?= =?utf-8?q?5uYYJTpA96QYy8rpqd/zfK4PoG0Fzp8ajF6MlyC84DGhTECypJuPO+tG3GMS1BW7Z?= =?utf-8?q?pZGorn0ROu0+GGVgEE9yhdMbomsYoVyUe18xmz8/FMjqHxgKBOZHWfza0Gmlh/Tu4?= =?utf-8?q?zPMbaUUN/NZZIxWY7kUIwtE+0KIvvFYkGI4pLaGG8q1f8pmk45el9AlYlbvGOgaXd?= =?utf-8?q?Gi8/B/xOm1R4Mj4YzlvXl0gHjN6EpN4Cxtt4q1pOFHXq2mrY0dk0LIv1gYDbZ2vzO?= =?utf-8?q?qUkqe1AXvMYB0ZCVk/PCVe9ec8E9l5rl9Bj7kZ14UWpumRmVJHim5KoWQO4y+hls/?= =?utf-8?q?VWs7Y0VjtJuylYL8ws4ImMZpeaKKOxfvnZqMhg0aLcE/NvC/Co2UXBolwWnAx572i?= =?utf-8?q?6QLkL8gEpsR1HSu7FNAiCWC2VCMKkjI5cA=3D=3D?= X-MS-Exchange-CrossTenant-Network-Message-Id: e961c0ef-03c0-4849-f8cc-08dc15ed67ea X-MS-Exchange-CrossTenant-AuthSource: DM4PR11MB5373.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Jan 2024 17:14:17.5568 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: h3TPc91/AQ9BU1FRnZuXiiGL7AsVaQ60PYJd9jZbLqVFlH1rBkyptd+CizSmVNzyac5+mH/+gfVyN7+V17WxD18ldfjD3wVCwv/GONcxLnY= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY5PR11MB6391 X-OriginatorOrg: intel.com X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Micha=C5=82_Winiarski?= , =?utf-8?q?Ma=C3=ADra_Canal?= , Javier Martinez Canillas , Maxime Ripard , Thomas Zimmermann , Rodrigo Vivi , David Airlie , Michal Wajdeczko Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" It simplifies the process of extending the test suite with additional test cases without unnecessary duplication. Signed-off-by: Michał Winiarski Acked-by: Maxime Ripard --- drivers/gpu/drm/tests/drm_managed_test.c | 41 +++++++++++++++--------- 1 file changed, 26 insertions(+), 15 deletions(-) diff --git a/drivers/gpu/drm/tests/drm_managed_test.c b/drivers/gpu/drm/tests/drm_managed_test.c index b5cf46d9f5cf8..d936c879a4a30 100644 --- a/drivers/gpu/drm/tests/drm_managed_test.c +++ b/drivers/gpu/drm/tests/drm_managed_test.c @@ -12,6 +12,7 @@ #define TEST_TIMEOUT_MS 100 struct managed_test_priv { + struct drm_device *drm; bool action_done; wait_queue_head_t action_wq; }; @@ -29,11 +30,28 @@ static void drm_action(struct drm_device *drm, void *ptr) * device is released. */ static void drm_test_managed_run_action(struct kunit *test) +{ + struct managed_test_priv *priv = test->priv; + int ret; + + ret = drmm_add_action_or_reset(priv->drm, drm_action, priv); + KUNIT_EXPECT_EQ(test, ret, 0); + + ret = drm_dev_register(priv->drm, 0); + KUNIT_ASSERT_EQ(test, ret, 0); + + drm_dev_unregister(priv->drm); + drm_kunit_helper_free_device(test, priv->drm->dev); + + ret = wait_event_interruptible_timeout(priv->action_wq, priv->action_done, + msecs_to_jiffies(TEST_TIMEOUT_MS)); + KUNIT_EXPECT_GT(test, ret, 0); +} + +static int drm_managed_test_init(struct kunit *test) { struct managed_test_priv *priv; - struct drm_device *drm; struct device *dev; - int ret; priv = kunit_kzalloc(test, sizeof(*priv), GFP_KERNEL); KUNIT_ASSERT_NOT_ERR_OR_NULL(test, priv); @@ -47,21 +65,13 @@ static void drm_test_managed_run_action(struct kunit *test) * to remain allocated beyond both parent device and drm_device * lifetime. */ - drm = __drm_kunit_helper_alloc_drm_device(test, dev, sizeof(*drm), 0, DRIVER_MODESET); - KUNIT_ASSERT_NOT_ERR_OR_NULL(test, drm); + priv->drm = __drm_kunit_helper_alloc_drm_device(test, dev, sizeof(*priv->drm), 0, + DRIVER_MODESET); + KUNIT_ASSERT_NOT_ERR_OR_NULL(test, priv->drm); - ret = drmm_add_action_or_reset(drm, drm_action, priv); - KUNIT_EXPECT_EQ(test, ret, 0); + test->priv = priv; - ret = drm_dev_register(drm, 0); - KUNIT_ASSERT_EQ(test, ret, 0); - - drm_dev_unregister(drm); - drm_kunit_helper_free_device(test, dev); - - ret = wait_event_interruptible_timeout(priv->action_wq, priv->action_done, - msecs_to_jiffies(TEST_TIMEOUT_MS)); - KUNIT_EXPECT_GT(test, ret, 0); + return 0; } static struct kunit_case drm_managed_tests[] = { @@ -71,6 +81,7 @@ static struct kunit_case drm_managed_tests[] = { static struct kunit_suite drm_managed_test_suite = { .name = "drm_managed", + .init = drm_managed_test_init, .test_cases = drm_managed_tests }; From patchwork Mon Jan 15 17:13:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Micha=C5=82_Winiarski?= X-Patchwork-Id: 13519863 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 0F03BC3DA79 for ; Mon, 15 Jan 2024 17:14:30 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 8286310E344; Mon, 15 Jan 2024 17:14:29 +0000 (UTC) Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.7]) by gabe.freedesktop.org (Postfix) with ESMTPS id 470B510E34F; Mon, 15 Jan 2024 17:14:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1705338867; x=1736874867; h=from:to:cc:subject:date:message-id:in-reply-to: references:content-transfer-encoding:mime-version; bh=Iw0VZEJ+HFEd6paKWv5g2Vn0NbAPDmus/BwEoKJu0q0=; b=EZGFLgtaxBSbaP57VpRNJkF7b67XQdjmhvoo98c0RRSFwI8VPMk+wfRK MGFliLQ8/bwQykFzkyouIANLFV8djjHjAZ+qkBYHPs/v3I6nnTUgrIkd+ TYR1AlISN0F5C2i6qTrnkLBUuG+yxoPAn5RIZU9W/k/eB9yg+OQUGu24I SdG83WrXjs+jYGdA045yxFmDdb4szP2ETdmat899NWXlPQzlwoDhQuaJq HggO1M7N+9tjXsa2snT6P3jQj26EAPjgUG4fc4G8J84sknlTDYhU9Rnp6 KUBj05jNV92QK1XlSDp1JD/T/rkuseOUjig653svJreKJWoNhVXcbn+H5 Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10954"; a="21139074" X-IronPort-AV: E=Sophos;i="6.04,197,1695711600"; d="scan'208";a="21139074" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmvoesa101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Jan 2024 09:14:26 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10954"; a="854063885" X-IronPort-AV: E=Sophos;i="6.04,197,1695711600"; d="scan'208";a="854063885" Received: from fmsmsx601.amr.corp.intel.com ([10.18.126.81]) by fmsmga004.fm.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 15 Jan 2024 09:14:26 -0800 Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) by fmsmsx601.amr.corp.intel.com (10.18.126.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Mon, 15 Jan 2024 09:14:26 -0800 Received: from FMSEDG603.ED.cps.intel.com (10.1.192.133) by fmsmsx610.amr.corp.intel.com (10.18.126.90) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35 via Frontend Transport; Mon, 15 Jan 2024 09:14:26 -0800 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (104.47.59.168) by edgegateway.intel.com (192.55.55.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.35; Mon, 15 Jan 2024 09:14:25 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nem4TSHaWaYccEpKhNjHJe8VbVTayE6mTHjGkc2r701o6D4Y/x1TGdP2Q+PXdyue5RG8xSzh74YZR4vSB/MnE97ocHSX/MyCnwrjB4jzV9e7d50ocyjB2DNONF4ROSPqTUHbodGJiQrkAYDBd+Y4a/Yp/p8vzLsX964Qmbz+FK6sbtlQpzRmL+wYmY0ypGd4LIH3jFpNWjTj1sFg6xVIxhxMypt7rcj/gFe7VtTvmVblaYum6Ubl0ezkP4a3k53mIU1X8VVd8jILscqQPW/ETI8wSTsdXOwSb81IIX7AFnL6S8Z6n7gPGawQGeyoq932uwsMmgiPkPABU0JFY5OWXA== 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=MQcC7ohGVAYgzqfN/kkAjJJfljR/41ywz9GsUAACHcA=; b=EPXTd/uwpKqntFMyZeIhmdSvqJUD66yF+JqHLY/tiw1w2Jxjp3vX2JIYkvNlVoHpmmLbIF0V1gDIbINtEpvxvRgCvApYuHAGhG+YOkmNjWFAMwYboj5C48TJsqlBAmQbC48ZdEGjfht1ueUz71joAHJfQFJgukhP3qyAWoGyoZcMIO56axJQuRub9BvIi2U5a0l19Zy/84xh/McbmcYfU4WAEvdXxjo73yG7thEMs03g9RQLXsufBIh5UNjywaFPhYVFvHeK6djxAxkMIonkHJIRF9YQtn0+JJh+6KqOtyk+RfeGz4rgJsjao75Yd2gknntpABSRbjjyGsE+jNoIRQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; Received: from DM4PR11MB5373.namprd11.prod.outlook.com (2603:10b6:5:394::7) by CY5PR11MB6391.namprd11.prod.outlook.com (2603:10b6:930:38::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7181.18; Mon, 15 Jan 2024 17:14:23 +0000 Received: from DM4PR11MB5373.namprd11.prod.outlook.com ([fe80::f105:47dd:6794:6821]) by DM4PR11MB5373.namprd11.prod.outlook.com ([fe80::f105:47dd:6794:6821%4]) with mapi id 15.20.7181.020; Mon, 15 Jan 2024 17:14:20 +0000 From: =?utf-8?q?Micha=C5=82_Winiarski?= To: , , Subject: [PATCH v5 5/5] drm/tests: managed: Add a simple test for drmm_managed_release Date: Mon, 15 Jan 2024 18:13:51 +0100 Message-ID: <20240115171351.504264-6-michal.winiarski@intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240115171351.504264-1-michal.winiarski@intel.com> References: <20240115171351.504264-1-michal.winiarski@intel.com> X-ClientProxiedBy: FR3P281CA0160.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:a2::15) To DM4PR11MB5373.namprd11.prod.outlook.com (2603:10b6:5:394::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM4PR11MB5373:EE_|CY5PR11MB6391:EE_ X-MS-Office365-Filtering-Correlation-Id: c76bf226-f372-4391-dbd1-08dc15ed69db X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: fokfRYOHgP09IOIvLSUrxDQSmcgwtm2GAkb3LP1HRLKqv5QcWsbk+MHHfMgv2nHQ/sC7jmi0lOnIhNqUgS/EqQa24pIFyI8Qa/CsaidstMIPsSgtmACS/kjGR5fHGknlpIXU7F8VVqw3M7am3Yfiars/Fn13FuJtrpDuwECUL/49Eyl2YeeUi34SxZRwRnoNqiAD6EbxT9meWtwabl+/EbNG3Yu1Ty3VclNConzfFZGNr1fo+GGzpWkSPfv45f6lYF4rYt7Y5IPauyGcgJdXJ32XyATTNgiyun45J9IZp4rG7AbG6uRbvARS9U9lEO7HVNMvEquhlC70hE48l+c948GnNw4pOvsyGyoGqjV/nmoPP/YzmMY6sXXnAtQuOZJAtbjHHdH9Cuj6ngWcCJ9syz7xFzgqa3cUu/LQYA19ZR/W9gHKYyYrVXFIxvnOREtiDolm22NzIX6YMmkt/ohGEsh1COBvsile56ZoXCBR5Xf1hcQKLtDXgDzr2S0nG6U5L0CGJjYylriWqCAvCJMjG4pTP41vToB8toBfv3y0qj6JZMCpkrlJ9g1pWqVN5q4X X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM4PR11MB5373.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(136003)(346002)(39860400002)(366004)(376002)(396003)(230922051799003)(451199024)(186009)(64100799003)(1800799012)(66946007)(6506007)(1076003)(6666004)(2616005)(478600001)(82960400001)(66476007)(86362001)(316002)(6486002)(66556008)(26005)(54906003)(5660300002)(8676002)(36756003)(6512007)(41300700001)(7416002)(38100700002)(4326008)(8936002)(2906002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?GawMI2XHU0AHHaKhinc6o7M/oEww?= =?utf-8?q?C9A0QJk4XsrjBozkffTouZNOr0NSDj77BB3NCMithf1Y+UgAsCNwGDGfTlMIBRcmc?= =?utf-8?q?WSohfVtLqlX/Q5ApthU+CnsX15IfmjF3UrwPtML7qw7G0T01O8yDmY3ZOqphDwJJG?= =?utf-8?q?V7ABN7j5SPZ6m+xXcbO3cY/ApwNEGELuX73Q1e6AdKRileDSfCXuaIm2p6mGQDxDz?= =?utf-8?q?7cHKTbOWIwj8hmI4zmnSn+Ij/r4CF7/b8EvjGBJHKxwjHERBwHt3wnW+a/5fjPUNZ?= =?utf-8?q?ehRoPkhw9EzAiufJfQSl852hbxYn3FGVr4DvZV+FI5bWj9P06otZwOot5FiN09VmZ?= =?utf-8?q?i3kz+qWWpkoPq92zVjFTzBWbn9BWqg0CHJGKa8tPZo61EuM5BX0WkOz7qmb7K0Zh6?= =?utf-8?q?OHQV0/+Cl4mb2ae5UsRdSuPwy1+p1jPVKx1H6oTvX6Fd+iTImUfWaM0YheTd4Ami6?= =?utf-8?q?+xqhHt9v6M3qAii1ifBKZVPIAa8rcCzrK8Da54d89zyeGhlfzrRp1Enstz8/4ohN3?= =?utf-8?q?UF+9mflZ+8CwNLOy6NeQ6cTwtmzI51pLnWIesCnj5gIcmkcp//onVol63g8rDWtpk?= =?utf-8?q?gLA+CWfUJcvEhcJoR5ooPPUFhdxzit5j+yS0C/HdVD+Uai0hsS0Y0nJJo/Hv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?utf-8?q?/rm3hhAm83gTE0IkcGwv8N21SpXN+mvk3Q=3D=3D?= X-MS-Exchange-CrossTenant-Network-Message-Id: c76bf226-f372-4391-dbd1-08dc15ed69db X-MS-Exchange-CrossTenant-AuthSource: DM4PR11MB5373.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Jan 2024 17:14:20.8118 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: E9HVE2Ut+lwuvj6HXWoLn1/lKyhFINQDmt82N3ZezEgf8HpvVSDCtohPiMorAWw+xItzOoAznV1RBmQPlli8hJXdP4fu4UH1QS8cRZjhfMw= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY5PR11MB6391 X-OriginatorOrg: intel.com X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Micha=C5=82_Winiarski?= , =?utf-8?q?Ma=C3=ADra_Canal?= , Javier Martinez Canillas , Maxime Ripard , Thomas Zimmermann , Rodrigo Vivi , David Airlie , Michal Wajdeczko Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Add a simple test that checks whether the action is called when drmm_managed_release is called. Signed-off-by: Michał Winiarski --- drivers/gpu/drm/tests/drm_managed_test.c | 25 ++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/drivers/gpu/drm/tests/drm_managed_test.c b/drivers/gpu/drm/tests/drm_managed_test.c index d936c879a4a30..76eb273c9b364 100644 --- a/drivers/gpu/drm/tests/drm_managed_test.c +++ b/drivers/gpu/drm/tests/drm_managed_test.c @@ -25,6 +25,30 @@ static void drm_action(struct drm_device *drm, void *ptr) wake_up_interruptible(&priv->action_wq); } +/* + * The test verifies that the release action is called when + * drmm_release_action is called. + */ +static void drm_test_managed_release_action(struct kunit *test) +{ + struct managed_test_priv *priv = test->priv; + int ret; + + ret = drmm_add_action_or_reset(priv->drm, drm_action, priv); + KUNIT_EXPECT_EQ(test, ret, 0); + + ret = drm_dev_register(priv->drm, 0); + KUNIT_ASSERT_EQ(test, ret, 0); + + drmm_release_action(priv->drm, drm_action, priv); + ret = wait_event_interruptible_timeout(priv->action_wq, priv->action_done, + msecs_to_jiffies(TEST_TIMEOUT_MS)); + KUNIT_EXPECT_GT(test, ret, 0); + + drm_dev_unregister(priv->drm); + drm_kunit_helper_free_device(test, priv->drm->dev); +} + /* * The test verifies that the release action is called automatically when the * device is released. @@ -75,6 +99,7 @@ static int drm_managed_test_init(struct kunit *test) } static struct kunit_case drm_managed_tests[] = { + KUNIT_CASE(drm_test_managed_release_action), KUNIT_CASE(drm_test_managed_run_action), {} };