diff options
author | Dave Airlie <airlied@redhat.com> | 2016-09-28 11:27:05 +1000 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2016-09-28 11:27:05 +1000 |
commit | 9f4ef05bcdcfdf911b056b471dd3c6a4f331b644 (patch) | |
tree | ba8dfba87b4fe5295598f5438881822b6d3395f0 /drivers/gpu/drm/radeon | |
parent | 81c5d6aa3983662b6b48b504fe3a0a4c640f6a84 (diff) | |
parent | beb86f29c9c7f2d04f9a42c4c61cc469c3689779 (diff) | |
download | linux-9f4ef05bcdcfdf911b056b471dd3c6a4f331b644.tar.bz2 |
Merge branch 'drm-next-4.9' of git://people.freedesktop.org/~agd5f/linux into drm-next
Last set of radeon and amdgpu changes for 4.9. This is
mostly just the powerplay cleanup for dGPUs. Beyond that,
just misc code cleanups and bug fixes.
* 'drm-next-4.9' of git://people.freedesktop.org/~agd5f/linux: (49 commits)
drm/amd/amdgpu: Clean up afmt allocation in DCEv6. (v2)
drm/amd/amdgpu: Remove division from vblank_wait
drm/radeon/atif: Send a hotplug event when we get dgpu display request
drm/radeon/atpx: check for ATIF dGPU wake for display events support
drm/amdgpu/atif: Send a hotplug event when we get dgpu display request
drm/amdgpu/atpx: check for ATIF dGPU wake for display events support
drm/amdgpu: bump version for new vce packet support
drm/amdgpu/vce: allow the clock table packet
drm/amdgpu:cleanup virt related define
drm/amdgpu: use powerplay module for dgpu in Vi.
drm/amdgpu: set gfx clock gating for tonga/polaris.
drm/amdgpu: set system clock gating for tonga/polaris.
drm/amd/powerplay: export function to help to set cg by smu.
drm/amdgpu: avoid out of bounds access on array interrupt_status_offsets
drm/amdgpu: mark symbols static where possible
drm/amdgpu: remove unused functions
drm/amd/powerplay: Replace per-asic print_performance with generic
drm/radeon: narrow asic_init for virtualization
drm/amdgpu:add fw version entry to info
drm/amdgpu:determine if vPost is needed indeed
...
Diffstat (limited to 'drivers/gpu/drm/radeon')
-rw-r--r-- | drivers/gpu/drm/radeon/radeon_acpi.c | 17 | ||||
-rw-r--r-- | drivers/gpu/drm/radeon/radeon_atpx_handler.c | 5 | ||||
-rw-r--r-- | drivers/gpu/drm/radeon/radeon_device.c | 11 |
3 files changed, 27 insertions, 6 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_acpi.c b/drivers/gpu/drm/radeon/radeon_acpi.c index 31c9a92d6a1b..6efbd65c929e 100644 --- a/drivers/gpu/drm/radeon/radeon_acpi.c +++ b/drivers/gpu/drm/radeon/radeon_acpi.c @@ -25,6 +25,7 @@ #include <linux/acpi.h> #include <linux/slab.h> #include <linux/power_supply.h> +#include <linux/pm_runtime.h> #include <acpi/video.h> #include <drm/drmP.h> #include <drm/drm_crtc_helper.h> @@ -32,6 +33,12 @@ #include "radeon_acpi.h" #include "atom.h" +#if defined(CONFIG_VGA_SWITCHEROO) +bool radeon_atpx_dgpu_req_power_for_displays(void); +#else +static inline bool radeon_atpx_dgpu_req_power_for_displays(void) { return false; } +#endif + #define ACPI_AC_CLASS "ac_adapter" extern void radeon_pm_acpi_event_handler(struct radeon_device *rdev); @@ -394,6 +401,16 @@ int radeon_atif_handler(struct radeon_device *rdev, #endif } } + if (req.pending & ATIF_DGPU_DISPLAY_EVENT) { + if ((rdev->flags & RADEON_IS_PX) && + radeon_atpx_dgpu_req_power_for_displays()) { + pm_runtime_get_sync(rdev->ddev->dev); + /* Just fire off a uevent and let userspace tell us what to do */ + drm_helper_hpd_irq_event(rdev->ddev); + pm_runtime_mark_last_busy(rdev->ddev->dev); + pm_runtime_put_autosuspend(rdev->ddev->dev); + } + } /* TODO: check other events */ /* We've handled the event, stop the notifier chain. The ACPI interface diff --git a/drivers/gpu/drm/radeon/radeon_atpx_handler.c b/drivers/gpu/drm/radeon/radeon_atpx_handler.c index 6de342861202..a1321b2fa454 100644 --- a/drivers/gpu/drm/radeon/radeon_atpx_handler.c +++ b/drivers/gpu/drm/radeon/radeon_atpx_handler.c @@ -29,6 +29,7 @@ struct radeon_atpx { acpi_handle handle; struct radeon_atpx_functions functions; bool is_hybrid; + bool dgpu_req_power_for_displays; }; static struct radeon_atpx_priv { @@ -72,6 +73,10 @@ bool radeon_is_atpx_hybrid(void) { return radeon_atpx_priv.atpx.is_hybrid; } +bool radeon_atpx_dgpu_req_power_for_displays(void) { + return radeon_atpx_priv.atpx.dgpu_req_power_for_displays; +} + /** * radeon_atpx_call - call an ATPX method * diff --git a/drivers/gpu/drm/radeon/radeon_device.c b/drivers/gpu/drm/radeon/radeon_device.c index b423c0159581..eb92aef46e3c 100644 --- a/drivers/gpu/drm/radeon/radeon_device.c +++ b/drivers/gpu/drm/radeon/radeon_device.c @@ -661,8 +661,9 @@ bool radeon_card_posted(struct radeon_device *rdev) { uint32_t reg; - /* for pass through, always force asic_init */ - if (radeon_device_is_virtual()) + /* for pass through, always force asic_init for CI */ + if (rdev->family >= CHIP_BONAIRE && + radeon_device_is_virtual()) return false; /* required for EFI mode on macbook2,1 which uses an r5xx asic */ @@ -1594,8 +1595,7 @@ int radeon_suspend_kms(struct drm_device *dev, bool suspend, rdev = dev->dev_private; - if (dev->switch_power_state == DRM_SWITCH_POWER_OFF || - dev->switch_power_state == DRM_SWITCH_POWER_DYNAMIC_OFF) + if (dev->switch_power_state == DRM_SWITCH_POWER_OFF) return 0; drm_kms_helper_poll_disable(dev); @@ -1690,8 +1690,7 @@ int radeon_resume_kms(struct drm_device *dev, bool resume, bool fbcon) struct drm_crtc *crtc; int r; - if (dev->switch_power_state == DRM_SWITCH_POWER_OFF || - dev->switch_power_state == DRM_SWITCH_POWER_DYNAMIC_OFF) + if (dev->switch_power_state == DRM_SWITCH_POWER_OFF) return 0; if (fbcon) { |