mbox series

[RESEND,v2,0/3] drm: introduce per-encoder debugfs directory

Message ID 20231203115315.1306124-1-dmitry.baryshkov@linaro.org
Headers show
Series drm: introduce per-encoder debugfs directory | expand

Message

Dmitry Baryshkov Dec. 3, 2023, 11:53 a.m. UTC
Resending, patch 1 needs review from DRM core maintainers, but it got no
attention since October.

Each of connectors and CRTCs used by the DRM device provides debugfs
directory, which is used by several standard debugfs files and can
further be extended by the driver. Add such generic debugfs directories
for encoder. As a showcase for this dir, migrate `bridge_chains' debugfs
file (which contains per-encoder data) and MSM custom encoder status to
this new debugfs directory.

Changes since v1:
- Brought back drm_printer usage to bridges_show (Tomi Valkeinen)
- Updated the drm/bridge commit message to reflect format changes (Tomi
  Valkeinen)

Dmitry Baryshkov (3):
  drm/encoder: register per-encoder debugfs dir
  drm/bridge: migrate bridge_chains to per-encoder file
  drm/msm/dpu: move encoder status to standard encoder debugfs dir

 drivers/gpu/drm/drm_bridge.c                | 44 --------------
 drivers/gpu/drm/drm_debugfs.c               | 65 ++++++++++++++++++++-
 drivers/gpu/drm/drm_encoder.c               |  4 ++
 drivers/gpu/drm/drm_internal.h              |  9 +++
 drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c | 45 ++------------
 include/drm/drm_bridge.h                    |  2 -
 include/drm/drm_encoder.h                   | 16 ++++-
 7 files changed, 96 insertions(+), 89 deletions(-)

Comments

Dmitry Baryshkov Dec. 4, 2023, 2:16 p.m. UTC | #1
On Sun, 03 Dec 2023 14:53:12 +0300, Dmitry Baryshkov wrote:
> Resending, patch 1 needs review from DRM core maintainers, but it got no
> attention since October.
> 
> Each of connectors and CRTCs used by the DRM device provides debugfs
> directory, which is used by several standard debugfs files and can
> further be extended by the driver. Add such generic debugfs directories
> for encoder. As a showcase for this dir, migrate `bridge_chains' debugfs
> file (which contains per-encoder data) and MSM custom encoder status to
> this new debugfs directory.
> 
> [...]

Applied to drm-misc-next, thanks!

[1/3] drm/encoder: register per-encoder debugfs dir
      commit: caf525ed45b4960b450cbd4e811d9b247bc2586c
[2/3] drm/bridge: migrate bridge_chains to per-encoder file
      commit: d0b3c318e04cc6c4e2a3c30ee0f6f619aa8d0db5

Best regards,
Abhinav Kumar Dec. 4, 2023, 11:36 p.m. UTC | #2
On 12/3/2023 3:53 AM, Dmitry Baryshkov wrote:
> Now as we have standard per-encoder debugfs directory, move DPU encoder
> status file to that directory.
> 
> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
> ---
>   drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c | 45 +++------------------
>   1 file changed, 6 insertions(+), 39 deletions(-)
> 

For this change,

Reviewed-by: Abhinav Kumar <quic_abhinavk@quicinc.com>

Looking more closely at other drivers, most of them (atleast what I 
checked) were doing the same functionality in drm_encoder's 
late_register / early_unregister as DPU.

This can be a wider cleanup across the tree if needed or we can stop here.
Mark Brown Dec. 5, 2023, 4:13 p.m. UTC | #3
On Sun, Dec 03, 2023 at 02:53:13PM +0300, Dmitry Baryshkov wrote:

> Each of connectors and CRTCs used by the DRM device provides debugfs
> directory, which is used by several standard debugfs files and can
> further be extended by the driver. Add such generic debugfs directories
> for encoder.

Today's -next fails to boot an imx_v6_v7_defconfig on at least the UDOO
dual and quad platforms, based on i.MX6DL and i.MX6Q respectively.
multi_v7_defconfig looks fine on the same boards, it's just the i.MX
specific config that's failing.  Nothing else in my CI appears impacted.
We get a NULL pointer defererence while bringing up the display
subsystem:

[    1.392715] imx-drm display-subsystem: bound imx-ipuv3-crtc.7 (ops 0xc0f9a490)
[    1.400013] imx-drm display-subsystem: bound 120000.hdmi (ops 0xc0f9af80)
[    1.407193] 8<--- cut here ---
[    1.410256] Unable to handle kernel NULL pointer dereference at virtual address 00000010 when read

...

[    1.891882]  drm_debugfs_encoder_add from drm_encoder_register_all+0x20/0x60
[    1.898954]  drm_encoder_register_all from drm_modeset_register_all+0x34/0x70
[    1.906116]  drm_modeset_register_all from drm_dev_register+0x140/0x288
[    1.912765]  drm_dev_register from imx_drm_bind+0xd0/0x128
[    1.918284]  imx_drm_bind from try_to_bring_up_aggregate_device+0x164/0x1c4
[    1.925275]  try_to_bring_up_aggregate_device from __component_add+0x90/0x13c

Full log at:

   https://lava.sirena.org.uk/scheduler/job/308781

A bisect identfied this patch (in -next as caf525ed45b4960b4) as being
the commit that introduced the issue, bisect log below.  I've not done
any other investigation but the commit does seem plausibly related to
the backtrace in the oops.

git bisect start
# good: [cc1b39317a57120651840e79b535594ee09f5768] Merge branch 'for-linux-next-fixes' of git://anongit.freedesktop.org/drm/drm-misc
git bisect good cc1b39317a57120651840e79b535594ee09f5768
# bad: [0f5f12ac05f36f117e793656c3f560625e927f1b] Add linux-next specific files for 20231205
git bisect bad 0f5f12ac05f36f117e793656c3f560625e927f1b
# good: [8390406ed4d9d360bc404a5a3e9b82f335a8d417] Merge branch 'main' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git
git bisect good 8390406ed4d9d360bc404a5a3e9b82f335a8d417
# bad: [b948f47bf8abdaf87f74c553b589c50567090aa2] Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/lsm.git
git bisect bad b948f47bf8abdaf87f74c553b589c50567090aa2
# bad: [dce94061f0d02f5ab355390a6e63d3dbea938b72] drm/v3d: Fix missing error code in v3d_submit_cpu_ioctl()
git bisect bad dce94061f0d02f5ab355390a6e63d3dbea938b72
# good: [0d3abd456be45369235dd75793ce26f07900044c] drm/imagination: vm: fix drm_gpuvm reference count
git bisect good 0d3abd456be45369235dd75793ce26f07900044c
# good: [f52ffea0745943bb6af674f30f4243b3721b7cd6] drm/i915/iosf: Drop unused APIs
git bisect good f52ffea0745943bb6af674f30f4243b3721b7cd6
# good: [b101d08451de6eaebd1a840e4885ce7ce73656ad] drm/nouveau: Removes unnecessary args check in nouveau_uvmm_sm_prepare
git bisect good b101d08451de6eaebd1a840e4885ce7ce73656ad
# good: [63ee44540205d993854f143a5ab1d7d9e63ffcf1] dma-buf/sync_file: Add SET_DEADLINE ioctl
git bisect good 63ee44540205d993854f143a5ab1d7d9e63ffcf1
# good: [e4256751df4a0a3860f181588ee730dd19cb0c30] drm/display/dp: Add the remaining Square PHY patterns DPCD register definitions
git bisect good e4256751df4a0a3860f181588ee730dd19cb0c30
# good: [2bcca96abfbf89d26fc10fc92e40532bb2ae8891] soc: qcom: pmic-glink: switch to DRM_AUX_HPD_BRIDGE
git bisect good 2bcca96abfbf89d26fc10fc92e40532bb2ae8891
# bad: [b881ba8faa5c7689eb1cb487ad891c46dbbed0e8] Revert "drm/atomic: Move framebuffer checks to helper"
git bisect bad b881ba8faa5c7689eb1cb487ad891c46dbbed0e8
# bad: [caf525ed45b4960b450cbd4e811d9b247bc2586c] drm/encoder: register per-encoder debugfs dir
git bisect bad caf525ed45b4960b450cbd4e811d9b247bc2586c
# good: [7d9f1b72b29698e3030c2b163522cf4aa91b47e9] usb: typec: qcom-pmic-typec: switch to DRM_AUX_HPD_BRIDGE
git bisect good 7d9f1b72b29698e3030c2b163522cf4aa91b47e9
# first bad commit: [caf525ed45b4960b450cbd4e811d9b247bc2586c] drm/encoder: register per-encoder debugfs dir
Dmitry Baryshkov Dec. 13, 2023, 12:37 a.m. UTC | #4
On Sun, 03 Dec 2023 14:53:12 +0300, Dmitry Baryshkov wrote:
> Resending, patch 1 needs review from DRM core maintainers, but it got no
> attention since October.
> 
> Each of connectors and CRTCs used by the DRM device provides debugfs
> directory, which is used by several standard debugfs files and can
> further be extended by the driver. Add such generic debugfs directories
> for encoder. As a showcase for this dir, migrate `bridge_chains' debugfs
> file (which contains per-encoder data) and MSM custom encoder status to
> this new debugfs directory.
> 
> [...]

Applied, thanks!

[3/3] drm/msm/dpu: move encoder status to standard encoder debugfs dir
      https://gitlab.freedesktop.org/lumag/msm/-/commit/62d35629da80

Best regards,