• Enric Balletbo i Serra's avatar
    drm/bridge: ps8640: Rework power state handling · 46f20630
    Enric Balletbo i Serra authored
    The get_edid() callback can be triggered anytime by an ioctl, i.e
    
      drm_mode_getconnector (ioctl)
        -> drm_helper_probe_single_connector_modes
           -> drm_bridge_connector_get_modes
              -> ps8640_bridge_get_edid
    
    Actually if the bridge pre_enable() function was not called before
    get_edid(), the driver will not be able to get the EDID properly and
    display will not work until a second get_edid() call is issued and if
    pre_enable() is called before. The side effect of this, for example, is
    that you see anything when `Frecon` starts, neither the splash screen,
    until the graphical session manager starts.
    
    To fix this we need to make sure that all we need is enabled before
    reading the EDID. This means the following:
    
    1. If get_edid() is called before having the device powered we need to
       power on the device. In such case, the driver will power off again the
       device.
    
    2. If get_edid() is called after having the device powered, all should
       just work. We added a powered flag in order to avoid recurrent calls
       to ps8640_bridge_poweron() and unneeded delays.
    
    3. This seems to be specific for this device, but we need to make sure
       the panel is powered on before do a power on cycle on this device.
       Otherwise the device fails to retrieve the EDID.
    Signed-off-by: default avatarEnric Balletbo i Serra <enric.balletbo@collabora.com>
    Tested-by: default avatarBilal Wasim <bwasim.lkml@gmail.com>
    Acked-by: default avatarNeil Armstrong <narmstrong@baylibre.com>
    Signed-off-by: default avatarNeil Armstrong <narmstrong@baylibre.com>
    Link: https://patchwork.freedesktop.org/patch/msgid/20200827085911.944899-2-enric.balletbo@collabora.com
    46f20630
parade-ps8640.c 10.1 KB