aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
diff options
context:
space:
mode:
authorAlex Deucher <alexander.deucher@amd.com>2018-01-23 17:05:03 -0500
committerAlex Deucher <alexander.deucher@amd.com>2018-02-19 14:19:03 -0500
commit3fa203af4bd0c7eb09f21af34d3a68e08583feac (patch)
treeee356facc91fa93e90c271cb1684862deadb93f6 /drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
parent367e66870e9cc20b867b11c4484ae83336efcb67 (diff)
drm/amdgpu: set DRIVER_ATOMIC flag early
The atomic debugfs stuff gets created in drm_dev_alloc() but this gets called before we've enumerated all of our IPs, so move the DRIVER_ATOMIC flag setting to fix that. Since DRIVER_ATOMIC is a driver flag it's currently global to the driver so setting it affects all GPUs driven by the driver. Unfortunately, not all GPUs support atomic. Warn the user if that is the case. This is the same as our current behavior, but at least the atomic debugfs stuff gets created now. Acked-by: Harry Wentland <harry.wentland@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.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
index d1a695864793..367f331b4a54 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
@@ -578,6 +578,11 @@ static int amdgpu_pci_probe(struct pci_dev *pdev,
578 struct drm_device *dev; 578 struct drm_device *dev;
579 unsigned long flags = ent->driver_data; 579 unsigned long flags = ent->driver_data;
580 int ret, retry = 0; 580 int ret, retry = 0;
581 bool supports_atomic = false;
582
583 if (!amdgpu_virtual_display &&
584 amdgpu_device_asic_has_dc_support(flags & AMD_ASIC_MASK))
585 supports_atomic = true;
581 586
582 if ((flags & AMD_EXP_HW_SUPPORT) && !amdgpu_exp_hw_support) { 587 if ((flags & AMD_EXP_HW_SUPPORT) && !amdgpu_exp_hw_support) {
583 DRM_INFO("This hardware requires experimental hardware support.\n" 588 DRM_INFO("This hardware requires experimental hardware support.\n"
@@ -598,6 +603,13 @@ static int amdgpu_pci_probe(struct pci_dev *pdev,
598 if (ret) 603 if (ret)
599 return ret; 604 return ret;
600 605
606 /* warn the user if they mix atomic and non-atomic capable GPUs */
607 if ((kms_driver.driver_features & DRIVER_ATOMIC) && !supports_atomic)
608 DRM_ERROR("Mixing atomic and non-atomic capable GPUs!\n");
609 /* support atomic early so the atomic debugfs stuff gets created */
610 if (supports_atomic)
611 kms_driver.driver_features |= DRIVER_ATOMIC;
612
601 dev = drm_dev_alloc(&kms_driver, &pdev->dev); 613 dev = drm_dev_alloc(&kms_driver, &pdev->dev);
602 if (IS_ERR(dev)) 614 if (IS_ERR(dev))
603 return PTR_ERR(dev); 615 return PTR_ERR(dev);