• Lyude Paul's avatar
    drm/amdgpu: Dynamically probe for ATIF handle (v2) · f9ff6852
    Lyude Paul authored
    The other day I was testing one of the HP laptops at my office with an
    i915/amdgpu hybrid setup and noticed that hotplugging was non-functional
    on almost all of the display outputs. I eventually discovered that all
    of the external outputs were connected to the amdgpu device instead of
    i915, and that the hotplugs weren't being detected so long as the GPU
    was in runtime suspend. After some talking with folks at AMD, I learned
    that amdgpu is actually supposed to support hotplug detection in runtime
    suspend so long as the OEM has implemented it properly in the firmware.
    
    On this HP ZBook 15 G4 (the machine in question), amdgpu wasn't managing
    to find the ATIF handle at all despite the fact that I could see acpi
    events being sent in response to any hotplugging. After going through
    dumps of the firmware, I discovered that this machine did in fact
    support ATIF, but that it's ATIF method lived in an entirely different
    namespace than this device's handle (the device handle was
    \_SB_.PCI0.PEG0.PEGP, but ATIF lives in ATPX's handle at
    \_SB_.PCI0.GFX0).
    
    So, fix this by probing ATPX's ACPI parent's namespace if we can't find
    ATIF elsewhere, along with storing a pointer to the proper handle to use
    for ATIF and using that instead of the device's handle.
    
    This fixes HPD detection while in runtime suspend for this ZBook!
    
    v2: Update the comment to reflect how the namespaces are arranged
    based on the system configuration. (Alex)
    Signed-off-by: default avatarLyude Paul <lyude@redhat.com>
    Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
    Cc: stable@vger.kernel.org
    f9ff6852
amdgpu_acpi.c 21.7 KB