1. 22 Jun, 2021 1 commit
  2. 21 Jun, 2021 4 commits
  3. 18 Jun, 2021 3 commits
  4. 17 Jun, 2021 2 commits
  5. 16 Jun, 2021 7 commits
  6. 15 Jun, 2021 2 commits
    • Hridya Valsaraju's avatar
      dmabuf: Add the capability to expose DMA-BUF stats in sysfs · bdb8d06d
      Hridya Valsaraju authored
      Overview
      ========
      The patch adds DMA-BUF statistics to /sys/kernel/dmabuf/buffers. It
      allows statistics to be enabled for each DMA-BUF in sysfs by enabling
      the config CONFIG_DMABUF_SYSFS_STATS.
      
      The following stats will be exposed by the interface:
      
      /sys/kernel/dmabuf/buffers/<inode_number>/exporter_name
      /sys/kernel/dmabuf/buffers/<inode_number>/size
      /sys/kernel/dmabuf/buffers/<inode_number>/attachments/<attach_uid>/device
      /sys/kernel/dmabuf/buffers/<inode_number>/attachments/<attach_uid>/map_counter
      
      The inode_number is unique for each DMA-BUF and was added earlier [1]
      in order to allow userspace to track DMA-BUF usage across different
      processes.
      
      Use Cases
      =========
      The interface provides a way to gather DMA-BUF per-buffer statistics
      from production devices. These statistics will be used to derive DMA-BUF
      per-exporter stats and per-device usage stats for Android Bug reports.
      The corresponding userspace changes can be found at [2].
      Telemetry tools will also capture this information(along with other
      memory metrics) periodically as well as on important events like a
      foreground app kill (which might have been triggered by Low Memory
      Killer). It will also contribute to provide a snapshot of the system
      memory usage on other events such as OOM kills and Application Not
      Responding events.
      
      Background
      ==========
      Currently, there are two existing interfaces that provide information
      about DMA-BUFs.
      1) /sys/kernel/debug/dma_buf/bufinfo
      debugfs is however unsuitable to be mounted in production systems and
      cannot be considered as an alternative to the sysfs interface being
      proposed.
      2) proc/<pid>/fdinfo/<fd>
      The proc/<pid>/fdinfo/<fd> files expose information about DMA-BUF fds.
      However, the existing procfs interfaces can only provide information
      about the buffers for which processes hold fds or have the buffers
      mmapped into their address space. Since the procfs interfaces alone
      cannot provide a full picture of all DMA-BUFs in the system, there is
      the need for an alternate interface to provide this information on
      production systems.
      
      The patch contains the following major improvements over v1:
      1) Each attachment is represented by its own directory to allow creating
      a symlink to the importing device and to also provide room for future
      expansion.
      2) The number of distinct mappings of each attachment is exposed in a
      separate file.
      3) The per-buffer statistics are now in /sys/kernel/dmabuf/buffers
      inorder to make the interface expandable in future.
      
      All of the improvements above are based on suggestions/feedback from
      Daniel Vetter and Christian König.
      
      A shell script that can be run on a classic Linux environment to read
      out the DMA-BUF statistics can be found at [3](suggested by John
      Stultz).
      
      [1]: https://lore.kernel.org/patchwork/patch/1088791/
      [2]: https://android-review.googlesource.com/q/topic:%22dmabuf-sysfs%22+(status:open%20OR%20status:merged)
      [3]: https://android-review.googlesource.com/c/platform/system/memory/libmeminfo/+/1549734Reviewed-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Signed-off-by: default avatarHridya Valsaraju <hridya@google.com>
      Reported-by: default avatarkernel test robot <lkp@intel.com>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      Link: https://patchwork.freedesktop.org/patch/msgid/20210603214758.2955251-1-hridya@google.com
      bdb8d06d
    • Ainux's avatar
      drm/ast: Add detect function support · aae74ff9
      Ainux authored
      The existence of the connector cannot be detected,
      so add the detect function to support.
      Signed-off-by: default avatarAinux <ainux.wang@gmail.com>
      Signed-off-by: default avatarThomas Zimmermann <tzimmermann@suse.de>
      Link: https://patchwork.freedesktop.org/patch/msgid/20210526111515.40015-1-ainux.wang@gmail.com
      aae74ff9
  7. 14 Jun, 2021 7 commits
  8. 12 Jun, 2021 9 commits
  9. 11 Jun, 2021 5 commits
    • Douglas Anderson's avatar
      arm64: dts: qcom: sc7180-trogdor: Move panel under the bridge chip · ab6f24b4
      Douglas Anderson authored
      Putting the panel under the bridge chip (under the aux-bus node)
      allows the panel driver to get access to the DP AUX bus, enabling all
      sorts of fabulous new features.
      
      While we're at this, get rid of a level of hierarchy for the panel
      node. It doesn't need "ports / port" and can just have a "port" child.
      
      For Linux, this patch has a hard requirement on the patches adding DP
      AUX bus support to the ti-sn65dsi86 bridge chip driver. See the patch
      ("drm/bridge: ti-sn65dsi86: Add support for the DP AUX bus").
      Signed-off-by: default avatarDouglas Anderson <dianders@chromium.org>
      Acked-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      Acked-by: default avatarBjorn Andersson <bjorn.andersson@linaro.org>
      Link: https://patchwork.freedesktop.org/patch/msgid/20210611101711.v10.11.Ibdb7735fb1844561b902252215a69526a14f9abd@changeid
      ab6f24b4
    • Douglas Anderson's avatar
      drm/bridge: ti-sn65dsi86: Improve probe errors with dev_err_probe() · 4c1b3d94
      Douglas Anderson authored
      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: default avatarDouglas Anderson <dianders@chromium.org>
      Reviewed-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      Link: https://patchwork.freedesktop.org/patch/msgid/20210611101711.v10.10.I24bba069e63b1eea84443eef0c8535fd032a6311@changeid
      4c1b3d94
    • Douglas Anderson's avatar
      drm/bridge: ti-sn65dsi86: Don't read EDID blob over DDC · a70e558c
      Douglas Anderson authored
      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: default avatarAndrzej Hajda <a.hajda@samsung.com>
      Signed-off-by: default avatarDouglas Anderson <dianders@chromium.org>
      Reviewed-by: default avatarBjorn Andersson <bjorn.andersson@linaro.org>
      Link: https://patchwork.freedesktop.org/patch/msgid/20210611101711.v10.9.I9330684c25f65bb318eff57f0616500f83eac3cc@changeid
      a70e558c
    • Douglas Anderson's avatar
      drm/bridge: ti-sn65dsi86: Add support for the DP AUX bus · e0bbcc62
      Douglas Anderson authored
      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: default avatarDouglas Anderson <dianders@chromium.org>
      Acked-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      Reviewed-by: default avatarLyude Paul <lyude@redhat.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20210611101711.v10.8.Ib5fe0638da85800141ce141bb8e441c5f25438d4@changeid
      e0bbcc62
    • Douglas Anderson's avatar
      drm/bridge: ti-sn65dsi86: Promote the AUX channel to its own sub-dev · a1e3667a
      Douglas Anderson authored
      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: default avatarDouglas Anderson <dianders@chromium.org>
      Reviewed-by: default avatarLyude Paul <lyude@redhat.com>
      Reviewed-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      Link: https://patchwork.freedesktop.org/patch/msgid/20210611101711.v10.7.If89144992cb9d900f8c91a8d1817dbe00f543720@changeid
      a1e3667a