From: Daniel Vetter <daniel@ffwll.ch>
To: Andrzej Pietrasiewicz <andrzej.p@collabora.com>
Cc: linux-samsung-soc@vger.kernel.org,
Joonyoung Shim <jy0922.shim@samsung.com>,
Maxime Ripard <maxime.ripard@bootlin.com>,
Seung-Woo Kim <sw0312.kim@samsung.com>,
Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org,
Inki Dae <inki.dae@samsung.com>, David Airlie <airlied@linux.ie>,
Kyungmin Park <kyungmin.park@samsung.com>,
Kukjin Kim <kgene@kernel.org>,
Krzysztof Kozlowski <krzk@kernel.org>,
Daniel Vetter <daniel@ffwll.ch>,
kernel@collabora.com, Sean Paul <sean@poorly.run>,
linux-arm-kernel@lists.infradead.org, m.szyprowski@samsung.com
Subject: Re: [PATCH v2 1/2] drm: Include ddc adapter pointer in struct drm_connector
Date: Tue, 25 Jun 2019 16:21:49 +0200 [thread overview]
Message-ID: <20190625142149.GW12905@phenom.ffwll.local> (raw)
In-Reply-To: <ef88f682401ae863a91e6c885d83a2756ae20b85.1561458051.git.andrzej.p@collabora.com>
On Tue, Jun 25, 2019 at 12:24:40PM +0200, Andrzej Pietrasiewicz wrote:
> Add generic code which creates symbolic links in sysfs, pointing to ddc
> interface used by a particular video output. For example:
>
> 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
>
> This makes it easy for user to associate a display with its ddc adapter
> and use e.g. ddcutil to control the chosen monitor.
>
> This patch adds an i2c_adapter pointer to struct drm_connector. Particular
> drivers can then use it instead of using their own private instance. If a
> connector contains a ddc, then create a symbolic link in sysfs.
>
> Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@collabora.com>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
As mentioned in the other subthread, I think the important bit to sell
this is rolling it out to as many drivers as feasible and collecting all
the acks from driver maintainers.
-Daniel
> ---
> drivers/gpu/drm/drm_sysfs.c | 7 +++++++
> include/drm/drm_connector.h | 11 +++++++++++
> 2 files changed, 18 insertions(+)
>
> diff --git a/drivers/gpu/drm/drm_sysfs.c b/drivers/gpu/drm/drm_sysfs.c
> index ad10810bc972..26d359b39785 100644
> --- a/drivers/gpu/drm/drm_sysfs.c
> +++ b/drivers/gpu/drm/drm_sysfs.c
> @@ -294,6 +294,9 @@ int drm_sysfs_connector_add(struct drm_connector *connector)
> /* Let userspace know we have a new connector */
> drm_sysfs_hotplug_event(dev);
>
> + if (connector->ddc)
> + return sysfs_create_link(&connector->kdev->kobj,
> + &connector->ddc->dev.kobj, "ddc");
> return 0;
> }
>
> @@ -301,6 +304,10 @@ void drm_sysfs_connector_remove(struct drm_connector *connector)
> {
> if (!connector->kdev)
> return;
> +
> + if (connector->ddc)
> + sysfs_remove_link(&connector->kdev->kobj, "ddc");
> +
> DRM_DEBUG("removing \"%s\" from sysfs\n",
> connector->name);
>
> diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h
> index ca745d9feaf5..1ad3d1d54ba7 100644
> --- a/include/drm/drm_connector.h
> +++ b/include/drm/drm_connector.h
> @@ -23,6 +23,7 @@
> #ifndef __DRM_CONNECTOR_H__
> #define __DRM_CONNECTOR_H__
>
> +#include <linux/i2c.h>
> #include <linux/list.h>
> #include <linux/llist.h>
> #include <linux/ctype.h>
> @@ -1308,6 +1309,16 @@ struct drm_connector {
> * [0]: progressive, [1]: interlaced
> */
> int audio_latency[2];
> +
> + /**
> + * @ddc: associated ddc adapter.
> + * A connector usually has its associated ddc adapter. If a driver uses
> + * this field, then an appropriate symbolic link is created in connector
> + * sysfs directory to make it easy for the user to tell which i2c
> + * adapter is for a particular display.
> + */
> + struct i2c_adapter *ddc;
> +
> /**
> * @null_edid_counter: track sinks that give us all zeros for the EDID.
> * Needed to workaround some HW bugs where we get all 0s
> --
> 2.17.1
>
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2019-06-25 14:21 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-25 9:46 [PATCH 0/2] Associate ddc adapters with connectors Andrzej Pietrasiewicz
2019-06-25 9:46 ` [PATCH 1/2] drm: Include ddc adapter pointer in struct drm_connector Andrzej Pietrasiewicz
2019-06-25 9:46 ` [PATCH 2/2] drm/exynos: Provide ddc symlink in connector's sysfs Andrzej Pietrasiewicz
2019-06-25 10:03 ` [PATCH 0/2] Associate ddc adapters with connectors Russell King - ARM Linux admin
2019-06-25 10:14 ` Andrzej Pietrasiewicz
2019-06-25 10:16 ` Russell King - ARM Linux admin
2019-06-25 10:24 ` [PATCH v2 " Andrzej Pietrasiewicz
2019-06-25 10:24 ` [PATCH v2 1/2] drm: Include ddc adapter pointer in struct drm_connector Andrzej Pietrasiewicz
2019-06-25 14:21 ` Daniel Vetter [this message]
2019-06-25 10:24 ` [PATCH v2 2/2] drm/exynos: Provide ddc symlink in connector's sysfs Andrzej Pietrasiewicz
2019-06-25 13:36 ` [PATCH 0/2] Associate ddc adapters with connectors Emil Velikov
2019-06-25 14:07 ` Daniel Vetter
2019-06-25 14:10 ` Russell King - ARM Linux admin
2019-06-25 14:20 ` Daniel Vetter
2019-06-26 6:50 ` Andrzej Pietrasiewicz
[not found] ` <cover.1561735433.git.andrzej.p@collabora.com>
[not found] ` <d6381c020ea1c848a7044d830bdb0ec9663d1619.1561735433.git.andrzej.p@collabora.com>
[not found] ` <9b03d145-ec50-927c-55a8-dff1cd51d655@suse.de>
[not found] ` <cf1984e4-50af-302d-ef67-9ad530118c29@collabora.com>
[not found] ` <CGME20190701144119epcas1p211ec60b63f3c6ae02392e2ae67f1a4ba@epcas1p2.samsung.com>
[not found] ` <9e65f3c0-941d-d04c-5745-6b3a2965b990@suse.de>
2019-07-05 9:44 ` [PATCH v3 01/22] drm: Include ddc adapter pointer in struct drm_connector Andrzej Hajda
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190625142149.GW12905@phenom.ffwll.local \
--to=daniel@ffwll.ch \
--cc=airlied@linux.ie \
--cc=andrzej.p@collabora.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=inki.dae@samsung.com \
--cc=jy0922.shim@samsung.com \
--cc=kernel@collabora.com \
--cc=kgene@kernel.org \
--cc=krzk@kernel.org \
--cc=kyungmin.park@samsung.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-samsung-soc@vger.kernel.org \
--cc=m.szyprowski@samsung.com \
--cc=maarten.lankhorst@linux.intel.com \
--cc=maxime.ripard@bootlin.com \
--cc=sean@poorly.run \
--cc=sw0312.kim@samsung.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).