• Nicholas Kazlauskas's avatar
    drm/amd/display: Use vblank control events for PSR enable/disable · 58aa1c50
    Nicholas Kazlauskas authored
    [Why]
    PSR can disable the HUBP along with the OTG when PSR is active.
    
    We'll hit a pageflip timeout when the OTG is disable because we're no
    longer updating the CRTC vblank counter and the pflip high IRQ will
    not fire on the flip.
    
    In order to flip the page flip timeout occur we should modify the
    enter/exit conditions to match DRM requirements.
    
    [How]
    Use our deferred handlers for DRM vblank control to notify DMCU(B)
    when it can enable or disable PSR based on whether vblank is disabled or
    enabled respectively.
    
    We'll need to pass along the stream with the notification now because
    we want to access the CRTC state while the CRTC is locked to get the
    stream state prior to the commit.
    
    Retain a reference to the stream so it remains safe to continue to
    access and release that reference once we're done with it.
    
    Enable/disable logic follows what we were previously doing in
    update_planes.
    
    The workqueue has to be flushed before programming streams or planes
    to ensure that we exit out of idle optimizations and PSR before
    these events occur if necessary.
    
    To keep the skip count logic the same to avoid FBCON PSR enablement
    requires copying the allow condition onto the DM IRQ parameters - a
    field that we can actually access from the worker.
    Reviewed-by: default avatarRoman Li <Roman.Li@amd.com>
    Acked-by: default avatarWayne Lin <wayne.lin@amd.com>
    Signed-off-by: default avatarNicholas Kazlauskas <nicholas.kazlauskas@amd.com>
    Tested-by: default avatarDaniel Wheeler <daniel.wheeler@amd.com>
    Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
    58aa1c50
amdgpu_dm.h 16 KB