From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 599CB606A322 for ; Thu, 3 Dec 2026 21:24:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=cP+jn/hK Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 18250112C38; Thu, 3 Dec 2026 21:24:46 +0000 (UTC) Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.12]) by gabe.freedesktop.org (Postfix) with ESMTPS id 9597C112C38 for ; Thu, 3 Dec 2026 21:24:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1796333080; x=1827869080; h=date:from:to:cc:subject:message-id:references: in-reply-to:mime-version; bh=XHt4HTLmxCFH2hhupPZl+fH1+j+2cfw7dg9kq8gdNTY=; b=cP+jn/hK5VZ14N181COdeh3ZEIUGQOeCAGHawE3Nt8bCh2JPfP2oX6sZ NQ+IU61RtolPLWu9oAEeAJWlQgOMZfnwm39091fxuqpwc2t5FaXf8olcH Yh6lplNHfWhLMn5FGhxXb5IXUpquplnixtEGxXLYvHjtGUg/58HNER97k bRtBD6/4tUPeqaEAciqk5cgVmGZrKKw8havmXYcid2250hj4CcINuICDb Cw13OP7CcVYyLTFKzmEmvovOM3v/+KbsnzYUitEu99U5MOTMhw3zDCFgJ q3A+dqU3L4TfNO561dBBk9HpYYDQ2HIlfRmYt4Vcormvc8VD/kqp1uj5X w==; X-CSE-ConnectionGUID: IJfroLiJQPuJx3NVQWmGTw== X-CSE-MsgGUID: uBOzBBnRQM+ZLZ3qZDmefg== X-IronPort-AV: E=McAfee;i="6800,10657,11985"; a="5229260" X-IronPort-AV: E=Sophos;i="6.29,77,1794902400"; d="scan'208";a="5229260" Received: from orviesa002.jf.intel.com ([10.64.159.142]) by orvoesa104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Dec 2026 13:24:40 -0800 X-CSE-ConnectionGUID: RmCOGoOYQIS3zUPxiTsL/A== X-CSE-MsgGUID: 0BFE2+WRR0CCdgULshN7Hw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.29,77,1794902400"; d="scan'208";a="13914420" Received: from fmsmsx903.amr.corp.intel.com ([10.18.126.92]) by orviesa002.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Dec 2026 13:24:40 -0800 Received: from FMSMSX903.amr.corp.intel.com (10.18.126.92) by fmsmsx903.amr.corp.intel.com (10.18.126.92) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.57; Thu, 3 Dec 2026 13:24:39 -0800 Received: from fmsedg903.ED.cps.intel.com (10.1.192.145) by FMSMSX903.amr.corp.intel.com (10.18.126.92) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.57 via Frontend Transport; Thu, 3 Dec 2026 13:24:39 -0800 Received: from SN4PR2101CU001.outbound.protection.outlook.com (40.93.195.53) by edgegateway.intel.com (192.55.55.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.57; Thu, 3 Dec 2026 13:24:39 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=r7lWG+0hrVnlDewkrmpGJwxxLeG8X6QpjWvA/JrxYOzw+vSjlF88Suq9iypY/SB4mff+e6ETrEginHuf4IemMEwpZ9reC4LAAe6f7GNgdiXolqZpHoqOvuVlxZeUpRHZ5nt7rB7pttndVLlr+3Kr3KzN6ipUVhiaEXmFqmDW0dyR4tgZ5ef5LvqowLbrz7Teg4XMAAAxNTikAki6paVWS4EGwzNIyUhzKQ/WH26rHd8f0qz+fsTYydy7qofEMUEaMqF/tgojANrFMcw0sMogHx2eydE6APbuakxw8JK835VjDQWbg9wJa1t4CRmM3X+5BGRDmePPumUzWgQSuQIpcA== 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=XHt4HTLmxCFH2hhupPZl+fH1+j+2cfw7dg9kq8gdNTY=; b=NqdtjqBkrDrh3fV+ZxbORURTWXKr0CTeg5CVu0CaZKZ6p8kqCPOetQsCl0ubkeASy1kCVLm4Ma7m3Uvoj/wUo0NwRtRVWOTiujaLRIWXVVTKM/ZqnS/aL+ccF6MA4tCDdhEa+fCnnH7wmOOWeo15ehMsrQdu/B2ssQkSItgd7/g6zVKC27FaEQ1SfOxKIAphWMJYFVvGWiyHFNRMAxZnzNX7nHyLWrdGv1jMoNyp7kZCKwk2M948+hAplr7PBMHAxUNiB7kB8FCZR44c2VSmTINQBvPryZsaycHIQW+NvbxRYzTOk9lm8tJlCT52lCgDkiR9VHaq+LmqheW1G2dKXw== 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: mx.microsoft.com 1; dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; Received: from DS7PR11MB5990.namprd11.prod.outlook.com (2603:10b6:8:71::5) by EA8PPFFD174C06C.namprd11.prod.outlook.com (2603:10b6:30f:fff5::79b) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.688.10; Thu, 3 Dec 2026 21:24:37 +0000 Received: from DS7PR11MB5990.namprd11.prod.outlook.com ([fe80::133c:5eed:3aec:b899]) by DS7PR11MB5990.namprd11.prod.outlook.com ([fe80::133c:5eed:3aec:b899%3]) with mapi id 15.21.0688.010; Thu, 3 Dec 2026 21:24:37 +0000 Date: Thu, 3 Dec 2026 16:24:33 -0500 From: Rodrigo Vivi To: Matt Roper CC: Stuart Summers , , , , , , Subject: Re: [PATCH 1/2] drm/xe: Add enable_media module parameter Message-ID: References: <20261203190926.249488-4-stuart.summers@intel.com> <20261203190926.249488-5-stuart.summers@intel.com> <20261203205221.GN6134@mdroper-desk1> Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20261203205221.GN6134@mdroper-desk1> X-ClientProxiedBy: BY5PR17CA0041.namprd17.prod.outlook.com (2603:10b6:a03:1b8::31) To DS7PR11MB5990.namprd11.prod.outlook.com (2603:10b6:8:71::5) X-Archived-By: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS7PR11MB5990:EE_|EA8PPFFD174C06C:EE_ X-MS-Office365-Filtering-Correlation-Id: 0d91642f-82bf-48dd-3a01-08df5183d54c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|1800799024|376014|366016|23010399003|4143699003|18002099003|22082099003|3023799007|260925022911599003|11063799006|10067099003|260925021911599003|260925021311599003|56012099006|261026121527099003|261022075727099003|261028144727099003|261022113327099003|261022105027099003|261021121427099003|261021123027099003|261026140227099003|261102123227099003|261009223027099003; X-Microsoft-Antispam-Message-Info: clpbtX7+RVvy9kTzZpK3MLkIGW9LRNvJNaW1NDUYtxCe12H6kBaQYCdWD0lr3IBOi6g3LuG7GP7h402mw2bBlNddbHw51GUcMuSmirZ2GNul20ZRaiLPTVjeYp9kOkpRyODkhQ9gdlFSyITAt7q1alNGqNmjGYGzmlpPm4lq0n1B85xtSxMmOqau7d5X7m1gkMkzu7vTHfNZjbXWnCvzjnWCC9NBCfMnQTG0MYNZagTbwp+iogyvAsXdMMkD8xq00UFquVa3uzYOYxxNtTxgwUOxqAEyOqRN+voAMU6tcWutaL+dwp1MC+otlpkr8rmOPLZFPLg9e0e2AvqRCpWQR0VAKfU7stlWzpK+SZWb2Zdy2cU+c2xuJC08Gyi3Y4p5Ce4L5gNLeUEFV5UCvKp1jQDSG23PJYCXij9y5+P37EgcbAvnZ5LiNt4AzaF/xeS+P19AVYPlmI5gbCTfDm8p7ep0mTwigxzZ5/AqlRtw4bI5RrKJYJU9d5a5vRcuamRA9sdkkJpunuL6nCHpFDaeeT31wkS7l+Flz/Eqw9ttW+vqUF4yVQiU7e8gF/pctC+kf5feJmOVqzyy/ug5izZir51pCX3x6tjJYDdJ0omku4qv2NS/9rPHpBZlfrzdCNAU X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DS7PR11MB5990.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(1800799024)(376014)(366016)(23010399003)(4143699003)(18002099003)(22082099003)(3023799007)(260925022911599003)(11063799006)(10067099003)(260925021911599003)(260925021311599003)(56012099006)(261026121527099003)(261022075727099003)(261028144727099003)(261022113327099003)(261022105027099003)(261021121427099003)(261021123027099003)(261026140227099003)(261102123227099003)(261009223027099003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?yOWcWalyFTLH89BMr0XyOY57gbUDjFS/vJ4IdmDy0Ohzwv+VpVRZ6/OGdq1T?= =?us-ascii?Q?F9kbulXYCd0FLF0tQzEbhsBrk3S7i17MxK2hvykjbJjzy40A/1OpJb4UWoy5?= =?us-ascii?Q?4P0aS2nuplfKFdyZJBd030P0y8S9nSdeKp5a+Jp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PY8l85Hbzi1MCn58f9fUU54O5ilJpPliCtC2tJuErRK7tquZi2Wu1fTvWGopnviILFimnCwxkHn55YxydZovWjIx+NEoCMj+X/dAVaJN/ggBR0yv+Gz4ZK5AbKUckrrRgz7rtbVlKO+4OKvDBb2NPwC+PuYSvXFfpeaA8j4Wr1BN8d7lncmGW/7qEufJf4bWg== X-MS-Exchange-CrossTenant-Network-Message-Id: 0d91642f-82bf-48dd-3a01-08df5183d54c X-MS-Exchange-CrossTenant-AuthSource: DS7PR11MB5990.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Dec 2026 21:24:37.3342 (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: 8xgKLGp32q1OrSauzvYHwgJLDV5aRNv9dYRoFL7ocTmrRy9A5DRTmcO8mMts08Fdo4bJY12Zh2X6FIbFSmfwFA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: EA8PPFFD174C06C 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-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Intel-xe" X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 On Thu, Dec 03, 2026 at 12:52:21PM -0800, Matt Roper wrote: > On Thu, Dec 03, 2026 at 07:09:26PM +0000, Stuart Summers wrote: > > The gt_types_allowed configfs attribute is intended for debug only, > > so provide a supported way to disable the media GT in production. > > The modparam takes precedence over configfs so a single knob is enough > > to guarantee the media GT is left alone. > > It's been mentioned before, but new module parameters like this simply > aren't allowed anymore. Upstream maintainers like Greg KH have been > posting increasingly frustrated messages for years that drivers need to > stop doing stuff like this. The only written rule I could find is in Documentation/process/debugging/driver_development_debugging_guide.rst: "Module parameters are not recommended anymore", pointing to Greg's mail [1]. So not recommended, but not forbidden. And Greg's reason there is that they "will not work properly for multiple devices", since one value applies to all of them. Here that's exactly what we want: on a node with many GPUs, all of them should follow the same media rule. So in this case it is a plus, not a reason to block. [1] https://lore.kernel.org/all/2024032757-surcharge-grime-d3dd@gregkh/ > We have various module parameters in Xe > today that mostly just snuck in because the Xe driver was a massive code > drop and nobody really paid much attention at the time they were going > in with everything else, but I don't think we can continue ignoring the > "don't add new module parameters" guidance that we've been hearing for > many years now. > > Honestly I don't see a good reason for the module parameter here anyway. > Disabling media really should be a per-device decision, not a > driver-global one. "Some customers are too lazy to configure the > setting on each PCI device individually in a multi-GPU system" seems > like a pretty weak justification too. If we really want to eliminate > the need for a simple bash loop or something, we could always add a > "global" folder in configfs with settings that apply to all devices > probed thereafter so give the same kind of "set only once" behavior. It's not only laziness. Configfs only exists after xe is loaded, and by then the devices are already probed, unless we block autoprobe and bind each device by hand. A global configfs folder has the same problem. A modprobe.d line is the simple way to have it set before the first probe on every node. Well, in general, I agree that we should really try our best to avoid new params in general. Not only because of the overall recommendation, but also because of the exponential validation. But this is a true case where we absolutely need a knob and the module param is the best alternative of all. Thanks, Rodrigo. > > > Matt > > > > > The parameter is tri-state so that -1 can leave the decision to the > > driver, which currently enables media wherever it is present. > > > > Both inputs are writable while the driver runs, so latch the result into > > xe->info.media_allowed during early probe and read it back through > > xe_device_media_allowed(). That keeps the decision fixed for the > > lifetime of the device and makes it available outside xe_pci.c. > > > > Signed-off-by: Stuart Summers > > --- > > drivers/gpu/drm/xe/xe_configfs.c | 3 +++ > > drivers/gpu/drm/xe/xe_defaults.h | 1 + > > drivers/gpu/drm/xe/xe_device.c | 14 ++++++++++++++ > > drivers/gpu/drm/xe/xe_device.h | 1 + > > drivers/gpu/drm/xe/xe_device_types.h | 2 ++ > > drivers/gpu/drm/xe/xe_module.c | 7 +++++++ > > drivers/gpu/drm/xe/xe_module.h | 1 + > > drivers/gpu/drm/xe/xe_pci.c | 21 ++++++++++++++++++--- > > 8 files changed, 47 insertions(+), 3 deletions(-) > > > > diff --git a/drivers/gpu/drm/xe/xe_configfs.c b/drivers/gpu/drm/xe/xe_configfs.c > > index 3a05e1cd9dda..7f1a809b0999 100644 > > --- a/drivers/gpu/drm/xe/xe_configfs.c > > +++ b/drivers/gpu/drm/xe/xe_configfs.c > > @@ -220,6 +220,9 @@ > > * will always return one GT type per line. "primary" and "media" are the > > * GT type names supported by this interface. > > * > > + * Note that the ``enable_media=0`` module parameter takes precedence over > > + * this attribute: it disables the media GT even if "media" is listed here. > > + * > > * This attribute can only be set before binding to the device. > > * > > * Examples: > > diff --git a/drivers/gpu/drm/xe/xe_defaults.h b/drivers/gpu/drm/xe/xe_defaults.h > > index 0884224ef7c7..8d69df72fe4e 100644 > > --- a/drivers/gpu/drm/xe/xe_defaults.h > > +++ b/drivers/gpu/drm/xe/xe_defaults.h > > @@ -13,6 +13,7 @@ > > #define XE_DEFAULT_GUC_LOG_LEVEL 1 > > #endif > > > > +#define XE_DEFAULT_ENABLE_MEDIA -1 > > #define XE_DEFAULT_PROBE_DISPLAY IS_ENABLED(CONFIG_DRM_XE_DISPLAY) > > #define XE_DEFAULT_VRAM_BAR_SIZE 0 > > #define XE_DEFAULT_FORCE_PROBE CONFIG_DRM_XE_FORCE_PROBE > > diff --git a/drivers/gpu/drm/xe/xe_device.c b/drivers/gpu/drm/xe/xe_device.c > > index 30710e3aff2a..1d9a2655a57b 100644 > > --- a/drivers/gpu/drm/xe/xe_device.c > > +++ b/drivers/gpu/drm/xe/xe_device.c > > @@ -379,6 +379,20 @@ bool xe_device_is_admin_only(const struct xe_device *xe) > > } > > #endif > > > > +/** > > + * xe_device_media_allowed() - Check whether the media IP may be used. > > + * @xe: the &xe_device to check > > + * > > + * Returns the decision latched during early probe, see > > + * @xe_device.info.media_allowed. > > + * > > + * Return: true if media may be used, false otherwise. > > + */ > > +bool xe_device_media_allowed(struct xe_device *xe) > > +{ > > + return xe->info.media_allowed; > > +} > > + > > /* Number of allocated struct xe_device */ > > static atomic_t xe_device_count; > > > > diff --git a/drivers/gpu/drm/xe/xe_device.h b/drivers/gpu/drm/xe/xe_device.h > > index 6b1e48369bdd..9f890e692784 100644 > > --- a/drivers/gpu/drm/xe/xe_device.h > > +++ b/drivers/gpu/drm/xe/xe_device.h > > @@ -282,6 +282,7 @@ static inline bool xe_device_is_admin_only(const struct xe_device *xe) > > } > > #endif > > > > +bool xe_device_media_allowed(struct xe_device *xe); > > void xe_device_exit(void); > > > > /* > > diff --git a/drivers/gpu/drm/xe/xe_device_types.h b/drivers/gpu/drm/xe/xe_device_types.h > > index 62ca5c645179..19d235ae32e8 100644 > > --- a/drivers/gpu/drm/xe/xe_device_types.h > > +++ b/drivers/gpu/drm/xe/xe_device_types.h > > @@ -231,6 +231,8 @@ struct xe_device { > > u8 has_pt_mirror:1; > > /** @info.is_dgfx: is discrete device */ > > u8 is_dgfx:1; > > + /** @info.media_allowed: Media IP may be used */ > > + u8 media_allowed:1; > > /** @info.needs_scratch: needs scratch page for oob prefetch to work */ > > u8 needs_scratch:1; > > /** > > diff --git a/drivers/gpu/drm/xe/xe_module.c b/drivers/gpu/drm/xe/xe_module.c > > index 897724cb5cfb..d6f3dd54613e 100644 > > --- a/drivers/gpu/drm/xe/xe_module.c > > +++ b/drivers/gpu/drm/xe/xe_module.c > > @@ -22,6 +22,7 @@ > > #include "xe_sched_job.h" > > > > struct xe_modparam xe_modparam = { > > + .enable_media = XE_DEFAULT_ENABLE_MEDIA, > > .probe_display = XE_DEFAULT_PROBE_DISPLAY, > > .guc_log_level = XE_DEFAULT_GUC_LOG_LEVEL, > > .force_probe = XE_DEFAULT_FORCE_PROBE, > > @@ -38,6 +39,12 @@ module_param_named(svm_notifier_size, xe_modparam.svm_notifier_size, uint, 0600) > > MODULE_PARM_DESC(svm_notifier_size, "Set the svm notifier size in MiB, must be power of 2 " > > "[default=" __stringify(XE_DEFAULT_SVM_NOTIFIER_SIZE) "]"); > > > > +module_param_named(enable_media, xe_modparam.enable_media, int, 0444); > > +MODULE_PARM_DESC(enable_media, "Enable the media GT, when present (-1=auto, 0=disable, 1=enable). " > > + "Disabling overrides any media GT selected via the gt_types_allowed " > > + "configfs attribute " > > + "[default=" __stringify(XE_DEFAULT_ENABLE_MEDIA) "])"); > > + > > #if IS_ENABLED(CONFIG_DRM_XE_DISPLAY) > > module_param_named(probe_display, xe_modparam.probe_display, bool, 0444); > > MODULE_PARM_DESC(probe_display, "Probe display HW, otherwise it's left untouched " > > diff --git a/drivers/gpu/drm/xe/xe_module.h b/drivers/gpu/drm/xe/xe_module.h > > index 6272d9e41207..ffa5ca462207 100644 > > --- a/drivers/gpu/drm/xe/xe_module.h > > +++ b/drivers/gpu/drm/xe/xe_module.h > > @@ -12,6 +12,7 @@ struct work_struct; > > > > /* Module modprobe variables */ > > struct xe_modparam { > > + int enable_media; > > bool probe_display; > > int force_vram_bar_size; > > int guc_log_level; > > diff --git a/drivers/gpu/drm/xe/xe_pci.c b/drivers/gpu/drm/xe/xe_pci.c > > index 9a88520aae3c..e1c31c96327d 100644 > > --- a/drivers/gpu/drm/xe/xe_pci.c > > +++ b/drivers/gpu/drm/xe/xe_pci.c > > @@ -654,7 +654,7 @@ static int read_gmdid(struct xe_device *xe, enum xe_gmdid_type type, u32 *ver, u > > int err; > > > > /* Don't try to read media ver if media GT is not allowed */ > > - if (type == GMDID_MEDIA && !xe_configfs_media_gt_allowed(to_pci_dev(xe->drm.dev))) { > > + if (type == GMDID_MEDIA && !xe_device_media_allowed(xe)) { > > *ver = *revid = 0; > > return 0; > > } > > @@ -791,6 +791,18 @@ static int xe_probe_info_early(struct xe_device *xe, > > return 0; > > } > > > > +/* > > + * Whether the user wants media at all. The default (-1) leaves the decision > > + * to the driver. > > + */ > > +static bool media_wanted(struct xe_device *xe) > > +{ > > + if (xe_modparam.enable_media < 0) > > + return true; > > + > > + return xe_modparam.enable_media; > > +} > > + > > /* > > * Initialize device info content that only depends on static driver_data > > * passed to the driver at probe time from PCI ID table. > > @@ -817,6 +829,9 @@ static int xe_info_init_early(struct xe_device *xe, > > > > xe_wa_process_device_oob(xe); > > > > + xe->info.media_allowed = media_wanted(xe) && > > + xe_configfs_media_gt_allowed(to_pci_dev(xe->drm.dev)); > > + > > xe->info.dma_mask_size = desc->dma_mask_size; > > xe->info.va_bits = desc->va_bits; > > xe->info.vm_max_level = desc->vm_max_level; > > @@ -965,8 +980,8 @@ static struct xe_gt *alloc_media_gt(struct xe_tile *tile, > > struct xe_device *xe = tile_to_xe(tile); > > struct xe_gt *gt; > > > > - if (!xe_configfs_media_gt_allowed(to_pci_dev(xe->drm.dev))) { > > - xe_tile_info(tile, "Media GT disabled via configfs\n"); > > + if (!xe_device_media_allowed(xe)) { > > + xe_tile_info(tile, "Media GT disabled\n"); > > return NULL; > > } > > > > -- > > 2.43.0 > > > > -- > Matt Roper > Graphics Software Engineer > Linux GPU Platform Enablement > Intel Corporation