Skip to content
Snippets Groups Projects
  1. Oct 16, 2023
  2. Sep 18, 2023
  3. Sep 06, 2023
  4. Aug 04, 2023
  5. Aug 03, 2023
  6. Jul 21, 2023
  7. Jun 27, 2023
  8. Jun 22, 2023
    • Adrián Larumbe's avatar
      drm: bridge: dw_hdmi: fix connector access for scdc · 98703e4e
      Adrián Larumbe authored
      
      Commit 5d844091 ("drm/scdc-helper: Pimp SCDC debugs") changed the scdc
      interface to pick up an i2c adapter from a connector instead. However, in
      the case of dw-hdmi, the wrong connector was being used to pass i2c adapter
      information, since dw-hdmi's embedded connector structure is only populated
      when the bridge attachment callback explicitly asks for it.
      
      drm-meson is handling connector creation, so this won't happen, leading to
      a NULL pointer dereference.
      
      Fix it by having scdc functions access dw-hdmi's current connector pointer
      instead, which is assigned during the bridge enablement stage.
      
      Fixes: 5d844091 ("drm/scdc-helper: Pimp SCDC debugs")
      Signed-off-by: default avatarAdrián Larumbe <adrian.larumbe@collabora.com>
      Reported-by: default avatarLukas F. Hartmann <lukas@mntre.com>
      Acked-by: default avatarNeil Armstrong <neil.armstrong@linaro.org>
      [narmstrong: moved Fixes tag before first S-o-b and added Reported-by tag]
      Signed-off-by: default avatarNeil Armstrong <neil.armstrong@linaro.org>
      Link: https://patchwork.freedesktop.org/patch/msgid/20230601123153.196867-1-adrian.larumbe@collabora.com
      98703e4e
    • Ondrej Jirman's avatar
      drm: bridge: dw-mipi-dsi: Fix enable/disable of DSI controller · 05aa6133
      Ondrej Jirman authored
      
      Before this patch, booting to Linux VT and doing a simple:
      
        echo 2 > /sys/class/graphics/fb0/blank
        echo 0 > /sys/class/graphics/fb0/blank
      
      would result in failures to re-enable the panel. Mode set callback is
      called only once during boot in this scenario, while calls to
      enable/disable callbacks are balanced afterwards. The driver doesn't
      work unless userspace calls modeset before enabling the CRTC/connector.
      
      This patch moves enabling of the DSI host from mode_set into pre_enable
      callback, and removes some old hacks where this bridge driver is
      directly calling into other bridge driver's callbacks.
      
      pre_enable_prev_first flag is set on the panel's bridge so that panel
      drivers will get their prepare function called between DSI host's
      pre_enable and enable callbacks, so that they get a chance to
      perform panel setup while DSI host is already enabled in command
      mode. Otherwise panel's prepare would be called before DSI host
      is enabled, and any DSI communication used in prepare callback
      would fail.
      
      With all these changes, the enable/disable sequence is now well
      balanced, and host's and panel's callbacks are called in proper order
      documented in the drm_panel API documentation without needing the old
      hacks. (Mainly that panel->prepare is called when DSI host is ready to
      allow the panel driver to send DSI commands and vice versa during
      disable.)
      
      Tested on Pinephone Pro. Trace of the callbacks follows.
      
      Before:
      
      [    1.253882] dw-mipi-dsi-rockchip ff960000.dsi: mode_set
      [    1.290732] panel-himax-hx8394 ff960000.dsi.0: prepare
      [    1.475576] dw-mipi-dsi-rockchip ff960000.dsi: enable
      [    1.475593] panel-himax-hx8394 ff960000.dsi.0: enable
      
      echo 2 > /sys/class/graphics/fb0/blank
      
      [   13.722799] panel-himax-hx8394 ff960000.dsi.0: disable
      [   13.774502] dw-mipi-dsi-rockchip ff960000.dsi: post_disable
      [   13.774526] panel-himax-hx8394 ff960000.dsi.0: unprepare
      
      echo 0 > /sys/class/graphics/fb0/blank
      
      [   17.735796] panel-himax-hx8394 ff960000.dsi.0: prepare
      [   17.923522] dw-mipi-dsi-rockchip ff960000.dsi: enable
      [   17.923540] panel-himax-hx8394 ff960000.dsi.0: enable
      [   17.944330] dw-mipi-dsi-rockchip ff960000.dsi: failed to write command FIFO
      [   17.944335] panel-himax-hx8394 ff960000.dsi.0: sending command 0xb9 failed: -110
      [   17.944340] panel-himax-hx8394 ff960000.dsi.0: Panel init sequence failed: -110
      
      echo 2 > /sys/class/graphics/fb0/blank
      
      [  431.148583] panel-himax-hx8394 ff960000.dsi.0: disable
      [  431.169259] dw-mipi-dsi-rockchip ff960000.dsi: failed to write command FIFO
      [  431.169268] panel-himax-hx8394 ff960000.dsi.0: Failed to enter sleep mode: -110
      [  431.169282] dw-mipi-dsi-rockchip ff960000.dsi: post_disable
      [  431.169316] panel-himax-hx8394 ff960000.dsi.0: unprepare
      [  431.169357] pclk_mipi_dsi0 already disabled
      
      echo 0 > /sys/class/graphics/fb0/blank
      
      [  432.796851] panel-himax-hx8394 ff960000.dsi.0: prepare
      [  432.981537] dw-mipi-dsi-rockchip ff960000.dsi: enable
      [  432.981568] panel-himax-hx8394 ff960000.dsi.0: enable
      [  433.002290] dw-mipi-dsi-rockchip ff960000.dsi: failed to write command FIFO
      [  433.002299] panel-himax-hx8394 ff960000.dsi.0: sending command 0xb9 failed: -110
      [  433.002312] panel-himax-hx8394 ff960000.dsi.0: Panel init sequence failed: -110
      
      -----------------------------------------------------------------------
      
      After:
      
      [    1.248372] dw-mipi-dsi-rockchip ff960000.dsi: mode_set
      [    1.248704] dw-mipi-dsi-rockchip ff960000.dsi: pre_enable
      [    1.285377] panel-himax-hx8394 ff960000.dsi.0: prepare
      [    1.468392] dw-mipi-dsi-rockchip ff960000.dsi: enable
      [    1.468421] panel-himax-hx8394 ff960000.dsi.0: enable
      
      echo 2 > /sys/class/graphics/fb0/blank
      
      [   16.210357] panel-himax-hx8394 ff960000.dsi.0: disable
      [   16.261315] dw-mipi-dsi-rockchip ff960000.dsi: post_disable
      [   16.261339] panel-himax-hx8394 ff960000.dsi.0: unprepare
      
      echo 0 > /sys/class/graphics/fb0/blank
      
      [   19.161453] dw-mipi-dsi-rockchip ff960000.dsi: pre_enable
      [   19.197869] panel-himax-hx8394 ff960000.dsi.0: prepare
      [   19.382141] dw-mipi-dsi-rockchip ff960000.dsi: enable
      [   19.382158] panel-himax-hx8394 ff960000.dsi.0: enable
      
             (But depends on functionality intorduced in Linux 6.3, so this patch will
              not build on older kernels when applied to older stable branches.)
      
      Fixes: 46fc5154 ("drm/bridge/synopsys: Add MIPI DSI host controller bridge")
      Signed-off-by: default avatarOndrej Jirman <megi@xff.cz>
      Reviewed-by: default avatarSam Ravnborg <sam@ravnborg.org>
      Signed-off-by: default avatarRobert Foss <rfoss@kernel.org>
      Link: https://patchwork.freedesktop.org/patch/msgid/20230617224915.1923630-1-megi@xff.cz
      05aa6133
  9. May 23, 2023
  10. Apr 05, 2023
  11. Mar 20, 2023
  12. Jan 20, 2023
  13. Dec 01, 2022
  14. Sep 20, 2022
  15. Aug 29, 2022
  16. Jul 05, 2022
  17. Jun 13, 2022
  18. Apr 25, 2022
  19. Apr 22, 2022
  20. Apr 19, 2022
  21. Mar 31, 2022
  22. Mar 14, 2022
    • Ville Syrjälä's avatar
      drm/bridge: Use drm_mode_copy() · d008bc33
      Ville Syrjälä authored
      
      struct drm_display_mode embeds a list head, so overwriting
      the full struct with another one will corrupt the list
      (if the destination mode is on a list). Use drm_mode_copy()
      instead which explicitly preserves the list head of
      the destination mode.
      
      Even if we know the destination mode is not on any list
      using drm_mode_copy() seems decent as it sets a good
      example. Bad examples of not using it might eventually
      get copied into code where preserving the list head
      actually matters.
      
      Obviously one case not covered here is when the mode
      itself is embedded in a larger structure and the whole
      structure is copied. But if we are careful when copying
      into modes embedded in structures I think we can be a
      little more reassured that bogus list heads haven't been
      propagated in.
      
      @is_mode_copy@
      @@
      drm_mode_copy(...)
      {
      ...
      }
      
      @depends on !is_mode_copy@
      struct drm_display_mode *mode;
      expression E, S;
      @@
      (
      - *mode = E
      + drm_mode_copy(mode, &E)
      |
      - memcpy(mode, E, S)
      + drm_mode_copy(mode, E)
      )
      
      @depends on !is_mode_copy@
      struct drm_display_mode mode;
      expression E;
      @@
      (
      - mode = E
      + drm_mode_copy(&mode, &E)
      |
      - memcpy(&mode, E, S)
      + drm_mode_copy(&mode, E)
      )
      
      @@
      struct drm_display_mode *mode;
      @@
      - &*mode
      + mode
      
      Cc: Andrzej Hajda <andrzej.hajda@intel.com>
      Cc: Neil Armstrong <narmstrong@baylibre.com>
      Cc: Robert Foss <robert.foss@linaro.org>
      Cc: Laurent Pinchart <Laurent.pinchart@ideasonboard.com>
      Cc: Jonas Karlman <jonas@kwiboo.se>
      Cc: Jernej Skrabec <jernej.skrabec@gmail.com>
      Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20220218100403.7028-7-ville.syrjala@linux.intel.com
      
      
      Reviewed-by: default avatarAndrzej Hajda <andrzej.hajda@intel.com>
      Reviewed-by: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
      d008bc33
  23. Feb 10, 2022
  24. Jan 25, 2022
  25. Jan 13, 2022
  26. Jan 05, 2022
  27. Jan 04, 2022
  28. Nov 12, 2021
  29. Oct 15, 2021
Loading