diff options
| -rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_atpx_handler.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_atpx_handler.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_atpx_handler.c index dae35a96a694..02ca5dd978f6 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_atpx_handler.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_atpx_handler.c | |||
| @@ -34,6 +34,7 @@ struct amdgpu_atpx { | |||
| 34 | 34 | ||
| 35 | static struct amdgpu_atpx_priv { | 35 | static struct amdgpu_atpx_priv { |
| 36 | bool atpx_detected; | 36 | bool atpx_detected; |
| 37 | bool bridge_pm_usable; | ||
| 37 | /* handle for device - and atpx */ | 38 | /* handle for device - and atpx */ |
| 38 | acpi_handle dhandle; | 39 | acpi_handle dhandle; |
| 39 | acpi_handle other_handle; | 40 | acpi_handle other_handle; |
| @@ -205,7 +206,11 @@ static int amdgpu_atpx_validate(struct amdgpu_atpx *atpx) | |||
| 205 | atpx->is_hybrid = false; | 206 | atpx->is_hybrid = false; |
| 206 | if (valid_bits & ATPX_MS_HYBRID_GFX_SUPPORTED) { | 207 | if (valid_bits & ATPX_MS_HYBRID_GFX_SUPPORTED) { |
| 207 | printk("ATPX Hybrid Graphics\n"); | 208 | printk("ATPX Hybrid Graphics\n"); |
| 208 | atpx->functions.power_cntl = false; | 209 | /* |
| 210 | * Disable legacy PM methods only when pcie port PM is usable, | ||
| 211 | * otherwise the device might fail to power off or power on. | ||
| 212 | */ | ||
| 213 | atpx->functions.power_cntl = !amdgpu_atpx_priv.bridge_pm_usable; | ||
| 209 | atpx->is_hybrid = true; | 214 | atpx->is_hybrid = true; |
| 210 | } | 215 | } |
| 211 | 216 | ||
| @@ -480,6 +485,7 @@ static int amdgpu_atpx_power_state(enum vga_switcheroo_client_id id, | |||
| 480 | */ | 485 | */ |
| 481 | static bool amdgpu_atpx_pci_probe_handle(struct pci_dev *pdev) | 486 | static bool amdgpu_atpx_pci_probe_handle(struct pci_dev *pdev) |
| 482 | { | 487 | { |
| 488 | struct pci_dev *parent_pdev = pci_upstream_bridge(pdev); | ||
| 483 | acpi_handle dhandle, atpx_handle; | 489 | acpi_handle dhandle, atpx_handle; |
| 484 | acpi_status status; | 490 | acpi_status status; |
| 485 | 491 | ||
| @@ -494,6 +500,7 @@ static bool amdgpu_atpx_pci_probe_handle(struct pci_dev *pdev) | |||
| 494 | } | 500 | } |
| 495 | amdgpu_atpx_priv.dhandle = dhandle; | 501 | amdgpu_atpx_priv.dhandle = dhandle; |
| 496 | amdgpu_atpx_priv.atpx.handle = atpx_handle; | 502 | amdgpu_atpx_priv.atpx.handle = atpx_handle; |
| 503 | amdgpu_atpx_priv.bridge_pm_usable = parent_pdev && parent_pdev->bridge_d3; | ||
| 497 | return true; | 504 | return true; |
| 498 | } | 505 | } |
| 499 | 506 | ||
