From patchwork Thu Jul 11 11:26:27 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrzej Pietrasiewicz X-Patchwork-Id: 11039683 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9AA4513B1 for ; Thu, 11 Jul 2019 11:27:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8708A28A63 for ; Thu, 11 Jul 2019 11:27:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7975C28A6E; Thu, 11 Jul 2019 11:27:17 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 1F5BE28A63 for ; Thu, 11 Jul 2019 11:27:17 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A65B36E18F; Thu, 11 Jul 2019 11:27:14 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [46.235.227.227]) by gabe.freedesktop.org (Postfix) with ESMTPS id 6EA6E6E182; Thu, 11 Jul 2019 11:27:12 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: andrzej.p) with ESMTPSA id 8925A28B554 From: Andrzej Pietrasiewicz To: dri-devel@lists.freedesktop.org Subject: [PATCH v4 00/23] Associate ddc adapters with connectors Date: Thu, 11 Jul 2019 13:26:27 +0200 Message-Id: X-Mailer: git-send-email 2.17.1 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Sam Ravnborg , Neil Armstrong , Maxime Ripard , Douglas Anderson , Thierry Reding , Laurent Pinchart , kernel@collabora.com, linux-samsung-soc@vger.kernel.org, linux-rockchip@lists.infradead.org, Oleksandr Andrushchenko , Vincent Abriou , Krzysztof Kozlowski , Jonathan Hunter , David Airlie , Chen-Yu Tsai , Kukjin Kim , NXP Linux Team , Dave Airlie , intel-gfx@lists.freedesktop.org, freedreno@lists.freedesktop.org, linux-tegra@vger.kernel.org, Jonas Karlman , linux-arm-msm@vger.kernel.org, Mamta Shukla , linux-mediatek@lists.infradead.org, Jyri Sarha , Rodrigo Vivi , Matthias Brugger , Thomas Gleixner , Sean Paul , Pengutronix Kernel Team , linux-arm-kernel@lists.infradead.org, Jernej Skrabec , amd-gfx@lists.freedesktop.org, Tomi Valkeinen , Thomas Zimmermann , Seung-Woo Kim , linux-kernel@vger.kernel.org, Todor Tomov , Kyungmin Park , Huang Rui , Alex Deucher , Shawn Guo , =?utf-8?q?Christian_K=C3=B6nig?= , Gerd Hoffmann MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP 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. The next 22 patches is an example 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 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 (23): drm: Include ddc adapter pointer in struct drm_connector 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 | 56 ++++++++----- drivers/gpu/drm/ast/ast_mode.c | 9 ++- drivers/gpu/drm/bridge/dumb-vga-dac.c | 19 +++-- drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 40 +++++----- drivers/gpu/drm/bridge/ti-tfp410.c | 19 +++-- drivers/gpu/drm/drm_sysfs.c | 7 ++ drivers/gpu/drm/exynos/exynos_hdmi.c | 11 ++- drivers/gpu/drm/i915/display/intel_hdmi.c | 5 +- drivers/gpu/drm/imx/imx-ldb.c | 13 ++- drivers/gpu/drm/imx/imx-tve.c | 8 +- drivers/gpu/drm/mediatek/mtk_hdmi.c | 9 +-- drivers/gpu/drm/mgag200/mgag200_mode.c | 9 ++- drivers/gpu/drm/msm/hdmi/hdmi_connector.c | 1 + drivers/gpu/drm/radeon/radeon_connectors.c | 80 ++++++++++++------- drivers/gpu/drm/rockchip/inno_hdmi.c | 17 ++-- drivers/gpu/drm/rockchip/rk3066_hdmi.c | 17 ++-- drivers/gpu/drm/sti/sti_hdmi.c | 1 + drivers/gpu/drm/sun4i/sun4i_hdmi.h | 1 - drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c | 14 ++-- drivers/gpu/drm/tegra/drm.h | 1 - drivers/gpu/drm/tegra/output.c | 12 +-- drivers/gpu/drm/tegra/sor.c | 6 +- drivers/gpu/drm/tilcdc/tilcdc_tfp410.c | 1 + drivers/gpu/drm/vc4/vc4_hdmi.c | 21 ++--- drivers/gpu/drm/zte/zx_hdmi.c | 25 +++--- drivers/gpu/drm/zte/zx_vga.c | 25 +++--- include/drm/drm_connector.h | 11 +++ 27 files changed, 240 insertions(+), 198 deletions(-)