From mboxrd@z Thu Jan 1 00:00:00 1970 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 6B5EAC44501 for ; Wed, 1 Jul 2026 15:34:06 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 200E210EFF8; Wed, 1 Jul 2026 15:34:06 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="ERIkC6+K"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.12]) by gabe.freedesktop.org (Postfix) with ESMTPS id D584D10EFF7; Wed, 1 Jul 2026 15:34:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1782920045; x=1814456045; h=from:to:subject:date:message-id:in-reply-to:references: content-transfer-encoding:mime-version; bh=dSWDQXu0armiGwSuQiHOM5ohnAE5usUBijjoB5aMDj0=; b=ERIkC6+KQf51W3gOSK+ZMROV0b8RgIIHLgRX2aNWI0o0vHakDx6DACSX SGy4p258ttfiatU09tVR26+p0JjQwYj8geqtCkBh1tIEQYSM2OQg+DjGw u8y9uH3cc+OFCeGakaLiu3LTZJSneZiMK19E2FzNJskTjqNUyIy3rgqJm tnlDwVQk6pD89tBmpxKXZdZMLUyrWOXVQBM1zu1oeyYemzLh9ZMGY+DJh 2afKZB4kvJBgkLrZyXUkX2L2rA0JYl08vAygVZnBWDrroU9Pfx1odp2vA +9jOFK6RIZX69eqNI17nnJ7cYycgyj2EZoia+5yMcBhI06VUIPnpc36OY g==; X-CSE-ConnectionGUID: T2PtH1VLRfKb/kdsW3U9Tg== X-CSE-MsgGUID: bL6/7SNZSfWubKb36RZVSQ== X-IronPort-AV: E=McAfee;i="6800,10657,11834"; a="95159358" X-IronPort-AV: E=Sophos;i="6.25,142,1779174000"; d="scan'208";a="95159358" Received: from fmviesa003.fm.intel.com ([10.60.135.143]) by orvoesa104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Jul 2026 08:34:03 -0700 X-CSE-ConnectionGUID: Bg0mAEXCSq6lMgxutZlxcQ== X-CSE-MsgGUID: HnRn3C43TCS9SnhEnvNBbA== X-ExtLoop1: 1 Received: from fmsmsx901.amr.corp.intel.com ([10.18.126.90]) by fmviesa003.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Jul 2026 08:34:03 -0700 Received: from FMSMSX901.amr.corp.intel.com (10.18.126.90) by fmsmsx901.amr.corp.intel.com (10.18.126.90) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.43; Wed, 1 Jul 2026 08:34:02 -0700 Received: from fmsedg902.ED.cps.intel.com (10.1.192.144) by FMSMSX901.amr.corp.intel.com (10.18.126.90) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.43 via Frontend Transport; Wed, 1 Jul 2026 08:34:02 -0700 Received: from BN1PR04CU002.outbound.protection.outlook.com (52.101.56.33) by edgegateway.intel.com (192.55.55.82) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.43; Wed, 1 Jul 2026 08:34:01 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=CKKPG/VLCDdAndkKf1sLK7DlRa/ZoT1WZ8AUPsA474pgThbU+DgOIFpwR0j3eFryf67uvdv3tO/EOqi+x1b1mnY98ozBA/f4c1bpClp4YHYu046qA9qO1Vz8AtXxcac0Xf83lsO7awr5CHlAxq9/IY5kAHLww4VsIexnP69c2aUNJaRx1h8TEVobCFdIO2d7zauuxLA0z4kPo6N8yKKDTODLKGjBV3a0XIoIB+fXHrnHv6R3kedTUjPuI5MXx3TIR0NtJXEj3VNgmYdgnWWdaEhrwfAcAFY4z+2x/rKtEINBy7uZ2uRAV2dcluQ7ZGJtJ0u0EriNJ8vtfHcxGq69+Q== 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=fvVgF6KbW9jdOlyS//iCnmqc2XcChUhrypmVeV/DHxg=; b=rpsNeux6Fz/rpDVO7Gdd4MW13Iqg+6aJndos4/3oQj69IFcRYEg7MuDL0WRRUdNMVSyNvbXWi+BmHChPlACLkzLJYCVgpW6T9ox6M/1HDCW4jV0VJ39bMp3BDTls82s8UL8XG8br0E+jBkJ1Rb6Uh1c18aI9307VxVDP/HuLamyuRz7ZXCibg0HDchcUmoGvc4DLs8eqYFLUvss04diiZO382ajRQKGyyU1CDmEuOz8MmvdgqENpoReFSxjahNXB3kSF1lce+lMMY1s9eFoGVFo/wRAPepdzEHPFL6VgR1jWYWbMnm9lDuSzmU83pVAzfTMSOyY4cNbSPjsuj9KHnQ== 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 IA3PR11MB9273.namprd11.prod.outlook.com (2603:10b6:208:573::17) by CY8PR11MB7826.namprd11.prod.outlook.com (2603:10b6:930:76::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.181.8; Wed, 1 Jul 2026 15:33:50 +0000 Received: from IA3PR11MB9273.namprd11.prod.outlook.com ([fe80::31a4:58c:e3b5:43fa]) by IA3PR11MB9273.namprd11.prod.outlook.com ([fe80::31a4:58c:e3b5:43fa%4]) with mapi id 15.21.0159.018; Wed, 1 Jul 2026 15:33:50 +0000 From: Imre Deak To: , Subject: [PATCH v2 30/34] drm/i915/kunit: Setup DP link test context Date: Wed, 1 Jul 2026 18:31:59 +0300 Message-ID: <20260701153204.4124150-31-imre.deak@intel.com> X-Mailer: git-send-email 2.49.1 In-Reply-To: <20260701153204.4124150-1-imre.deak@intel.com> References: <20260701153204.4124150-1-imre.deak@intel.com> Organization: Intel Finland Oy - BIC 0357606-4 - c/o Alberga Business Park, 6 krs Bertel Jungin Aukio 5, 02600 Espoo, Finland Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: GVZP280CA0097.SWEP280.PROD.OUTLOOK.COM (2603:10a6:150:275::11) To IA3PR11MB9273.namprd11.prod.outlook.com (2603:10b6:208:573::17) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: IA3PR11MB9273:EE_|CY8PR11MB7826:EE_ X-MS-Office365-Filtering-Correlation-Id: 83183b16-2b64-4ffb-5d60-08ded7861170 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|23010399003|376014|1800799024|366016|18002099003|22082099003|11063799006|3023799007|56012099006; X-Microsoft-Antispam-Message-Info: 4xJ8GfMBm0R0u9jXru1VjKMEwFbFuPfspR/IX4zQj6Eu6zHZaw8nqQ/5TPkIUErrArYzKzN4HGQTZ0YgYG1oq12taaRbZ2IWPpnF9Vmy4wknnbImP32JXpLGb3JO6ZEqqhzNlNwRMEKIqfx4llF1bU1u/0t4O//FTmimQnsrQ/exeD8RIz6eahBgYgiktLAusYa1rShqAW3qlQ/ke2VzgLqVUFj/BboiNPfC8m10BuYQGeA1YzOcC65uuIbLqOciiWFSlBYz07hBoCm/CFf7QZ7A2+RjL+CFDZ3m/0xI2FdjI9CbuEbfbv/zf3kaR9UDohMuZytdaV0yWXm2AcFZxB39VIUvvpsETQlUYvm9pfuUrVSzWCLggsxN6GwXu3mzvj/MWlxsr4j9JH7A+Bg7UXbu61VOZDPOKpj7B1oJ3p/oP6OL8fPNNF+CBNgQBDkER8jBKlt6klaHRj/4r3jNqp/JKWjcJCc/pVGk2myLPIlAAUB4U3Tq3ibYvWqpSqBhad2Wgm8o6JpH2OKyjlVA9D5GtjpS5m9R2ctBl6EB7XV4oDv4O6Ri1gSrJm2grHJ7wS7EWKXT4GOcXQ6Ipr4yyLC+Y5LBTp8sjvO3ej3pjEC436yPhWv2Me+bgBnc63eeqHAPDbMNo4kObY97J90XKvckTymcxbz9JEIgeT+Btl8= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:IA3PR11MB9273.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(23010399003)(376014)(1800799024)(366016)(18002099003)(22082099003)(11063799006)(3023799007)(56012099006); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?9GtmTunI0a3nJrjLGePFsWCxc6oSMmU5zMB0GF+EROLJGeeSdqQPtVUyjR2u?= =?us-ascii?Q?sGXPipZP7MsTOYMc9W4niaj4s+fDPak4RRXtFJwoXde01vgbNOwdIFh2B2qX?= =?us-ascii?Q?bDoEYkoAfdMVMNejEICuNWDijYDMdlbc9gffRdJtpepTesq2/DwVQNUH6vix?= =?us-ascii?Q?L/DB8Ta7rErT/kfV95CX0NwoneAvd+ZFWuBfzMh8FJbllNMTYys9ehQBe2dK?= =?us-ascii?Q?nWiBYly36Rz9mflgI3wS7tfCmWYPvyh178Fp7xf4gconjRd0oeof3w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vuBHjw== X-MS-Exchange-CrossTenant-Network-Message-Id: 83183b16-2b64-4ffb-5d60-08ded7861170 X-MS-Exchange-CrossTenant-AuthSource: IA3PR11MB9273.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Jul 2026 15:33:15.3404 (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: J0bRp/EqBqkXoeq8fH4MrGlwSrpgz+ugEVQoob8S4t5GaYJosoBXUb1yUoIx4N7eXJ7diT1tRL5zB3ZbKkP/yQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR11MB7826 X-OriginatorOrg: intel.com X-BeenThere: intel-xe@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel Xe graphics driver List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-xe-bounces@lists.freedesktop.org Sender: "Intel-xe" Initialize a reusable test context for DP link KUnit tests. Sets up minimal device, connector, encoder, and DP structures, and seeds the pseudo-random generator for deterministic test runs. Signed-off-by: Imre Deak --- .../i915/display/tests/intel_dp_link_test.c | 50 +++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/drivers/gpu/drm/i915/display/tests/intel_dp_link_test.c b/drivers/gpu/drm/i915/display/tests/intel_dp_link_test.c index 62e1844605ac5..aa5358c94839f 100644 --- a/drivers/gpu/drm/i915/display/tests/intel_dp_link_test.c +++ b/drivers/gpu/drm/i915/display/tests/intel_dp_link_test.c @@ -5,7 +5,32 @@ #include +#include +#include +#include +#include + +#include + +#include + +#include "intel_connector.h" +#include "intel_display_core.h" +#include "intel_display_types.h" + struct test_ctx { + struct { + struct intel_display display; + struct device device; + struct __intel_generic_device generic_device; + + struct intel_connector connector; + struct intel_digital_port dig_port; + + struct intel_crtc_state crtc_state; + } dev; + + struct rnd_state rnd; }; static struct kunit_case intel_dp_link_test_cases[] = { @@ -16,6 +41,29 @@ static struct test_ctx test_ctx; static int intel_dp_link_test_init(struct kunit *test) { + struct intel_digital_port *dig_port; + struct intel_encoder *encoder; + struct intel_dp *intel_dp; + + /* Reset the dev state for each test. */ + memset(&test_ctx.dev, 0, sizeof(test_ctx.dev)); + + test_ctx.dev.generic_device.drm.dev = &test_ctx.dev.device; + + test_ctx.dev.display.drm = &test_ctx.dev.generic_device.drm; + test_ctx.dev.generic_device.display = &test_ctx.dev.display; + + encoder = &test_ctx.dev.dig_port.base; + encoder->base.dev = &test_ctx.dev.generic_device.drm; + + dig_port = &test_ctx.dev.dig_port; + dig_port->base.type = INTEL_OUTPUT_DP; + + test_ctx.dev.connector.encoder = encoder; + + intel_dp = &dig_port->dp; + intel_dp->attached_connector = &test_ctx.dev.connector; + test->priv = &test_ctx; return 0; @@ -27,6 +75,8 @@ static void intel_dp_link_test_exit(struct kunit *test) static int intel_dp_link_test_suite_init(struct kunit_suite *test_suite) { + prandom_seed_state(&test_ctx.rnd, 0); + return 0; } -- 2.49.1