Skip to content
Snippets Groups Projects
  1. Aug 29, 2022
  2. Jul 05, 2022
  3. Apr 25, 2022
  4. Apr 22, 2022
  5. Apr 19, 2022
  6. Mar 31, 2022
  7. 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
  8. Feb 10, 2022
  9. Jan 25, 2022
  10. Jan 13, 2022
  11. Jan 05, 2022
  12. Jan 04, 2022
  13. Nov 12, 2021
  14. Oct 15, 2021
  15. Oct 06, 2021
  16. Jul 28, 2021
  17. Jul 27, 2021
  18. May 07, 2021
  19. Apr 20, 2021
  20. Jan 05, 2021
  21. Nov 12, 2020
  22. Oct 05, 2020
  23. Sep 11, 2020
  24. Sep 08, 2020
  25. Sep 07, 2020
  26. Aug 23, 2020
  27. Jul 10, 2020
    • Liu Ying's avatar
      drm/bridge: dw-hdmi: Always add the bridge in the global bridge list · 0bf4f5b5
      Liu Ying authored
      
      It doesn't hurt to add the bridge in the global bridge list also for
      platform specific dw-hdmi drivers which are based on the component
      framework.  This can be achieved by moving the drm_bridge_add() function
      call from dw_hdmi_probe() to __dw_hdmi_probe().  A counterpart movement
      for drm_bridge_remove() is also needed then.  Moreover, since drm_bridge_add()
      initializes &bridge->hpd_mutex, this may help those platform specific
      dw-hdmi drivers(based on the component framework) avoid accessing the
      uninitialized mutex in drm_bridge_hpd_notify() which is called in
      dw_hdmi_irq().  Putting drm_bridge_add() in __dw_hdmi_probe() just before
      it returns successfully should bring no logic change for platforms based
      on the DRM bridge API, which is a good choice from safety point of view.
      Also, __dw_hdmi_probe() is renamed to dw_hdmi_probe() since dw_hdmi_probe()
      does nothing else but calling __dw_hdmi_probe().  Similar renaming applies
      to the __dw_hdmi_remove()/dw_hdmi_remove() pair.
      
      Fixes: ec971aaa ("drm: bridge: dw-hdmi: Make connector creation optional")
      Cc: Andrzej Hajda <a.hajda@samsung.com>
      Cc: Neil Armstrong <narmstrong@baylibre.com>
      Cc: Laurent Pinchart <Laurent.pinchart@ideasonboard.com>
      Cc: Jonas Karlman <jonas@kwiboo.se>
      Cc: Jernej Skrabec <jernej.skrabec@siol.net>
      Cc: David Airlie <airlied@linux.ie>
      Cc: Daniel Vetter <daniel@ffwll.ch>
      Cc: Boris Brezillon <boris.brezillon@collabora.com>
      Cc: Jerome Brunet <jbrunet@baylibre.com>
      Cc: Cheng-Yi Chiang <cychiang@chromium.org>
      Cc: Dariusz Marcinkiewicz <darekm@google.com>
      Cc: Archit Taneja <architt@codeaurora.org>
      Cc: Jose Abreu <joabreu@synopsys.com>
      Cc: Sam Ravnborg <sam@ravnborg.org>
      Cc: dri-devel@lists.freedesktop.org
      Cc: NXP Linux Team <linux-imx@nxp.com>
      Signed-off-by: default avatarLiu Ying <victor.liu@nxp.com>
      Signed-off-by: default avatarSam Ravnborg <sam@ravnborg.org>
      Link: https://patchwork.freedesktop.org/patch/msgid/1594260156-8316-2-git-send-email-victor.liu@nxp.com
      0bf4f5b5
    • Liu Ying's avatar
      drm/bridge: dw-hdmi: Don't cleanup i2c adapter and ddc ptr in __dw_hdmi_probe() bailout path · 2ae53e79
      Liu Ying authored
      
      It's unnecessary to cleanup the i2c adapter and the ddc pointer in
      the bailout path of  __dw_hdmi_probe(), since the adapter is not
      added and the ddc pointer is not set.
      
      Fixes: a23d6265 ("drm: bridge: dw-hdmi: Extract PHY interrupt setup to a function")
      Cc: Andrzej Hajda <a.hajda@samsung.com>
      Cc: Neil Armstrong <narmstrong@baylibre.com>
      Cc: Laurent Pinchart <Laurent.pinchart@ideasonboard.com>
      Cc: Jonas Karlman <jonas@kwiboo.se>
      Cc: Jernej Skrabec <jernej.skrabec@siol.net>
      Cc: David Airlie <airlied@linux.ie>
      Cc: Daniel Vetter <daniel@ffwll.ch>
      Cc: Boris Brezillon <boris.brezillon@collabora.com>
      Cc: Jerome Brunet <jbrunet@baylibre.com>
      Cc: Cheng-Yi Chiang <cychiang@chromium.org>
      Cc: Dariusz Marcinkiewicz <darekm@google.com>
      Cc: Archit Taneja <architt@codeaurora.org>
      Cc: Jose Abreu <joabreu@synopsys.com>
      Cc: dri-devel@lists.freedesktop.org
      Cc: NXP Linux Team <linux-imx@nxp.com>
      Signed-off-by: default avatarLiu Ying <victor.liu@nxp.com>
      Reviewed-by: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
      Signed-off-by: default avatarSam Ravnborg <sam@ravnborg.org>
      Link: https://patchwork.freedesktop.org/patch/msgid/1594260156-8316-1-git-send-email-victor.liu@nxp.com
      2ae53e79
  28. Jun 25, 2020
Loading