aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c
diff options
context:
space:
mode:
authorAlex Deucher <alexander.deucher@amd.com>2016-09-14 14:04:29 -0400
committerAlex Deucher <alexander.deucher@amd.com>2016-09-22 10:30:36 -0400
commit1b0f568d24cb7d750e99c48a6dab6e3246507fef (patch)
tree9d572f429eef29c09ca7fa3b276cdfedbcaf84c8 /drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c
parentefc83cf423df99bd6c1899cf0b65897f1ee75751 (diff)
drm/amdgpu/atif: Send a hotplug event when we get dgpu display request
On PX systems, if the platform supports hotplug events ATIF while the dGPU is powered down, handle the event and alert userspace. Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c
index 5cd7b736a9de..5796539a0bcb 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c
@@ -25,6 +25,7 @@
25#include <linux/acpi.h> 25#include <linux/acpi.h>
26#include <linux/slab.h> 26#include <linux/slab.h>
27#include <linux/power_supply.h> 27#include <linux/power_supply.h>
28#include <linux/pm_runtime.h>
28#include <acpi/video.h> 29#include <acpi/video.h>
29#include <drm/drmP.h> 30#include <drm/drmP.h>
30#include <drm/drm_crtc_helper.h> 31#include <drm/drm_crtc_helper.h>
@@ -333,6 +334,16 @@ int amdgpu_atif_handler(struct amdgpu_device *adev,
333#endif 334#endif
334 } 335 }
335 } 336 }
337 if (req.pending & ATIF_DGPU_DISPLAY_EVENT) {
338 if ((adev->flags & AMD_IS_PX) &&
339 amdgpu_atpx_dgpu_req_power_for_displays()) {
340 pm_runtime_get_sync(adev->ddev->dev);
341 /* Just fire off a uevent and let userspace tell us what to do */
342 drm_helper_hpd_irq_event(adev->ddev);
343 pm_runtime_mark_last_busy(adev->ddev->dev);
344 pm_runtime_put_autosuspend(adev->ddev->dev);
345 }
346 }
336 /* TODO: check other events */ 347 /* TODO: check other events */
337 348
338 /* We've handled the event, stop the notifier chain. The ACPI interface 349 /* We've handled the event, stop the notifier chain. The ACPI interface