• Nicholas Kazlauskas's avatar
    drm/amd/display: Allow for vblank enabled with no active planes · 8fe684e9
    Nicholas Kazlauskas authored
    [Why]
    CRC capture doesn't work when the active plane count is 0 since we
    currently tie both vblank and pageflip interrupts to active_plane_count
    greater than 0.
    
    [How]
    The frontend is what generates the vblank interrupts while the backend
    is what generates pageflip interrupts. Both have a requirement for
    the CRTC to be active, so control the overall interrupt state based
    on that instead.
    
    Pageflip interrupts need to be enabled based on active plane count, but
    we actually rely on power gating to take care of disabling the interrupt
    for us on pipes that can be power gated.
    
    For pipes that can't be power gated it's still fine to leave it enabled
    since the interrupt only triggers after the address has been written
    to that particular pipe - which we won't be doing without an active
    plane.
    
    The issue we had before with this setup was that we couldn't force
    the state back on. We were essentially manipulating the refcount
    to enable or disable as needed in a two pass approach.
    
    However, there is a function that solves this problem more elegantly:
    amdgpu_irq_update() will unconditionally call the set based on what it
    thinks the current enablement state is.
    
    This leaves two future TODO items for our IRQ handling:
    - Disabling IRQs in commit tail instead of atomic commit
    - Mapping the pageflip interrupt to VUPDATE or something that's tied to
      the frontend instead of the backend since the mapping to CRTC is not
      correct
    Signed-off-by: default avatarNicholas Kazlauskas <nicholas.kazlauskas@amd.com>
    Reviewed-by: default avatarBhawanpreet Lakha <Bhawanpreet.Lakha@amd.com>
    Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
    8fe684e9
amdgpu_dm.c 251 KB