Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/xe: Rename enable_display module param

The different approach used by xe regarding the initialization of
display HW has been proved a great addition for early driver bring up:
core xe can be tested without having all the bits sorted out on the
display side.

On the other hand, the approach exposed by i915-display is to *actively*
disable the display by programming it if needed, i.e. if it was left
enabled by firmware. It also has its use to make sure the HW is actually
disabled and not wasting power.

However having both the way it is in xe doesn't expose a good interface
wrt module params. From modinfo:

disable_display:Disable display (default: false) (bool)
enable_display:Enable display (bool)

Rename enable_display to probe_display to try to convey the message that
the HW is being touched and improve the module param description. To
avoid confusion, the enable_display is renamed everywhere, not only in
the module param. New description for the parameters:

disable_display:Disable display (default: false) (bool)
probe_display:Probe display HW, otherwise it's left untouched (default: true) (bool)

Reviewed-by: Matt Roper <matthew.d.roper@intel.com>
Acked-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240813141931.3141395-1-lucas.demarchi@intel.com
Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>

+41 -34
+23 -23
drivers/gpu/drm/xe/display/xe_display.c
··· 45 45 */ 46 46 bool xe_display_driver_probe_defer(struct pci_dev *pdev) 47 47 { 48 - if (!xe_modparam.enable_display) 48 + if (!xe_modparam.probe_display) 49 49 return 0; 50 50 51 51 return intel_display_driver_probe_defer(pdev); ··· 61 61 */ 62 62 void xe_display_driver_set_hooks(struct drm_driver *driver) 63 63 { 64 - if (!xe_modparam.enable_display) 64 + if (!xe_modparam.probe_display) 65 65 return; 66 66 67 67 driver->driver_features |= DRIVER_MODESET | DRIVER_ATOMIC; ··· 103 103 { 104 104 struct xe_device *xe = to_xe_device(dev); 105 105 106 - if (!xe->info.enable_display) 106 + if (!xe->info.probe_display) 107 107 return; 108 108 109 109 intel_power_domains_cleanup(xe); ··· 111 111 112 112 int xe_display_init_nommio(struct xe_device *xe) 113 113 { 114 - if (!xe->info.enable_display) 114 + if (!xe->info.probe_display) 115 115 return 0; 116 116 117 117 /* Fake uncore lock */ ··· 127 127 { 128 128 struct xe_device *xe = arg; 129 129 130 - if (!xe->info.enable_display) 130 + if (!xe->info.probe_display) 131 131 return; 132 132 133 133 intel_display_driver_remove_noirq(xe); ··· 137 137 { 138 138 int err; 139 139 140 - if (!xe->info.enable_display) 140 + if (!xe->info.probe_display) 141 141 return 0; 142 142 143 143 intel_display_driver_early_probe(xe); ··· 166 166 { 167 167 struct xe_device *xe = arg; 168 168 169 - if (!xe->info.enable_display) 169 + if (!xe->info.probe_display) 170 170 return; 171 171 172 172 intel_display_driver_remove_nogem(xe); ··· 176 176 { 177 177 int err; 178 178 179 - if (!xe->info.enable_display) 179 + if (!xe->info.probe_display) 180 180 return 0; 181 181 182 182 err = intel_display_driver_probe_nogem(xe); ··· 188 188 189 189 int xe_display_init(struct xe_device *xe) 190 190 { 191 - if (!xe->info.enable_display) 191 + if (!xe->info.probe_display) 192 192 return 0; 193 193 194 194 return intel_display_driver_probe(xe); ··· 196 196 197 197 void xe_display_fini(struct xe_device *xe) 198 198 { 199 - if (!xe->info.enable_display) 199 + if (!xe->info.probe_display) 200 200 return; 201 201 202 202 intel_hpd_poll_fini(xe); ··· 207 207 208 208 void xe_display_register(struct xe_device *xe) 209 209 { 210 - if (!xe->info.enable_display) 210 + if (!xe->info.probe_display) 211 211 return; 212 212 213 213 intel_display_driver_register(xe); ··· 217 217 218 218 void xe_display_unregister(struct xe_device *xe) 219 219 { 220 - if (!xe->info.enable_display) 220 + if (!xe->info.probe_display) 221 221 return; 222 222 223 223 intel_unregister_dsm_handler(); ··· 227 227 228 228 void xe_display_driver_remove(struct xe_device *xe) 229 229 { 230 - if (!xe->info.enable_display) 230 + if (!xe->info.probe_display) 231 231 return; 232 232 233 233 intel_display_driver_remove(xe); ··· 237 237 238 238 void xe_display_irq_handler(struct xe_device *xe, u32 master_ctl) 239 239 { 240 - if (!xe->info.enable_display) 240 + if (!xe->info.probe_display) 241 241 return; 242 242 243 243 if (master_ctl & DISPLAY_IRQ) ··· 246 246 247 247 void xe_display_irq_enable(struct xe_device *xe, u32 gu_misc_iir) 248 248 { 249 - if (!xe->info.enable_display) 249 + if (!xe->info.probe_display) 250 250 return; 251 251 252 252 if (gu_misc_iir & GU_MISC_GSE) ··· 255 255 256 256 void xe_display_irq_reset(struct xe_device *xe) 257 257 { 258 - if (!xe->info.enable_display) 258 + if (!xe->info.probe_display) 259 259 return; 260 260 261 261 gen11_display_irq_reset(xe); ··· 263 263 264 264 void xe_display_irq_postinstall(struct xe_device *xe, struct xe_gt *gt) 265 265 { 266 - if (!xe->info.enable_display) 266 + if (!xe->info.probe_display) 267 267 return; 268 268 269 269 if (gt->info.id == XE_GT0) ··· 297 297 void xe_display_pm_suspend(struct xe_device *xe, bool runtime) 298 298 { 299 299 bool s2idle = suspend_to_idle(); 300 - if (!xe->info.enable_display) 300 + if (!xe->info.probe_display) 301 301 return; 302 302 303 303 /* ··· 327 327 void xe_display_pm_suspend_late(struct xe_device *xe) 328 328 { 329 329 bool s2idle = suspend_to_idle(); 330 - if (!xe->info.enable_display) 330 + if (!xe->info.probe_display) 331 331 return; 332 332 333 333 intel_power_domains_suspend(xe, s2idle); ··· 337 337 338 338 void xe_display_pm_resume_early(struct xe_device *xe) 339 339 { 340 - if (!xe->info.enable_display) 340 + if (!xe->info.probe_display) 341 341 return; 342 342 343 343 intel_display_power_resume_early(xe); ··· 347 347 348 348 void xe_display_pm_resume(struct xe_device *xe, bool runtime) 349 349 { 350 - if (!xe->info.enable_display) 350 + if (!xe->info.probe_display) 351 351 return; 352 352 353 353 intel_dmc_resume(xe); ··· 385 385 { 386 386 int err; 387 387 388 - if (!xe->info.enable_display) 388 + if (!xe->info.probe_display) 389 389 goto no_display; 390 390 391 391 intel_display_device_probe(xe); ··· 398 398 return 0; 399 399 400 400 no_display: 401 - xe->info.enable_display = false; 401 + xe->info.probe_display = false; 402 402 unset_display_features(xe); 403 403 return 0; 404 404 }
+1 -1
drivers/gpu/drm/xe/xe_device.c
··· 543 543 { 544 544 /* disable features that are not available/applicable to VFs */ 545 545 if (IS_SRIOV_VF(xe)) { 546 - xe->info.enable_display = 0; 546 + xe->info.probe_display = 0; 547 547 xe->info.has_heci_gscfi = 0; 548 548 xe->info.skip_guc_pc = 1; 549 549 xe->info.skip_pcode = 1;
+9 -2
drivers/gpu/drm/xe/xe_device_types.h
··· 282 282 u8 has_sriov:1; 283 283 /** @info.has_usm: Device has unified shared memory support */ 284 284 u8 has_usm:1; 285 - /** @info.enable_display: display enabled */ 286 - u8 enable_display:1; 285 + /** 286 + * @info.probe_display: Probe display hardware. If set to 287 + * false, the driver will behave as if there is no display 288 + * hardware present and will not try to read/write to it in any 289 + * way. The display hardware, if it exists, will not be 290 + * exposed to userspace and will be left untouched in whatever 291 + * state the firmware or bootloader left it in. 292 + */ 293 + u8 probe_display:1; 287 294 /** @info.skip_mtcfg: skip Multi-Tile configuration from MTCFG register */ 288 295 u8 skip_mtcfg:1; 289 296 /** @info.skip_pcode: skip access to PCODE uC */
+3 -3
drivers/gpu/drm/xe/xe_module.c
··· 15 15 #include "xe_sched_job.h" 16 16 17 17 struct xe_modparam xe_modparam = { 18 - .enable_display = true, 18 + .probe_display = true, 19 19 .guc_log_level = 5, 20 20 .force_probe = CONFIG_DRM_XE_FORCE_PROBE, 21 21 .wedged_mode = 1, ··· 25 25 module_param_named_unsafe(force_execlist, xe_modparam.force_execlist, bool, 0444); 26 26 MODULE_PARM_DESC(force_execlist, "Force Execlist submission"); 27 27 28 - module_param_named(enable_display, xe_modparam.enable_display, bool, 0444); 29 - MODULE_PARM_DESC(enable_display, "Enable display"); 28 + module_param_named(probe_display, xe_modparam.probe_display, bool, 0444); 29 + MODULE_PARM_DESC(probe_display, "Probe display HW, otherwise it's left untouched (default: true)"); 30 30 31 31 module_param_named(vram_bar_size, xe_modparam.force_vram_bar_size, uint, 0600); 32 32 MODULE_PARM_DESC(vram_bar_size, "Set the vram bar size(in MiB)");
+1 -1
drivers/gpu/drm/xe/xe_module.h
··· 11 11 /* Module modprobe variables */ 12 12 struct xe_modparam { 13 13 bool force_execlist; 14 - bool enable_display; 14 + bool probe_display; 15 15 u32 force_vram_bar_size; 16 16 int guc_log_level; 17 17 char *guc_firmware_path;
+4 -4
drivers/gpu/drm/xe/xe_pci.c
··· 616 616 xe->info.skip_mtcfg = desc->skip_mtcfg; 617 617 xe->info.skip_pcode = desc->skip_pcode; 618 618 619 - xe->info.enable_display = IS_ENABLED(CONFIG_DRM_XE_DISPLAY) && 620 - xe_modparam.enable_display && 621 - desc->has_display; 619 + xe->info.probe_display = IS_ENABLED(CONFIG_DRM_XE_DISPLAY) && 620 + xe_modparam.probe_display && 621 + desc->has_display; 622 622 623 623 err = xe_tile_init_early(xe_device_get_root_tile(xe), xe, 0); 624 624 if (err) ··· 829 829 xe->info.media_name, 830 830 xe->info.media_verx100 / 100, 831 831 xe->info.media_verx100 % 100, 832 - str_yes_no(xe->info.enable_display), 832 + str_yes_no(xe->info.probe_display), 833 833 xe->info.dma_mask_size, xe->info.tile_count, 834 834 xe->info.has_heci_gscfi, xe->info.has_heci_cscfi); 835 835