1. 02 Oct, 2023 5 commits
  2. 30 Sep, 2023 2 commits
  3. 28 Sep, 2023 4 commits
  4. 27 Sep, 2023 5 commits
  5. 25 Sep, 2023 6 commits
  6. 22 Sep, 2023 8 commits
  7. 21 Sep, 2023 8 commits
  8. 20 Sep, 2023 2 commits
    • AngeloGioacchino Del Regno's avatar
      drm/bridge: panel: Fix device link for DRM_BRIDGE_ATTACH_NO_CONNECTOR · 88787801
      AngeloGioacchino Del Regno authored
      When external bridges are attached with DRM_BRIDGE_ATTACH_NO_CONNECTOR,
      the panel bridge may also get the same flag, but in the .attach()
      callback for the panel bridge a device link is added only when this
      flag is not present; To make things worse, the .detach() callback
      tries to delete the device link unconditionally and without checking
      if it was created in the first place, crashing the kernel with a NULL
      pointer kernel panic upon calling panel_bridge_detach().
      
      Fix that by moving the device_link_add() call before checking if the
      DRM_BRIDGE_ATTACH_NO_CONNECTOR flag is present.
      
      Fixes: 199cf07e ("drm/bridge: panel: Add a device link between drm device and panel device")
      Signed-off-by: default avatarAngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
      Reviewed-by: default avatarLiu Ying <victor.liu@nxp.com>
      Signed-off-by: default avatarNeil Armstrong <neil.armstrong@linaro.org>
      Link: https://patchwork.freedesktop.org/patch/msgid/20230920082727.57729-1-angelogioacchino.delregno@collabora.com
      88787801
    • Tvrtko Ursulin's avatar
      drm: Update file owner during use · 1c7a387f
      Tvrtko Ursulin authored
      With the typical model where the display server opens the file descriptor
      and then hands it over to the client(*), we were showing stale data in
      debugfs.
      
      Fix it by updating the drm_file->pid on ioctl access from a different
      process.
      
      The field is also made RCU protected to allow for lockless readers. Update
      side is protected with dev->filelist_mutex.
      
      Before:
      
      $ cat /sys/kernel/debug/dri/0/clients
                   command   pid dev master a   uid      magic
                      Xorg  2344   0   y    y     0          0
                      Xorg  2344   0   n    y     0          2
                      Xorg  2344   0   n    y     0          3
                      Xorg  2344   0   n    y     0          4
      
      After:
      
      $ cat /sys/kernel/debug/dri/0/clients
                   command  tgid dev master a   uid      magic
                      Xorg   830   0   y    y     0          0
             xfce4-session   880   0   n    y     0          1
                     xfwm4   943   0   n    y     0          2
                 neverball  1095   0   n    y     0          3
      
      *)
      More detailed and historically accurate description of various handover
      implementation kindly provided by Emil Velikov:
      
      """
      The traditional model, the server was the orchestrator managing the
      primary device node. From the fd, to the master status and
      authentication. But looking at the fd alone, this has varied across
      the years.
      
      IIRC in the DRI1 days, Xorg (libdrm really) would have a list of open
      fd(s) and reuse those whenever needed, DRI2 the client was responsible
      for open() themselves and with DRI3 the fd was passed to the client.
      
      Around the inception of DRI3 and systemd-logind, the latter became
      another possible orchestrator. Whereby Xorg and Wayland compositors
      could ask it for the fd. For various reasons (hysterical and genuine
      ones) Xorg has a fallback path going the open(), whereas Wayland
      compositors are moving to solely relying on logind... some never had
      fallback even.
      
      Over the past few years, more projects have emerged which provide
      functionality similar (be that on API level, Dbus, or otherwise) to
      systemd-logind.
      """
      
      v2:
       * Fixed typo in commit text and added a fine historical explanation
         from Emil.
      Signed-off-by: default avatarTvrtko Ursulin <tvrtko.ursulin@intel.com>
      Cc: "Christian König" <christian.koenig@amd.com>
      Cc: Daniel Vetter <daniel@ffwll.ch>
      Acked-by: default avatarChristian König <christian.koenig@amd.com>
      Reviewed-by: default avatarEmil Velikov <emil.l.velikov@gmail.com>
      Reviewed-by: default avatarRob Clark <robdclark@gmail.com>
      Tested-by: default avatarRob Clark <robdclark@gmail.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20230621094824.2348732-1-tvrtko.ursulin@linux.intel.comSigned-off-by: default avatarChristian König <christian.koenig@amd.com>
      1c7a387f