Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

+11
+11
drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c
··· 25 25 #include <linux/acpi.h> 26 26 #include <linux/slab.h> 27 27 #include <linux/power_supply.h> 28 + #include <linux/pm_runtime.h> 28 29 #include <acpi/video.h> 29 30 #include <drm/drmP.h> 30 31 #include <drm/drm_crtc_helper.h> ··· 332 331 backlight_force_update(dig->bl_dev, 333 332 BACKLIGHT_UPDATE_HOTKEY); 334 333 #endif 334 + } 335 + } 336 + if (req.pending & ATIF_DGPU_DISPLAY_EVENT) { 337 + if ((adev->flags & AMD_IS_PX) && 338 + amdgpu_atpx_dgpu_req_power_for_displays()) { 339 + pm_runtime_get_sync(adev->ddev->dev); 340 + /* Just fire off a uevent and let userspace tell us what to do */ 341 + drm_helper_hpd_irq_event(adev->ddev); 342 + pm_runtime_mark_last_busy(adev->ddev->dev); 343 + pm_runtime_put_autosuspend(adev->ddev->dev); 335 344 } 336 345 } 337 346 /* TODO: check other events */