1. 25 Mar, 2023 3 commits
    • Laurent Pinchart's avatar
      drm: rcar-du: lvds: Fix LVDS PLL disable on D3/E3 · ec1c6ff8
      Laurent Pinchart authored
      On R-Car D3 and E3, the LVDS encoder provides the dot (pixel) clock to
      the DU, regardless of whether the LVDS output is used or not. When using
      the DPAD (RGB) output, the DU driver thus enables and disables the LVDS
      PLL manually, while when using the LVDS output, it lets the LVDS bridge
      driver handle the PLL configuration internally as part of the atomic
      enable and disable operations.
      
      This causes an issue when using the LVDS output. As bridges are disabled
      before CRTCs, the current implementation violates the enable/disable
      sequences documented in the hardware datasheet, which requires the dot
      clock to be enabled before the CRTC is started and disabled after it
      gets stopped.
      
      Fix the problem by enabling/disabling the LVDS PLL manually from the DU
      regardless of which output is used, and skipping the PLL handling in the
      LVDS bridge atomic enable and disable operations.
      
      This is however not enough. Disabling the LVDS encoder while leaving the
      PLL on still results in a vertical blanking wait timeout when disabling
      the DU. Investigation showed that the culprit is the LVEN bit. For an
      unclear reason, clearing the bit when disabling the LVDS encoder blocks
      vertical blanking interrupts. We thus have to delay disabling the whole
      LVDS encoder, not just disabling the PLL, until the DU is disabled.
      
      We could split the LVDS disable sequence by clearing the LVRES bit in
      the LVDS bridge atomic disable handler, and delaying the rest of the
      operations, in order to disable the LVDS output at bridge atomic disable
      time, before stopping the CRTC. This would make the code more complex,
      without a clear benefit, so keep the implementation simple(r).
      Signed-off-by: default avatarLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
      Reviewed-by: default avatarTomi Valkeinen <tomi.valkeinen+renesas@ideasonboard.com>
      ec1c6ff8
    • Laurent Pinchart's avatar
      drm: rcar-du: lvds: Move LVDS enable code to separate code section · 650e7881
      Laurent Pinchart authored
      To prepare for a rework of the LVDS disable code, which will need to be
      called from rcar_lvds_pclk_disable(), move the LVDS enable code,
      currently stored in the __rcar_lvds_atomic_enable() function, to a
      separate code section separate from bridge operations. It will be then
      extended with the LVDS disable code.
      
      As part of this rework the __rcar_lvds_atomic_enable() function is
      renamed to rcar_lvds_enable() to more clearly indicate its purpose.
      
      No functional change intended.
      Signed-off-by: default avatarLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
      Reviewed-by: default avatarGeert Uytterhoeven <geert+renesas@glider.be>
      Reviewed-by: default avatarTomi Valkeinen <tomi.valkeinen+renesas@ideasonboard.com>
      650e7881
    • Laurent Pinchart's avatar
      drm: rcar-du: lvds: Call function directly instead of through pointer · c95e2ad9
      Laurent Pinchart authored
      When disabling the companion bridge in rcar_lvds_atomic_disable(),
      there's no need to go through the bridge's operations to call
      .atomic_disable(). Call rcar_lvds_atomic_disable() on the companion
      directly.
      Signed-off-by: default avatarLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
      Reviewed-by: default avatarTomi Valkeinen <tomi.valkeinen+renesas@ideasonboard.com>
      c95e2ad9
  2. 24 Mar, 2023 2 commits
  3. 23 Mar, 2023 6 commits
  4. 22 Mar, 2023 29 commits