diff options
| author | Alex Deucher <alexander.deucher@amd.com> | 2025-03-13 20:52:38 -0400 | 
|---|---|---|
| committer | Alex Deucher <alexander.deucher@amd.com> | 2025-03-18 14:03:38 -0400 | 
| commit | e00e5c223878a60e391e5422d173c3382d378f87 (patch) | |
| tree | 7f8cf65a6c3a6a7d1c4a3547e146aed0bf5c7c05 /drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | |
| parent | 4db4c82d4db7aeded480d905624396dc284db090 (diff) | |
drm/amdgpu: adjust drm_firmware_drivers_only() handling
Move to probe so we can check the PCI device type and
only apply the drm_firmware_drivers_only() check for
PCI DISPLAY classes.  Also add a module parameter to
override the nomodeset kernel parameter as a workaround
for platforms that have this hardcoded on their kernel
command lines.
Reviewed-by: Kent Russell <kent.russell@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c')
| -rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 14 | 
1 files changed, 14 insertions, 0 deletions
| diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c index 1e77fdc9c7d1..f62456da0ba5 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c @@ -176,6 +176,7 @@ uint amdgpu_sdma_phase_quantum = 32;  char *amdgpu_disable_cu;  char *amdgpu_virtual_display;  bool enforce_isolation; +int amdgpu_modeset = -1;  /* Specifies the default granularity for SVM, used in buffer   * migration and restoration of backing memory when handling @@ -1038,6 +1039,13 @@ module_param(enforce_isolation, bool, 0444);  MODULE_PARM_DESC(enforce_isolation, "enforce process isolation between graphics and compute . enforce_isolation = on");  /** + * DOC: modeset (int) + * Override nomodeset (1 = override, -1 = auto). The default is -1 (auto). + */ +MODULE_PARM_DESC(modeset, "Override nomodeset (1 = enable, -1 = auto)"); +module_param_named(modeset, amdgpu_modeset, int, 0444); + +/**   * DOC: seamless (int)   * Seamless boot will keep the image on the screen during the boot process.   */ @@ -2257,6 +2265,12 @@ static int amdgpu_pci_probe(struct pci_dev *pdev,  	int ret, retry = 0, i;  	bool supports_atomic = false; +	if ((pdev->class >> 8) == PCI_CLASS_DISPLAY_VGA || +	    (pdev->class >> 8) == PCI_CLASS_DISPLAY_OTHER) { +		if (drm_firmware_drivers_only() && amdgpu_modeset == -1) +			return -EINVAL; +	} +  	/* skip devices which are owned by radeon */  	for (i = 0; i < ARRAY_SIZE(amdgpu_unsupported_pciidlist); i++) {  		if (amdgpu_unsupported_pciidlist[i] == pdev->device) | 
