Forum | Documentation | Website | Blog

Skip to content
Snippets Groups Projects
  1. Mar 12, 2022
  2. Nov 30, 2021
  3. Oct 17, 2021
  4. Oct 15, 2021
  5. Oct 14, 2021
  6. Oct 10, 2021
  7. Oct 09, 2021
  8. Sep 20, 2021
  9. Aug 13, 2021
  10. Aug 05, 2021
  11. Jul 31, 2021
  12. Jul 17, 2021
  13. Jul 14, 2021
  14. Jun 14, 2021
  15. Jun 11, 2021
  16. Jun 10, 2021
  17. Apr 20, 2021
    • Douglas Anderson's avatar
      drm/panel: panel-simple: Use runtime pm to avoid excessive unprepare / prepare · 3235b0f2
      Douglas Anderson authored
      
      Unpreparing and re-preparing a panel can be a really heavy
      operation. Panels datasheets often specify something on the order of
      500ms as the delay you should insert after turning off the panel
      before turning it on again. In addition, turning on a panel can have
      delays on the order of 100ms - 200ms before the panel will assert HPD
      (AKA "panel ready"). The above means that we should avoid turning a
      panel off if we're going to turn it on again shortly.
      
      The above becomes a problem when we want to read the EDID of a
      panel. The way that ordering works is that userspace wants to read the
      EDID of the panel _before_ fully enabling it so that it can set the
      initial mode correctly. However, we can't read the EDID until we power
      it up. This leads to code that does this dance (like
      ps8640_bridge_get_edid()):
      
      1. When userspace requests EDID / the panel modes (through an ioctl),
         we power on the panel just enough to read the EDID and then power
         it off.
      2. Userspace then turns the panel on.
      
      There's likely not much time between step #1 and #2 and so we want to
      avoid powering the panel off and on again between those two steps.
      
      Let's use Runtime PM to help us. We'll move the existing prepare() and
      unprepare() to be runtime resume() and runtime suspend(). Now when we
      want to prepare() or unprepare() we just increment or decrement the
      refcount. We'll default to a 1 second autosuspend delay which seems
      sane given the typical delays we see for panels.
      
      A few notes:
      - It seems the existing unprepare() and prepare() are defined to be
        no-ops if called extra times. We'll preserve that behavior but may
        try to remove it in a future patch.
      - This is a slight change in the ABI of simple panel. If something was
        absolutely relying on the unprepare() to happen instantly that
        simply won't be the case anymore. I'm not aware of anyone relying on
        that behavior, but if there is someone then we'll need to figure out
        how to enable (or disable) this new delayed behavior selectively.
      - In order for this to work we now have a hard dependency on
        "PM". From memory this is a legit thing to assume these days and we
        don't have to find some fallback to keep working if someone wants to
        build their system without "PM".
      
      Signed-off-by: default avatarDouglas Anderson <dianders@chromium.org>
      Reviewed-by: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20210416153909.v4.7.I9e8bd33b49c496745bfac58ea9ab418bd3b6f5ce@changeid
      3235b0f2
  18. Dec 15, 2020
  19. Dec 07, 2020
  20. Nov 17, 2020
  21. Nov 14, 2020
  22. Oct 19, 2020
  23. Oct 15, 2020
  24. Sep 04, 2020
  25. Aug 18, 2020
  26. Jul 01, 2020
  27. May 07, 2020
  28. May 06, 2020
  29. Apr 08, 2020
  30. Mar 05, 2020
  31. Feb 29, 2020
  32. Jan 30, 2020
  33. Jan 17, 2020
  34. Jan 09, 2020