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 3FEF0606A32D for ; Thu, 3 Dec 2026 21:34:09 +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=Jjiycjml Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 003ED112C96; Thu, 3 Dec 2026 21:34:03 +0000 (UTC) Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.5]) by gabe.freedesktop.org (Postfix) with ESMTPS id 45299112C97 for ; Thu, 3 Dec 2026 21:33:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1796333639; x=1827869639; h=date:from:to:cc:subject:message-id:references: in-reply-to:mime-version; bh=NQjvK53AwEFfcGbkwudoDfW7QL+P86bm7ZMJXk0CeJs=; b=JjiycjmlpkSukFcgZcWj1Cz2TSZwRGXQxuUr5EAZDU8B+lzTpmj43Br5 HZeO1en5py2OI9akn3f3xkIC5bmSJbuxugWVUuhcKa2R2075sQY4sSqOq mYKFBOYUmHSIfPi+byoak4CfnzdfNqGPQAY9FLP6G1v2dp2KqZOKsv8cP ZHyQf8Y/Qf+fXc56amE909l2CIRG85sqWrOrXi8orRLojBAB1O5xA6wSe 6YezTvsoP0ytcQYcJoo9WsFuR49+7BPmlROMpNWwOxZ9RuOeWQSHPw4rZ hCp8VhsHbauvxkhkT6NJrWDL7nEdoXBYjJwYnx1Z4LvVQNQDQ8RodGupE A==; X-CSE-ConnectionGUID: LjM85ccWRj2dntVpgE/r5A== X-CSE-MsgGUID: 8Q8XMsZ7RYCVVNDLWDPVrQ== X-IronPort-AV: E=McAfee;i="6800,10657,11985"; a="36556" X-IronPort-AV: E=Sophos;i="6.29,77,1794902400"; d="scan'208";a="36556" Received: from fmviesa006.fm.intel.com ([10.60.135.146]) by fmvoesa115.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Dec 2026 13:33:58 -0800 X-CSE-ConnectionGUID: elTBB2WkQHKt1b4YCpnBQw== X-CSE-MsgGUID: y1b4XKLnReK03/gpKB09fg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.29,77,1794902400"; d="scan'208";a="14222613" Received: from fmsmsx901.amr.corp.intel.com ([10.18.126.90]) by fmviesa006.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Dec 2026 13:33:58 -0800 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.57; Thu, 3 Dec 2026 13:33:57 -0800 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.57 via Frontend Transport; Thu, 3 Dec 2026 13:33:57 -0800 Received: from CH1PR05CU001.outbound.protection.outlook.com (52.101.193.48) 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.57; Thu, 3 Dec 2026 13:33:57 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=XDzEZd7ErhL7jLEG+woTl8AWhMGlHT9jDTTxLeQGAR7Bt+EbdU+U7pWQIQ6Fw/+raPJ8pqS6nVa3gFARyjh2kgv18WzQm0mBABjj4JasU2bvQV37YNzVXGhLV1AcW2LGMl02B5tAm2j4M++TptiLihqAT+ev/eIWzVoQGe+zSa5gueIVeZWFmHx/NCQ4d7OJC4zAZoVtINODDgDMDeoZr2/b8p+72iuWs4kWeDHURW/qrmlNN329dtFnfyldlk5oSKOADKFjcdFCsDAdj3CxdoO8cGluCZpOYL1PUCF5Iwc6eX9iLovn1qCcnswu6sQclhxky0ZWQAK2ImspG7UVWw== 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=vbY8sJjz+RUuPgZSGW3ALAdy1Jxq31uJPsjCoa/rm50=; b=tpqCZ34HiMAiv1zUTR7MiII4vtcNcjWffl+YlSFmHhE/eIEUKFMP8LlMmkzh5D+v9W9el0KPkKatzuUlUHEiY8skmEzJZg/pjVkcUU6+MB6NYYgexSDsmNcDq3EJknBK3Rl201YJZr81ZTHaPj4LaQANdGKmU7R3csdCdNBh2pXNZWl4ODPTnpBeV7wHx40WumUPFoO80FtbSZhATnSHKjNamzcwOChHG/ztDFO+aqFh8vuoXWVmxhuOoKq9Upg0J7I3PAKShJEYssJFo7ttmexd4TboatUzfR3AqJ+7hysBon8Sh3/aKw7BtFaKVLeZSP1OoVxrpZ4gRChKUm5AVg== 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 SJ0PR11MB5102.namprd11.prod.outlook.com (2603:10b6:a03:2ac::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.688.12; Thu, 3 Dec 2026 21:33:53 +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:33:53 +0000 Date: Thu, 3 Dec 2026 16:33:50 -0500 From: Rodrigo Vivi To: Stuart Summers CC: , , , , , , 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> Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20261203190926.249488-5-stuart.summers@intel.com> X-ClientProxiedBy: SJ2PR07CA0005.namprd07.prod.outlook.com (2603:10b6:a03:505::29) 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_|SJ0PR11MB5102:EE_ X-MS-Office365-Filtering-Correlation-Id: 1cbdbaa6-449c-4cb8-d7ca-08df518520c4 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|376014|366016|1800799024|23010399003|4143699003|11063799006|261009223027099003|3023799007|22082099003|18002099003|10067099003|261028144727099003|261022075727099003|261021121427099003|261102123227099003|261021123027099003|261022105027099003|261026140227099003|261026121527099003|56012099006; X-Microsoft-Antispam-Message-Info: qHDziuPcXTdblrrRVmCXB+B6Ef+sGNk5VE86gho/GlH2sMU2PJz4PQpGA38Z63qwsKweOMoaMHL6A8uRfeWMFs6f62ap1sjlAW3S5jbpLooubdgotLAOUeZrvZ2UZq6aBQma5vj7ZQNBpmZGYM6igiOFWnPfVsayMV+AUQIfqF8yu8Z1cS3bmxVux83ywB6U/e7urdm+dt9xF5XGP9LJfupTHF1GoGKUpihLjmotwSr3HyRWypc/DO6lOSeMJeEnneOwVpY1WIuvTMag9C/JDS2cjM1KEQxN3OcTdbzJH4n0bqZYJ1oQHd23e0EDqR79VMkoykKxKXu/0CaASVaSlAL1IYXD5kMW284HFDHFPe1Oign7rKEua1YdARZkOxOHyciJoJD01U9R9V/ssdQ8ni/tlyuDGboy/+YU1SmIRinSn5iFONIr8Nf1fR2DaBvBG68fiGFtQSfrvsjpq5TXJ5kknfsK2jZFPEdNTkOd32tXfWpsiOaMBiSpUVEZy3ptuFSmsS2AckqGmRIdX9Yzu//VOVB03lw3/qvNUKtTPYHIZOKt/5xCnzlXTEUroCuRUHjK18jNP2hGpX1ANA01tVYCaq+0q9TWLAlrLV8y67wf8rVfC1iWlJUPnWuDTF+pDNOcBPNLfh83qAj2AlgHnp/q7ckFlvOOOdxmfyqlPuE= 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)(376014)(366016)(1800799024)(23010399003)(4143699003)(11063799006)(261009223027099003)(3023799007)(22082099003)(18002099003)(10067099003)(261028144727099003)(261022075727099003)(261021121427099003)(261102123227099003)(261021123027099003)(261022105027099003)(261026140227099003)(261026121527099003)(56012099006); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?P2m4zFYrL5wsOFlO7PTVVvesc7Ls4N6JG8BsKyqF0wWzSmh+GmDoHEYap0M6?= =?us-ascii?Q?rMI6dZ46NjvmB7lLGLWn3xQCIuZceo3PQqwaQmzZpy5k9J+GGokTGbmB+PmQ?= =?us-ascii?Q?9uaOPqPF4r18N+Wz7rkHzL61Hmgz+wdl13n+Ma2EF4SyGJVkvln68lPJOulD?= =?us-ascii?Q?32sKdNv1UBy6V5W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/TGpdcOdsLlGzG4Z6kv04mXTWIKjN8EIANhQgsrYceIUAzl4tTcnhyDsirzR6XOwncM/T3XlrgdXfW4lgg4odPhJn/qBxOzdG/b7/MA7yI/z3m+iPxLj8ow== X-MS-Exchange-CrossTenant-Network-Message-Id: 1cbdbaa6-449c-4cb8-d7ca-08df518520c4 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:33:53.4213 (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: SRv0r/DDd8NGItNZhsOWOBNnBEGsUHFDRNcd7dO0Fuqs6t/zrxKQiwo+ggjBQHeUO2Zp29Ri9noDgnyIkyWjqA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR11MB5102 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 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. > > 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 The modparam is 0444, so only configfs is writable here. > 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) "])"); Extra ')' here. > + > #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 >