1. 01 8月, 2021 1 次提交
    • D
      drm/bridge: ti-sn65dsi86: Fix power off sequence · acb06210
      Douglas Anderson 提交于
      When testing with a panel that's apparently a little more persnickety
      about the correct power sequence (specifically Samsung ATNA33XC20), we
      found that the ti-sn65dsi86 was doing things just slightly wrong.
      
      Looking closely at the ti-sn65dsi86's datasheet, the power off
      sequence is supposed to be:
      1. Clear VSTREAM_ENABLE bit
      2. Stop DSI stream from GPU. DSI lanes must be placed in LP11 state.
      3. Program the ML_TX_MODE to 0x0 (OFF)
      4. Program the DP_NUM_LANES register to 0x0
      5. Clear the DP_PLL_EN bit.
      6. Deassert the EN pin.
      7. Remove power from supply pins
      
      Since we were doing the whole sequence in the "disable", I believe
      that step #2 (stopping the DSI stream from the GPU) wasn't
      happening. We also weren't setting DP_NUM_LANES to 0.
      
      Let's fix this.
      
      NOTE: things are a little asymmetric now. For instance, we turn the
      PLL on in "enable" but now we're not turning it off until
      "post_disable". It would seem to make sense to move the PLL turning on
      to "pre_enable" to match. Unfortunately, I don't believe that's
      allowed. It looks as if (in the non-refclk mode which probably nobody
      is using) we have to wait until the MIPI clock is there before we can
      enable the PLL. In any case, the way it is here won't really
      hurt--it'll just leave the PLL on a little longer.
      
      Fixes: a095f15c ("drm/bridge: add support for sn65dsi86 bridge driver")
      Signed-off-by: NDouglas Anderson <dianders@chromium.org>
      Acked-by: NRobert Foss <robert.foss@linaro.org>
      Reviewed-by: NSean Paul <seanpaul@chromium.org>
      Signed-off-by: NSam Ravnborg <sam@ravnborg.org>
      Link: https://patchwork.freedesktop.org/patch/msgid/20210730084534.v2.2.If8a8ec3bf1855cf0dbb62c005a71d6698c99c125@changeid
      acb06210
  2. 24 6月, 2021 5 次提交
  3. 12 6月, 2021 4 次提交
    • D
      drm/bridge: ti-sn65dsi86: Improve probe errors with dev_err_probe() · 4c1b3d94
      Douglas Anderson 提交于
      As I was testing to make sure that the DEFER path worked well with my
      patch series, I got tired of seeing this scary message in my logs just
      because the panel needed to defer:
        [drm:ti_sn_bridge_probe] *ERROR* could not find any panel node
      
      Let's use dev_err_probe() which nicely quiets this error and also
      simplifies the code a tiny bit. We'll also update other places in the
      file which can use dev_err_probe().
      Signed-off-by: NDouglas Anderson <dianders@chromium.org>
      Reviewed-by: NLinus Walleij <linus.walleij@linaro.org>
      Link: https://patchwork.freedesktop.org/patch/msgid/20210611101711.v10.10.I24bba069e63b1eea84443eef0c8535fd032a6311@changeid
      4c1b3d94
    • D
      drm/bridge: ti-sn65dsi86: Don't read EDID blob over DDC · a70e558c
      Douglas Anderson 提交于
      This is really just a revert of commit 58074b08 ("drm/bridge:
      ti-sn65dsi86: Read EDID blob over DDC"), resolving conflicts.
      
      The old code failed to read the EDID properly in a very important
      case: before the bridge's pre_enable() was called. The way things need
      to work:
      1. Read the EDID.
      2. Based on the EDID, decide on video settings and pixel clock.
      3. Enable the bridge w/ the desired settings.
      
      The way things were working:
      1. Try to read the EDID but fail; fall back to hardcoded values.
      2. Based on hardcoded values, decide on video settings and pixel clock.
      3. Enable the bridge w/ the desired settings.
      4. Try again to read the EDID, it works now!
      5. Realize that the hardcoded settings weren't quite right.
      6. Disable / reenable the bridge w/ the right settings.
      
      The reasons for the failures were twofold:
      a) Since we never ran the bridge chip's pre-enable then we never set
         the bit to ignore HPD. This meant the bridge chip didn't even _try_
         to go out on the bus and communicate with the panel.
      b) Even if we fixed things to ignore HPD, the EDID still wouldn't read
         if the panel wasn't on.
      
      Instead of reverting the code, we could fix it to set the HPD bit and
      also power on the panel. However, it also works nicely to just let the
      panel code read the EDID. Now that we've split the driver up we can
      expose the DDC AUX channel bus to the panel node. The panel can take
      charge of reading the EDID.
      
      NOTE: in order for things to work, anyone that needs to read the EDID
      will need to instantiate their panel using the new DP AUX bus (AKA by
      listing their panel under the "aux-bus" node of the bridge chip in the
      device tree).
      
      In the future if we want to use the bridge chip to provide a full
      external DP port (which won't have a panel) then we will have to
      conditinally add EDID reading back in.
      Suggested-by: NAndrzej Hajda <a.hajda@samsung.com>
      Signed-off-by: NDouglas Anderson <dianders@chromium.org>
      Reviewed-by: NBjorn Andersson <bjorn.andersson@linaro.org>
      Link: https://patchwork.freedesktop.org/patch/msgid/20210611101711.v10.9.I9330684c25f65bb318eff57f0616500f83eac3cc@changeid
      a70e558c
    • D
      drm/bridge: ti-sn65dsi86: Add support for the DP AUX bus · e0bbcc62
      Douglas Anderson 提交于
      We want to provide our panel with access to the DP AUX channel. The
      way to do this is to let our panel be a child of ours using the fancy
      new DP AUX bus support.
      Signed-off-by: NDouglas Anderson <dianders@chromium.org>
      Acked-by: NLinus Walleij <linus.walleij@linaro.org>
      Reviewed-by: NLyude Paul <lyude@redhat.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20210611101711.v10.8.Ib5fe0638da85800141ce141bb8e441c5f25438d4@changeid
      e0bbcc62
    • D
      drm/bridge: ti-sn65dsi86: Promote the AUX channel to its own sub-dev · a1e3667a
      Douglas Anderson 提交于
      On its own, this change looks a little strange and doesn't do too much
      useful. To understand why we're doing this we need to look forward to
      future patches where we're going to probe our panel using the new DP
      AUX bus. See the patch ("drm/bridge: ti-sn65dsi86: Add support for the
      DP AUX bus").
      
      Let's think about the set of steps we'll want to happen when we have
      the DP AUX bus:
      
      1. We'll create the DP AUX bus.
      2. We'll populate the devices on the DP AUX bus (AKA our panel).
      3. For setting up the bridge-related functions of ti-sn65dsi86 we'll
         need to get a reference to the panel.
      
      If we do #1 - #3 in a single probe call things _mostly_ will work, but
      it won't be massively robust. Let's explore.
      
      First let's think of the easy case of no -EPROBE_DEFER. In that case
      in step #2 when we populate the devices on the DP AUX bus it will
      actually try probing the panel right away. Since the panel probe
      doesn't defer then in step #3 we'll get a reference to the panel and
      we're golden.
      
      Second, let's think of the case when the panel returns
      -EPROBE_DEFER. In that case step #2 won't synchronously create the
      panel (it'll just add the device to the defer list to do it
      later). Step #3 will fail to get the panel and the bridge sub-device
      will return -EPROBE_DEFER. We'll depopulate the DP AUX bus. Later
      we'll try the whole sequence again. Presumably the panel will
      eventually stop returning -EPROBE_DEFER and we'll go back to the first
      case where things were golden. So this case is OK too even if it's a
      bit ugly that we have to keep creating / deleting the AUX bus over and
      over.
      
      So where is the problem? As I said, it's mostly about robustness. I
      don't believe that step #2 (creating the sub-devices) is really
      guaranteed to be synchronous. This is evidenced by the fact that it's
      allowed to "succeed" by just sticking the device on the deferred
      list. If anything about the process changes in Linux as a whole and
      step #2 just kicks off the probe of the DP AUX endpoints (our panel)
      in the background then we'd be in trouble because we might never get
      the panel in step #3.
      
      Adding an extra sub-device means we just don't need to worry about
      it. We'll create the sub-device for the DP AUX bus and it won't go
      away until the whole ti-sn65dsi86 driver goes away. If the bridge
      sub-device defers (maybe because it can't find the panel) that won't
      depopulate the DP AUX bus and so we don't need to worry about it.
      
      NOTE: there's a little bit of a trick here. Though the AUX channel can
      run without the MIPI-to-eDP bits of the code, the MIPI-to-eDP bits
      can't run without the AUX channel. We could come up a complicated
      signaling scheme (have the MIPI-to-eDP bits return EPROBE_DEFER for a
      while or wait on some sort of completion), but it seems simple enough
      to just not even bother creating the bridge device until the AUX
      channel probes. That's what we'll do.
      Signed-off-by: NDouglas Anderson <dianders@chromium.org>
      Reviewed-by: NLyude Paul <lyude@redhat.com>
      Reviewed-by: NLinus Walleij <linus.walleij@linaro.org>
      Link: https://patchwork.freedesktop.org/patch/msgid/20210611101711.v10.7.If89144992cb9d900f8c91a8d1817dbe00f543720@changeid
      a1e3667a
  4. 18 5月, 2021 1 次提交
  5. 04 5月, 2021 12 次提交
  6. 28 4月, 2021 1 次提交
  7. 20 4月, 2021 5 次提交
  8. 24 3月, 2021 1 次提交
  9. 07 11月, 2020 4 次提交
  10. 17 10月, 2020 2 次提交
  11. 24 8月, 2020 1 次提交
  12. 08 8月, 2020 1 次提交
    • J
      drm: Remove unnecessary drm_panel_attach and drm_panel_detach · 87154ff8
      Joe Perches 提交于
      These functions are now empty and no longer
      useful so remove the functions and their uses.
      Signed-off-by: NJoe Perches <joe@perches.com>
      Cc: Bernard Zhao <bernard@vivo.com>
      Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
      Cc: Maxime Ripard <mripard@kernel.org>,
      Cc: Thomas Zimmermann <tzimmermann@suse.de>
      Cc: Thierry Reding <thierry.reding@gmail.com>
      Cc: David Airlie <airlied@linux.ie>
      Cc: Daniel Vetter <daniel@ffwll.ch>
      Cc: Linus Walleij <linus.walleij@linaro.org>
      Cc: Icenowy Zheng <icenowy@aosc.io>,
      Cc: Jagan Teki <jagan@amarulasolutions.com>
      Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
      Cc: Robert Chiras <robert.chiras@nxp.com>
      Cc: dri-devel@lists.freedesktop.org,
      Cc: linux-kernel@vger.kernel.org
      Cc: opensource.kernel@vivo.com
      Signed-off-by: Sam Ravnborg <sam@ravnborg.org> # Fixed build and a few warnings
      Link: https://patchwork.freedesktop.org/patch/msgid/9e13761020750b1ce2f1fabee23ef6e2a2942882.camel@perches.com
      87154ff8
  13. 11 7月, 2020 1 次提交
  14. 26 6月, 2020 1 次提交