• Archit Taneja's avatar
    drm/msm/mdp5: Use runtime PM get/put API instead of toggling clocks · d68fe15b
    Archit Taneja authored
    mdp5_enable/disable calls are scattered all around in the MDP5 code.
    Use the pm_runtime_get/put calls here instead, and populate the
    runtime PM suspend/resume ops to manage the clocks.
    
    About the overall design: MDP5 is a child of the top level MDSS
    device. MDSS is also the parent to DSI, HDMI and other interfaces. When
    we enable MDP5's power domain, we end up enabling MDSS's PD too. It is
    only MDSS's PD that actually controlls the GDSC HW. Therefore, calling
    runtime_get/put on the MDP5 device is like just requesting a vote to
    enable/disable the GDSC.
    
    Functionally, replacing the clock enable/disable calls with the RPM API
    can result in the power domain (GDSC) state being toggled if no other
    child isn't powered on. This can result in the register context being lost.
    We make sure (in future commits) that code paths don't end up configuring
    registers and then later lose state, resulting in a bad HW state.
    
    For now, we've replaced each mdp5_enable/disable with runtime_get/put API.
    We could optimize things later by removing runtime_get/put calls which
    don't really need to be there. This could prevent unnecessary toggling of
    the power domain and clocks.
    Signed-off-by: default avatarArchit Taneja <architt@codeaurora.org>
    Signed-off-by: default avatarRob Clark <robdclark@gmail.com>
    d68fe15b
mdp5_irq.c 3.85 KB