• Karthik B S's avatar
    drm/i915: Add enable/disable flip done and flip done handler · 1288f9b0
    Karthik B S authored
    Add enable/disable flip done functions and the flip done handler
    function which handles the flip done interrupt.
    
    Enable the flip done interrupt in IER.
    
    Enable flip done function is called before writing the
    surface address register as the write to this register triggers
    the flip done interrupt
    
    Flip done handler is used to send the page flip event as soon as the
    surface address is written as per the requirement of async flips.
    The interrupt is disabled after the event is sent.
    
    v2: -Change function name from icl_* to skl_* (Paulo)
        -Move flip handler to this patch (Paulo)
        -Remove vblank_put() (Paulo)
        -Enable flip done interrupt for gen9+ only (Paulo)
        -Enable flip done interrupt in power_well_post_enable hook (Paulo)
        -Removed the event check in flip done handler to handle async
         flips without pageflip events.
    
    v3: -Move skl_disable_flip_done out of interrupt handler (Paulo)
        -Make the pending vblank event NULL in the beginning of
         flip_done_handler to remove sporadic WARN_ON that is seen.
    
    v4: -Calculate timestamps using flip done time stamp and current
         timestamp for async flips (Ville)
    
    v5: -Fix the sparse warning by making the function 'g4x_get_flip_counter'
         static.(Reported-by: kernel test robot <lkp@intel.com>)
        -Fix the typo in commit message.
    
    v6: -Revert back to old time stamping code.
        -Remove the break while calling skl_enable_flip_done. (Paulo)
    
    v7: -Rebased.
    
    v8: -Rebased.
    
    v9: -Use struct drm_i915_private *i915 in new code. (Ville)
        -Use intel_crtc instead of drm_crtc. (Ville)
        -Do not mix the flip done and vblank hooks. (Ville)
    
    v10: -Rebased.
    Signed-off-by: default avatarKarthik B S <karthik.b.s@intel.com>
    Signed-off-by: default avatarVandita Kulkarni <vandita.kulkarni@intel.com>
    Reviewed-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
    Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
    Link: https://patchwork.freedesktop.org/patch/msgid/20200921110210.21182-2-karthik.b.s@intel.com
    1288f9b0
i915_irq.c 117 KB