From: Andrzej Hajda <a.hajda-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
To: Thomas Zimmermann <tzimmermann-l3A5Bk7waGM@public.gmane.org>,
Andrzej Pietrasiewicz
<andrzej.p-ZGY8ohtN/8qB+jHODAdFcQ@public.gmane.org>,
dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
Cc: David Airlie <airlied-cv59FeDIM0c@public.gmane.org>,
Krzysztof Kozlowski
<krzk-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
kernel-ZGY8ohtN/8qB+jHODAdFcQ@public.gmane.org,
"David (ChunMing) Zhou"
<David1.Zhou-5C7GfCeVMHo@public.gmane.org>,
linux-samsung-soc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-rockchip-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org,
Maxime Ripard
<maxime.ripard-LDxbnhwyfcJBDgjK7y7TUQ@public.gmane.org>,
Dave Airlie <airlied-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>,
Philipp Zabel <p.zabel-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>,
linux-arm-msm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
Sascha Hauer <s.hauer-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>,
Maarten Lankhorst
<maarten.lankhorst-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>,
Inki Dae <inki.dae-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>,
linux-mediatek-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
Daniel Vetter <daniel-/w4YWyX8dFk@public.gmane.org>,
Sean Paul <sean-p7yTbzM4H96eqtR555YLDQ@public.gmane.org>,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
freedreno-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org,
Seung-Woo Kim
<sw0312.kim-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
Pengutronix Kernel Team
<kernel-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>,
Alex Deucher <alexander.deucher-5C7GfCeVMHo@public.gmane.org>,
Shaw
Subject: Re: [PATCH v3 01/22] drm: Include ddc adapter pointer in struct drm_connector
Date: Fri, 5 Jul 2019 11:44:52 +0200 [thread overview]
Message-ID: <ef458f71-d061-4a8f-c53c-aa325b577d42@samsung.com> (raw)
In-Reply-To: <9e65f3c0-941d-d04c-5745-6b3a2965b990-l3A5Bk7waGM@public.gmane.org>
On 01.07.2019 16:41, Thomas Zimmermann wrote:
> Hi
>
> Am 01.07.19 um 15:27 schrieb Andrzej Pietrasiewicz:
>> Hi Thomas,
>>
>> Thank you for your comments. Please see inline.
>>
>> W dniu 30.06.2019 o 10:12, Thomas Zimmermann pisze:
>>> Hi
>>>
>>> I like the idea, but would prefer a more structured approach.
>>>
>>> Setting connector->ddc before calling drm_sysfs_connector_add() seems
>>> error prone. The dependency is not really clear from the code or
>>> interfaces.
>>>
>>> The other thing is that drivers I mostly work on, ast and mgag200, have
>>> code like this:
>>>
>>> struct ast_i2c_chan {
>>> struct i2c_adapter adapter;
>>> struct drm_device *dev;
>>> struct i2c_algo_bit_data bit;
>>> };
>>>
>>> struct ast_connector {
>>> struct drm_connector base;
>>> struct ast_i2c_chan *i2c;
>>> };
>>>
>>> It already encodes the connection between connector and ddc adapter.
>>>
>>> I suggest to introduce struct drm_i2c_adapter
>>>
>>> struct drm_i2c_adapter {
>>> struct i2c_adapter base;
>>> struct drm_connector *connector;
>>> };
>>>
>>> and convert drivers over to it. Ast would look like this:
>>>
>>> struct ast_i2c_chan {
>>> struct drm_i2c_adapter adapter;
>>> struct i2c_algo_bit_data bit;
>>> };
>>>
>> There are few flavors of these drivers. In some of them
>> the i2c_adapter for ddc is allocated and initialized by
>> the driver, which must provide a place in memory to hold
>> the adapter. ast is an example of this approach.
>>
>> But there are others, such as for example exynos_hdmi.c.
>> It gets its ddc adapter with of_find_i2c_adapter_by_node()
>> and merely stores a pointer to it, while not managing the
>> memory needed to hold the i2c_adapter.
> I see.
>
>> Do you have any idea how to accommodate these various
>> flavors of drivers in the scheme you propose?
> Something like
>
> struct drm_i2c_adapter {
> struct i2c_adapter *adapter;
> struct drm_connector *connector;
> };
>
> with adapter either being allocated dynamically or acquired via
> of_find_i2c_adapter_by_node(); with separate init and finish functions
> for each variant. But it looks like over-abstraction to me. Without
> prototyping the idea, I cannot say if it's worth the effort.
>
> For something more simple, maybe just have a function to attach an i2c
> adapter to a connector:
>
> drm_connector_attach_i2c_adapter(connector, i2c_adapter)
>
> which sets the connector's ddc pointer and creates the sysfs entry if
> the connector's entry is already present.
I am not sure if such function is really necessary. Assigning ddc field
before connector registration seems to be much simpler and quite
standard - many fields are initialized this way.
Reviewed-by: Andrzej Hajda <a.hajda@samsung.com>
--
Regards
Andrzej
> Best regards
> Thomas
>
>> Andrzej
>>
>>
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
next prev parent reply other threads:[~2019-07-05 9:44 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <3fb19371-db7d-f9dc-31a7-1ccd126f6784@collabora.com>
[not found] ` <3fb19371-db7d-f9dc-31a7-1ccd126f6784-ZGY8ohtN/8qB+jHODAdFcQ@public.gmane.org>
2019-06-28 16:01 ` [PATCH v3 00/22] Associate ddc adapters with connectors Andrzej Pietrasiewicz
[not found] ` <cover.1561735433.git.andrzej.p-ZGY8ohtN/8qB+jHODAdFcQ@public.gmane.org>
2019-06-28 16:01 ` [PATCH v3 01/22] drm: Include ddc adapter pointer in struct drm_connector Andrzej Pietrasiewicz
[not found] ` <d6381c020ea1c848a7044d830bdb0ec9663d1619.1561735433.git.andrzej.p-ZGY8ohtN/8qB+jHODAdFcQ@public.gmane.org>
2019-06-30 8:12 ` Thomas Zimmermann
[not found] ` <9b03d145-ec50-927c-55a8-dff1cd51d655-l3A5Bk7waGM@public.gmane.org>
2019-07-01 13:27 ` Andrzej Pietrasiewicz
[not found] ` <cf1984e4-50af-302d-ef67-9ad530118c29-ZGY8ohtN/8qB+jHODAdFcQ@public.gmane.org>
2019-07-01 14:41 ` Thomas Zimmermann
[not found] ` <9e65f3c0-941d-d04c-5745-6b3a2965b990-l3A5Bk7waGM@public.gmane.org>
2019-07-05 9:44 ` Andrzej Hajda [this message]
2019-06-28 16:01 ` [PATCH v3 02/22] drm/exynos: Provide ddc symlink in connector's sysfs Andrzej Pietrasiewicz
2019-06-28 16:01 ` [PATCH v3 03/22] drm: rockchip: Provide ddc symlink in rk3066_hdmi sysfs directory Andrzej Pietrasiewicz
2019-06-28 16:01 ` [PATCH v3 04/22] drm: rockchip: Provide ddc symlink in inno_hdmi " Andrzej Pietrasiewicz
2019-06-28 16:01 ` [PATCH v3 05/22] drm/msm/hdmi: Provide ddc symlink in hdmi connector " Andrzej Pietrasiewicz
2019-06-28 16:01 ` [PATCH v3 06/22] drm/sun4i: hdmi: Provide ddc symlink in sun4i " Andrzej Pietrasiewicz
2019-06-28 16:01 ` [PATCH v3 07/22] drm/mediatek: Provide ddc symlink in " Andrzej Pietrasiewicz
2019-06-28 16:01 ` [PATCH v3 08/22] drm/tegra: Provide ddc symlink in output " Andrzej Pietrasiewicz
2019-06-28 16:01 ` [PATCH v3 09/22] drm/imx: imx-ldb: Provide ddc symlink in connector's sysfs Andrzej Pietrasiewicz
2019-06-28 16:01 ` [PATCH v3 10/22] drm/imx: imx-tve: " Andrzej Pietrasiewicz
2019-06-28 16:01 ` [PATCH v3 11/22] drm/vc4: Provide ddc symlink in connector sysfs directory Andrzej Pietrasiewicz
2019-06-28 16:01 ` [PATCH v3 12/22] drm: zte: Provide ddc symlink in hdmi " Andrzej Pietrasiewicz
2019-06-28 16:01 ` [PATCH v3 13/22] drm: zte: Provide ddc symlink in vga " Andrzej Pietrasiewicz
2019-06-28 16:01 ` [PATCH v3 14/22] drm/tilcdc: Provide ddc symlink in " Andrzej Pietrasiewicz
2019-06-28 16:01 ` [PATCH v3 15/22] drm: sti: Provide ddc symlink in hdmi " Andrzej Pietrasiewicz
2019-06-28 16:01 ` [PATCH v3 16/22] drm/mgag200: Provide ddc symlink in " Andrzej Pietrasiewicz
2019-06-28 16:01 ` [PATCH v3 17/22] drm/ast: " Andrzej Pietrasiewicz
2019-06-28 16:01 ` [PATCH v3 18/22] drm/bridge: dumb-vga-dac: " Andrzej Pietrasiewicz
2019-06-28 16:01 ` [PATCH v3 19/22] drm/bridge: dw-hdmi: " Andrzej Pietrasiewicz
2019-06-28 16:01 ` [PATCH v3 20/22] drm/bridge: ti-tfp410: " Andrzej Pietrasiewicz
2019-06-28 16:01 ` [PATCH v3 21/22] drm/amdgpu: " Andrzej Pietrasiewicz
[not found] ` <5e355b8bec8fb3907566a741db8cc3e356246a32.1561735433.git.andrzej.p-ZGY8ohtN/8qB+jHODAdFcQ@public.gmane.org>
2019-07-02 20:54 ` Alex Deucher
[not found] ` <CADnq5_MrVoScVFgj3TP2Z+Ky8_32k=Cou5jebuMT5gE1+GZ0cA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2019-07-04 13:17 ` Andrzej Pietrasiewicz
[not found] ` <fc26ac17-dc18-f995-53cf-42b50754c916-ZGY8ohtN/8qB+jHODAdFcQ@public.gmane.org>
2019-07-05 20:17 ` Alex Deucher
2019-06-28 16:01 ` [PATCH v3 22/22] drm/radeon: " Andrzej Pietrasiewicz
2019-07-02 20:56 ` Alex Deucher
2019-06-28 16:45 ` [PATCH v3 00/22] Associate ddc adapters with connectors Daniel Vetter
[not found] ` <20190628164514.GS12905-dv86pmgwkMBes7Z6vYuT8azUEOm+Xw19@public.gmane.org>
2019-07-02 15:08 ` Emil Velikov
2019-06-28 16:11 ` Laurent Pinchart
[not found] ` <20190628161137.GH4779-N3hz7ZxfLydczECFQUw77jytWr6r+dGw0E9HWUfgJXw@public.gmane.org>
2019-07-05 8:38 ` Andrzej Pietrasiewicz
[not found] ` <44f98134-bc8a-133a-b702-589f007b175e-ZGY8ohtN/8qB+jHODAdFcQ@public.gmane.org>
2019-07-05 8:39 ` Laurent Pinchart
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=ef458f71-d061-4a8f-c53c-aa325b577d42@samsung.com \
--to=a.hajda-sze3o3uu22jbdgjk7y7tuq@public.gmane.org \
--cc=David1.Zhou-5C7GfCeVMHo@public.gmane.org \
--cc=airlied-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
--cc=airlied-cv59FeDIM0c@public.gmane.org \
--cc=alexander.deucher-5C7GfCeVMHo@public.gmane.org \
--cc=amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
--cc=andrzej.p-ZGY8ohtN/8qB+jHODAdFcQ@public.gmane.org \
--cc=daniel-/w4YWyX8dFk@public.gmane.org \
--cc=dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
--cc=freedreno-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
--cc=inki.dae-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org \
--cc=kernel-ZGY8ohtN/8qB+jHODAdFcQ@public.gmane.org \
--cc=kernel-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org \
--cc=krzk-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
--cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
--cc=linux-arm-msm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-mediatek-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
--cc=linux-rockchip-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
--cc=linux-samsung-soc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=maarten.lankhorst-VuQAYsv1563Yd54FQh9/CA@public.gmane.org \
--cc=maxime.ripard-LDxbnhwyfcJBDgjK7y7TUQ@public.gmane.org \
--cc=p.zabel-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org \
--cc=s.hauer-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org \
--cc=sean-p7yTbzM4H96eqtR555YLDQ@public.gmane.org \
--cc=sw0312.kim-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org \
--cc=tzimmermann-l3A5Bk7waGM@public.gmane.org \
/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