aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorAlex Deucher <alexander.deucher@amd.com>2016-09-14 14:15:34 -0400
committerAlex Deucher <alexander.deucher@amd.com>2016-09-22 10:30:58 -0400
commit735598477f386d05af018e8708aa9e71f1ae163e (patch)
tree2d37de58f3d81a7b023f334f5183a4a3a550d56c /drivers
parent4777166989dee66a5050ce77d0ea37832ed330d7 (diff)
drm/radeon/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')
-rw-r--r--drivers/gpu/drm/radeon/radeon_acpi.c17
1 files changed, 17 insertions, 0 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 @@
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>
@@ -32,6 +33,12 @@
32#include "radeon_acpi.h" 33#include "radeon_acpi.h"
33#include "atom.h" 34#include "atom.h"
34 35
36#if defined(CONFIG_VGA_SWITCHEROO)
37bool radeon_atpx_dgpu_req_power_for_displays(void);
38#else
39static inline bool radeon_atpx_dgpu_req_power_for_displays(void) { return false; }
40#endif
41
35#define ACPI_AC_CLASS "ac_adapter" 42#define ACPI_AC_CLASS "ac_adapter"
36 43
37extern void radeon_pm_acpi_event_handler(struct radeon_device *rdev); 44extern void radeon_pm_acpi_event_handler(struct radeon_device *rdev);
@@ -394,6 +401,16 @@ int radeon_atif_handler(struct radeon_device *rdev,
394#endif 401#endif
395 } 402 }
396 } 403 }
404 if (req.pending & ATIF_DGPU_DISPLAY_EVENT) {
405 if ((rdev->flags & RADEON_IS_PX) &&
406 radeon_atpx_dgpu_req_power_for_displays()) {
407 pm_runtime_get_sync(rdev->ddev->dev);
408 /* Just fire off a uevent and let userspace tell us what to do */
409 drm_helper_hpd_irq_event(rdev->ddev);
410 pm_runtime_mark_last_busy(rdev->ddev->dev);
411 pm_runtime_put_autosuspend(rdev->ddev->dev);
412 }
413 }
397 /* TODO: check other events */ 414 /* TODO: check other events */
398 415
399 /* We've handled the event, stop the notifier chain. The ACPI interface 416 /* We've handled the event, stop the notifier chain. The ACPI interface