Skip to content

Commit

Permalink
drm/xe: Rename enable_display module param
Browse files Browse the repository at this point in the history
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 <[email protected]>
Acked-by: Jani Nikula <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
Signed-off-by: Lucas De Marchi <[email protected]>
  • Loading branch information
lucasdemarchi committed Aug 13, 2024
1 parent 4b498d1 commit 1eda95c
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 34 deletions.
46 changes: 23 additions & 23 deletions drivers/gpu/drm/xe/display/xe_display.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ static bool has_display(struct xe_device *xe)
*/
bool xe_display_driver_probe_defer(struct pci_dev *pdev)
{
if (!xe_modparam.enable_display)
if (!xe_modparam.probe_display)
return 0;

return intel_display_driver_probe_defer(pdev);
Expand All @@ -61,7 +61,7 @@ bool xe_display_driver_probe_defer(struct pci_dev *pdev)
*/
void xe_display_driver_set_hooks(struct drm_driver *driver)
{
if (!xe_modparam.enable_display)
if (!xe_modparam.probe_display)
return;

driver->driver_features |= DRIVER_MODESET | DRIVER_ATOMIC;
Expand Down Expand Up @@ -103,15 +103,15 @@ static void xe_display_fini_nommio(struct drm_device *dev, void *dummy)
{
struct xe_device *xe = to_xe_device(dev);

if (!xe->info.enable_display)
if (!xe->info.probe_display)
return;

intel_power_domains_cleanup(xe);
}

int xe_display_init_nommio(struct xe_device *xe)
{
if (!xe->info.enable_display)
if (!xe->info.probe_display)
return 0;

/* Fake uncore lock */
Expand All @@ -127,7 +127,7 @@ static void xe_display_fini_noirq(void *arg)
{
struct xe_device *xe = arg;

if (!xe->info.enable_display)
if (!xe->info.probe_display)
return;

intel_display_driver_remove_noirq(xe);
Expand All @@ -137,7 +137,7 @@ int xe_display_init_noirq(struct xe_device *xe)
{
int err;

if (!xe->info.enable_display)
if (!xe->info.probe_display)
return 0;

intel_display_driver_early_probe(xe);
Expand Down Expand Up @@ -166,7 +166,7 @@ static void xe_display_fini_noaccel(void *arg)
{
struct xe_device *xe = arg;

if (!xe->info.enable_display)
if (!xe->info.probe_display)
return;

intel_display_driver_remove_nogem(xe);
Expand All @@ -176,7 +176,7 @@ int xe_display_init_noaccel(struct xe_device *xe)
{
int err;

if (!xe->info.enable_display)
if (!xe->info.probe_display)
return 0;

err = intel_display_driver_probe_nogem(xe);
Expand All @@ -188,15 +188,15 @@ int xe_display_init_noaccel(struct xe_device *xe)

int xe_display_init(struct xe_device *xe)
{
if (!xe->info.enable_display)
if (!xe->info.probe_display)
return 0;

return intel_display_driver_probe(xe);
}

void xe_display_fini(struct xe_device *xe)
{
if (!xe->info.enable_display)
if (!xe->info.probe_display)
return;

intel_hpd_poll_fini(xe);
Expand All @@ -207,7 +207,7 @@ void xe_display_fini(struct xe_device *xe)

void xe_display_register(struct xe_device *xe)
{
if (!xe->info.enable_display)
if (!xe->info.probe_display)
return;

intel_display_driver_register(xe);
Expand All @@ -217,7 +217,7 @@ void xe_display_register(struct xe_device *xe)

void xe_display_unregister(struct xe_device *xe)
{
if (!xe->info.enable_display)
if (!xe->info.probe_display)
return;

intel_unregister_dsm_handler();
Expand All @@ -227,7 +227,7 @@ void xe_display_unregister(struct xe_device *xe)

void xe_display_driver_remove(struct xe_device *xe)
{
if (!xe->info.enable_display)
if (!xe->info.probe_display)
return;

intel_display_driver_remove(xe);
Expand All @@ -237,7 +237,7 @@ void xe_display_driver_remove(struct xe_device *xe)

void xe_display_irq_handler(struct xe_device *xe, u32 master_ctl)
{
if (!xe->info.enable_display)
if (!xe->info.probe_display)
return;

if (master_ctl & DISPLAY_IRQ)
Expand All @@ -246,7 +246,7 @@ void xe_display_irq_handler(struct xe_device *xe, u32 master_ctl)

void xe_display_irq_enable(struct xe_device *xe, u32 gu_misc_iir)
{
if (!xe->info.enable_display)
if (!xe->info.probe_display)
return;

if (gu_misc_iir & GU_MISC_GSE)
Expand All @@ -255,15 +255,15 @@ void xe_display_irq_enable(struct xe_device *xe, u32 gu_misc_iir)

void xe_display_irq_reset(struct xe_device *xe)
{
if (!xe->info.enable_display)
if (!xe->info.probe_display)
return;

gen11_display_irq_reset(xe);
}

void xe_display_irq_postinstall(struct xe_device *xe, struct xe_gt *gt)
{
if (!xe->info.enable_display)
if (!xe->info.probe_display)
return;

if (gt->info.id == XE_GT0)
Expand Down Expand Up @@ -297,7 +297,7 @@ static bool suspend_to_idle(void)
void xe_display_pm_suspend(struct xe_device *xe, bool runtime)
{
bool s2idle = suspend_to_idle();
if (!xe->info.enable_display)
if (!xe->info.probe_display)
return;

/*
Expand Down Expand Up @@ -327,7 +327,7 @@ void xe_display_pm_suspend(struct xe_device *xe, bool runtime)
void xe_display_pm_suspend_late(struct xe_device *xe)
{
bool s2idle = suspend_to_idle();
if (!xe->info.enable_display)
if (!xe->info.probe_display)
return;

intel_power_domains_suspend(xe, s2idle);
Expand All @@ -337,7 +337,7 @@ void xe_display_pm_suspend_late(struct xe_device *xe)

void xe_display_pm_resume_early(struct xe_device *xe)
{
if (!xe->info.enable_display)
if (!xe->info.probe_display)
return;

intel_display_power_resume_early(xe);
Expand All @@ -347,7 +347,7 @@ void xe_display_pm_resume_early(struct xe_device *xe)

void xe_display_pm_resume(struct xe_device *xe, bool runtime)
{
if (!xe->info.enable_display)
if (!xe->info.probe_display)
return;

intel_dmc_resume(xe);
Expand Down Expand Up @@ -385,7 +385,7 @@ int xe_display_probe(struct xe_device *xe)
{
int err;

if (!xe->info.enable_display)
if (!xe->info.probe_display)
goto no_display;

intel_display_device_probe(xe);
Expand All @@ -398,7 +398,7 @@ int xe_display_probe(struct xe_device *xe)
return 0;

no_display:
xe->info.enable_display = false;
xe->info.probe_display = false;
unset_display_features(xe);
return 0;
}
2 changes: 1 addition & 1 deletion drivers/gpu/drm/xe/xe_device.c
Original file line number Diff line number Diff line change
Expand Up @@ -543,7 +543,7 @@ static void update_device_info(struct xe_device *xe)
{
/* disable features that are not available/applicable to VFs */
if (IS_SRIOV_VF(xe)) {
xe->info.enable_display = 0;
xe->info.probe_display = 0;
xe->info.has_heci_gscfi = 0;
xe->info.skip_guc_pc = 1;
xe->info.skip_pcode = 1;
Expand Down
11 changes: 9 additions & 2 deletions drivers/gpu/drm/xe/xe_device_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -282,8 +282,15 @@ struct xe_device {
u8 has_sriov:1;
/** @info.has_usm: Device has unified shared memory support */
u8 has_usm:1;
/** @info.enable_display: display enabled */
u8 enable_display:1;
/**
* @info.probe_display: Probe display hardware. If set to
* false, the driver will behave as if there is no display
* hardware present and will not try to read/write to it in any
* way. The display hardware, if it exists, will not be
* exposed to userspace and will be left untouched in whatever
* state the firmware or bootloader left it in.
*/
u8 probe_display:1;
/** @info.skip_mtcfg: skip Multi-Tile configuration from MTCFG register */
u8 skip_mtcfg:1;
/** @info.skip_pcode: skip access to PCODE uC */
Expand Down
6 changes: 3 additions & 3 deletions drivers/gpu/drm/xe/xe_module.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#include "xe_sched_job.h"

struct xe_modparam xe_modparam = {
.enable_display = true,
.probe_display = true,
.guc_log_level = 5,
.force_probe = CONFIG_DRM_XE_FORCE_PROBE,
.wedged_mode = 1,
Expand All @@ -25,8 +25,8 @@ struct xe_modparam xe_modparam = {
module_param_named_unsafe(force_execlist, xe_modparam.force_execlist, bool, 0444);
MODULE_PARM_DESC(force_execlist, "Force Execlist submission");

module_param_named(enable_display, xe_modparam.enable_display, bool, 0444);
MODULE_PARM_DESC(enable_display, "Enable 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 (default: true)");

module_param_named(vram_bar_size, xe_modparam.force_vram_bar_size, uint, 0600);
MODULE_PARM_DESC(vram_bar_size, "Set the vram bar size(in MiB)");
Expand Down
2 changes: 1 addition & 1 deletion drivers/gpu/drm/xe/xe_module.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
/* Module modprobe variables */
struct xe_modparam {
bool force_execlist;
bool enable_display;
bool probe_display;
u32 force_vram_bar_size;
int guc_log_level;
char *guc_firmware_path;
Expand Down
8 changes: 4 additions & 4 deletions drivers/gpu/drm/xe/xe_pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -616,9 +616,9 @@ static int xe_info_init_early(struct xe_device *xe,
xe->info.skip_mtcfg = desc->skip_mtcfg;
xe->info.skip_pcode = desc->skip_pcode;

xe->info.enable_display = IS_ENABLED(CONFIG_DRM_XE_DISPLAY) &&
xe_modparam.enable_display &&
desc->has_display;
xe->info.probe_display = IS_ENABLED(CONFIG_DRM_XE_DISPLAY) &&
xe_modparam.probe_display &&
desc->has_display;

err = xe_tile_init_early(xe_device_get_root_tile(xe), xe, 0);
if (err)
Expand Down Expand Up @@ -829,7 +829,7 @@ static int xe_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
xe->info.media_name,
xe->info.media_verx100 / 100,
xe->info.media_verx100 % 100,
str_yes_no(xe->info.enable_display),
str_yes_no(xe->info.probe_display),
xe->info.dma_mask_size, xe->info.tile_count,
xe->info.has_heci_gscfi, xe->info.has_heci_cscfi);

Expand Down

0 comments on commit 1eda95c

Please sign in to comment.