Skip to content

Associate ddc adapters with connectors

Andrzej Pietrasiewicz amd-gfx dri-devel intel-gfx linux-arm-kernel linux-arm-msm linux-mediatek linux-rockchip linux-samsung-soc linux-tegra lkml 4 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v5 Latest21 of 24 patches 8 repliesIn review
  2. v415 of 23 patches 14 repliesSuperseded
  3. v22 patches 1 replySuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v12 patches8 repliesSuperseded

21 of 24 patches are in this archive. The cover letter announces 24.

Patches in v5 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/24drm: Include ddc adapter pointer in struct drm_connectordrivers/gpu/drm/drm_sysfs.c include/drm/drm_connector.h+19 -03 replies
2/24drm: Add drm_connector_init() variant with ddcdrivers/gpu/drm/drm_connector.c include/drm/drm_connector.h+24 -03 replies
3/24drm/exynos: Provide ddc symlink in connector's sysfsdrivers/gpu/drm/exynos/exynos_hdmi.c+9 -80 replies
4/24drm: rockchip: Provide ddc symlink in rk3066_hdmi sysfs directorydrivers/gpu/drm/rockchip/rk3066_hdmi.c+12 -120 replies
5/24drm: rockchip: Provide ddc symlink in inno_hdmi sysfs directorydrivers/gpu/drm/rockchip/inno_hdmi.c+12 -110 replies
6/24drm/msm/hdmi: Provide ddc symlink in hdmi connector sysfs directorydrivers/gpu/drm/msm/hdmi/hdmi_connector.c+4 -20 replies
8/24drm/mediatek: Provide ddc symlink in hdmi connector sysfs directorydrivers/gpu/drm/mediatek/mtk_hdmi.c+8 -80 replies
9/24drm/tegra: Provide ddc symlink in output connector sysfs directorydrivers/gpu/drm/tegra/drm.h drivers/gpu/drm/tegra/hdmi.c drivers/gpu/drm/tegra/output.c +1 more+17 -160 replies
10/24drm/imx: imx-ldb: Provide ddc symlink in connector's sysfsdrivers/gpu/drm/imx/imx-ldb.c+10 -100 replies
11/24drm/imx: imx-tve: Provide ddc symlink in connector's sysfsdrivers/gpu/drm/imx/imx-tve.c+7 -70 replies
12/24drm/vc4: Provide ddc symlink in connector sysfs directorydrivers/gpu/drm/vc4/vc4_hdmi.c+15 -110 replies
13/24drm: zte: Provide ddc symlink in hdmi connector sysfs directorydrivers/gpu/drm/zte/zx_hdmi.c+13 -180 replies
14/24drm: zte: Provide ddc symlink in vga connector sysfs directorydrivers/gpu/drm/zte/zx_vga.c+13 -180 replies
15/24drm/tilcdc: Provide ddc symlink in connector sysfs directorydrivers/gpu/drm/tilcdc/tilcdc_tfp410.c+4 -20 replies
16/24drm: sti: Provide ddc symlink in hdmi connector sysfs directorydrivers/gpu/drm/sti/sti_hdmi.c+4 -20 replies
17/24drm/mgag200: Provide ddc symlink in connector sysfs directorydrivers/gpu/drm/mgag200/mgag200_mode.c+7 -61 reply
18/24drm/ast: Provide ddc symlink in connector sysfs directorydrivers/gpu/drm/ast/ast_mode.c+8 -51 reply
19/24drm/bridge: dumb-vga-dac: Provide ddc symlink in connector sysfs directorydrivers/gpu/drm/bridge/dumb-vga-dac.c+13 -120 replies
20/24drm/bridge: dw-hdmi: Provide ddc symlink in connector sysfs directorydrivers/gpu/drm/bridge/synopsys/dw-hdmi.c+24 -220 replies
21/24drm/bridge: ti-tfp410: Provide ddc symlink in connector sysfs directorydrivers/gpu/drm/bridge/ti-tfp410.c+13 -120 replies
22/24drm/amdgpu: Provide ddc symlink in connector sysfs directorydrivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c+69 -260 replies

Reviews trailers per patch

4 of 21 patches have a Reviewed-by or Acked-by.

PatchDaniel VetterAndrzej HajdaThomas Zimmermann
1/24A-b R-b
2/24A-b
3/24
4/24
5/24
6/24
8/24
9/24
10/24
11/24
12/24
13/24
14/24
15/24
16/24
17/24R-b
18/24R-b
19/24
20/24
21/24
22/24

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.

Read the v5 thread

Cover letter [PATCH v5 00/24] Associate ddc adapters with connectors

It is difficult for a user to know which of the i2c adapters is for which drm connector. This series addresses this problem.

The idea is to have a symbolic link in connector's sysfs directory, e.g.:

ls -l /sys/class/drm/card0-HDMI-A-1/ddc

lrwxrwxrwx 1 root root 0 Jun 24 10:42 /sys/class/drm/card0-HDMI-A-1/ddc \
	-> ../../../../soc/13880000.i2c/i2c-2

The user then knows that their card0-HDMI-A-1 uses i2c-2 and can e.g. run ddcutil:

ddcutil -b 2 getvcp 0x10
VCP code 0x10 (Brightness): current value = 90, max value = 100

The first patch in the series adds struct i2c_adapter pointer to struct drm_connector. If the field is used by a particular driver, then an appropriate symbolic link is created by the generic code, which is also added by this patch.

Patch 2 adds a new variant of drm_connector_init(), see the changelog below.

Patches 3..24 are examples of how to convert a driver to this new scheme.

v1..v2:

- used fixed name "ddc" for the symbolic link in order to make it easy for userspace to find the i2c adapter

v2..v3:

- converted as many drivers as possible.

v3..v4:

- added Reviewed-by for patch 01/23
- moved "ddc" field assignment to before drm_connector_init() is called in msm, vc4, sti, mgag200, ast, amdgpu, radeon
- simplified the code in amdgpu and radeon at the expense of some lines exceeding 80 characters as per Alex Deucher's suggestion
- added i915

v4..v5:

- changed "include <linux/i2c.h>" to "struct i2c_adapter;" in drm_connector.h, consequently, added "include <linux/i2c.h>" in drm_sysfs.c.
- added "drm_connector_init_with_ddc()" variant to ensure that the ddc field of drm_connector is preserved accross its invocation
- accordingly changed invocations of drm_connector_init() in the touched drivers to use the new variant

@Benjamin
@Shawn
@Thomas

There were your Acked-by or Reviewed-by for some patches in v4, but now that the patches use the newly added function I'm not sure I can still include those tags without you actually confirming. Can I? Or can you please re-review?

TODO: nouveau, gma500, omapdrm, panel-simple - if applicable. Other drivers are either already converted or don't mention neither "ddc" nor "i2c_adapter".

Andrzej Pietrasiewicz (24):
drm: Include ddc adapter pointer in struct drm_connector
drm: Add drm_connector_init() variant with ddc
drm/exynos: Provide ddc symlink in connector's sysfs
drm: rockchip: Provide ddc symlink in rk3066_hdmi sysfs directory
drm: rockchip: Provide ddc symlink in inno_hdmi sysfs directory drm/msm/hdmi: Provide ddc symlink in hdmi connector sysfs directory drm/sun4i: hdmi: Provide ddc symlink in sun4i hdmi connector sysfs
directory
drm/mediatek: Provide ddc symlink in hdmi connector sysfs directory drm/tegra: Provide ddc symlink in output connector sysfs directory drm/imx: imx-ldb: Provide ddc symlink in connector's sysfs drm/imx: imx-tve: Provide ddc symlink in connector's sysfs drm/vc4: Provide ddc symlink in connector sysfs directory
drm: zte: Provide ddc symlink in hdmi connector sysfs directory
drm: zte: Provide ddc symlink in vga connector sysfs directory drm/tilcdc: Provide ddc symlink in connector sysfs directory
drm: sti: Provide ddc symlink in hdmi connector sysfs directory drm/mgag200: Provide ddc symlink in connector sysfs directory drm/ast: Provide ddc symlink in connector sysfs directory drm/bridge: dumb-vga-dac: Provide ddc symlink in connector sysfs
directory
drm/bridge: dw-hdmi: Provide ddc symlink in connector sysfs directory drm/bridge: ti-tfp410: Provide ddc symlink in connector sysfs
directory
drm/amdgpu: Provide ddc symlink in connector sysfs directory drm/radeon: Provide ddc symlink in connector sysfs directory drm/i915: Provide ddc symlink in hdmi connector sysfs directory

 .../gpu/drm/amd/amdgpu/amdgpu_connectors.c    |  95 ++++++++----
 drivers/gpu/drm/ast/ast_mode.c                |  13 +-
 drivers/gpu/drm/bridge/dumb-vga-dac.c         |  25 ++--
 drivers/gpu/drm/bridge/synopsys/dw-hdmi.c     |  46 +++---
 drivers/gpu/drm/bridge/ti-tfp410.c            |  25 ++--
 drivers/gpu/drm/drm_connector.c               |  19 +++
 drivers/gpu/drm/drm_sysfs.c                   |   8 +
 drivers/gpu/drm/exynos/exynos_hdmi.c          |  17 ++-
 drivers/gpu/drm/i915/display/intel_hdmi.c     |  11 +-
 drivers/gpu/drm/imx/imx-ldb.c                 |  20 +--
 drivers/gpu/drm/imx/imx-tve.c                 |  14 +-
 drivers/gpu/drm/mediatek/mtk_hdmi.c           |  16 +-
 drivers/gpu/drm/mgag200/mgag200_mode.c        |  13 +-
 drivers/gpu/drm/msm/hdmi/hdmi_connector.c     |   6 +-
 drivers/gpu/drm/radeon/radeon_connectors.c    | 141 +++++++++++++-----
 drivers/gpu/drm/rockchip/inno_hdmi.c          |  23 +--
 drivers/gpu/drm/rockchip/rk3066_hdmi.c        |  24 +--
 drivers/gpu/drm/sti/sti_hdmi.c                |   6 +-
 drivers/gpu/drm/sun4i/sun4i_hdmi.h            |   1 -
 drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c        |  21 +--
 drivers/gpu/drm/tegra/drm.h                   |   1 -
 drivers/gpu/drm/tegra/hdmi.c                  |   7 +-
 drivers/gpu/drm/tegra/output.c                |  12 +-
 drivers/gpu/drm/tegra/sor.c                   |  13 +-
 drivers/gpu/drm/tilcdc/tilcdc_tfp410.c        |   6 +-
 drivers/gpu/drm/vc4/vc4_hdmi.c                |  26 ++--
 drivers/gpu/drm/zte/zx_hdmi.c                 |  31 ++--
 drivers/gpu/drm/zte/zx_vga.c                  |  31 ++--
 include/drm/drm_connector.h                   |  16 ++
 29 files changed, 428 insertions(+), 259 deletions(-)
Signature · 6 lines
2.17.1

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx