From: Archit Taneja <architt@codeaurora.org>
To: Boris Brezillon <boris.brezillon@free-electrons.com>
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
dri-devel@lists.freedesktop.org, lars@metafoo.de,
linux-arm-msm@vger.kernel.org, andy.green@linaro.org,
srinivas.kandagatla@linaro.org, Daniel Vetter <daniel@ffwll.ch>
Subject: Re: [PATCH 3/5] drm/i2c: adv7511: Refactor encoder slave functions
Date: Fri, 31 Jul 2015 16:08:35 +0530 [thread overview]
Message-ID: <55BB502B.1000004@codeaurora.org> (raw)
In-Reply-To: <20150731111250.2c6caa7a@bbrezillon>
On 07/31/2015 02:42 PM, Boris Brezillon wrote:
> Hi Archit,
>
> On Fri, 31 Jul 2015 10:56:20 +0530
> Archit Taneja <architt@codeaurora.org> wrote:
>
>> Hi Boris, Laurent,
>>
>> On 07/28/2015 08:08 PM, Boris Brezillon wrote:
>>> Archit, Laurent,
>>>
>>> On Tue, 28 Jul 2015 13:47:37 +0530
>>> Archit Taneja <architt@codeaurora.org> wrote:
>>>
>>>> Hi,
>>>>
>>>> On 07/27/2015 02:29 PM, Laurent Pinchart wrote:
>>>>> Hi Archit,
>>>>>
>>>>> (CC'ing Boris Brezillon)
>>>>>
>>>>> Thank you for the patch.
>>>>>
>>>>> On Monday 27 July 2015 11:46:57 Archit Taneja wrote:
>>>>>> ADV7511 is represented as an i2c drm slave encoder device. ADV7533, on
>>>>>> the other hand, is going be a normal i2c client device creating bridge
>>>>>> and connector entities.
>>>>>
>>>>> Please, no. It's really time to stop piling hacks and fix the problem
>>>>> properly. There's no reason to have separate APIs for I2C slave encoders and
>>>>> DRM bridges. Those two APIs need to be merged, and then you'll find it much
>>>>> easier to implement ADV7533 support.
>>>>
>>>> i2c slave encoders and bridges aren't exactly the same. slave encoders
>>>> are used when the there is no real 'encoder' in the display chain.
>>>> bridges are used when there is already an encoder available, and the
>>>> bridge entity represents another encoder in the chain.
>>>>
>>>> ADV7511 takes in RGB/MIPI DPI data, which is generally the output of a
>>>> crtc for drm drivers.
>>>>
>>>> ADV7533 takes in MIPI DSI data, which is generally the output of an
>>>> encoder for drm drivers.
>>>>
>>>> Therefore, having i2c slave encoder for the former and bridge for the
>>>> latter made sense to me.
>>>>
>>>> I do agree that it would be better if they were somehow merged. It
>>>> would prevent the fragmentation we currently have among encoder
>>>> chips.
>>>>
>>>> One possible way would be to convert slave encoder to bridge. With
>>>> this, an i2c slave encoder would be a 'dummy encoder' and a bridge.
>>>> i2c slave encoders even now just tie the slave encoder helper funcs
>>>> to encoder helper funcs. So it's not really any different.
>>>>
>>>> Merging these 2 entities would be nice, but we're still shying away
>>>> from the larger problem of creating generic encoder chains. The
>>>> ideal solution would be for bridges and slave encoders to just be
>>>> 'encoders', and the facility to connect on encoder output to the
>>>> input of another. I don't know how easy it is to do this, and
>>>> whether it'll break userspace.
>>>
>>> Yes, that's pretty much what I was trying to do.
>>> I'd also like to ease display pipelines creation by providing helper
>>> functions, so that display controller don't have to worry about encoders
>>> and connectors creation if these ones are attached to external encoders.
>>>
>>>>
>>>> Archit
>>>>
>>>>>
>>>>> Boris, I know you were experimenting with that, do you have anything to report
>>>>> ?
>>>
>>> Nope, I didn't work on it since last time we talked about it. I pushed
>>> my work here if you want to have a look [1].
>>
>> I went through the branch you shared. From what I understood, the
>> encoder chain comprises of one 'real' encoder object (drm_encoder) in
>> the 'drm_encoder_chain' struct. This drm_encoder encapsulates all the
>> 'encoder elements' forming the chain.
>>
>> I'm guessing the various dridge/slave encoder drivers would have to be
>> changed to now create a drm_encoder_element object, replacing
>> drm_bridge/drm_i2c_slave_encoder objects.
>>
>> One problem I see with this approach is that we can't use this when
>> the display controller already exposes a drm_encoder. I.e, it already
>> creates a drm_encoder object. If we want the encoder chain to be
>> connected to the output of this encoder, we'll need to link the 2
>> drm_encoders together, which isn't possible at the moment.
>
> Actually my goal was to move everybody to the drm_encoder_element model,
> even the encoder directly provided by the display controller IP.
> If the internal encoder is actually directly connected to a connector,
> then the encoder chain will just contain one element, but everything
> should work fine.
Okay. That approach makes sense.
It might be good to have a look at the current state of drm_bridge. We
need to probably make a call between extending bridges or starting with
encoder elements from scratch. Extending bridges might be less
intrusive. Although, encoder elements is more uniform. In bridges,
we'll be stuck with two entities: One encoder (drm_encoder), followed by
a chain of bridges.
>
>>
>> I guess we have two ways to go about this:
>>
>> 1) Have an approach like this where all the entities in the encoder
>> chain connect to just one encoder. We define the sequence in which
>> they are connected. The drm kms framework acts as if this chain
>> doesn't exist, and assumes that this is what the encoder is
>> outputting.
>
> Yep, that's pretty much what I've done. The main reason for doing that
> is to keep the interface with the userspace unchanged.
>
>>
>> 2) Make each element in the chain be a 'drm_encoder' object in itself.
>> This would be a more intrusive change, since drm_encoders are expected
>> to receive an input from crtc, and output to a connector. Furthermore,
>> it may confuse userspace what encoder to chose.
>
> That's why Laurent suggested to go for the 1st approach.
>
>>
>> For 1), we could either work more on your approach, or use drm_bridges.
>> drm_bridges can already be chained to each other, and bridge ops of each
>> bridge in the chain are called successively. It still relies
>> on the device drivers to form the chain, which is something your
>> approach takes care of by itself. But that's something that can be
>> extended for bridges too.
>
> Can we really chain several bridges ?
Yes. The support was recently added. We can link one bridge to another
via drm_bridge_attach(), by populating the bridge->next field.
The bridge helpers used in atomic_helper.c and crtc_helper.c
recursively call all the bridges in the chain.
>
> Also note that I plan to automate the encoder chain creation, or at
> least provide helper functions so that in standard cases the display
> controller does not have to bother creating its encoder chain.
> This is particularly true for platforms supporting DT, the encoder
> chain + connector can be declared in a generic way, and the core could
> provide helper functions to parse and create the encoder chain and the
> endpoint connector.
This would be quite useful.
>
>>
>> Laurent,
>>
>> Merging i2c slave encoders and bridges is possible, but there is no
>> guarantee that the new solution would be future proof and work well
>> with encoder chains. We needed more consensus from folks on
>> dri-devel.
>
> I'll let Laurent correct me if I'm wrong, but I think the plan was to
> move all slave encoders and bridges to the encoder element
> representation.
Some troubles I've had when working with encoder chains:
- There can be dependencies between two elements in the chain. For
example, an element in the chain might provide interface clocks for the
next element in the chain. The laterelement shouldn't even try to touch
its registers if the previous element isn't enabled.
- The sequence in which each encoder element needs to be called. Some
have to be first to last, others last to first.
- Some external encoder drivers(currently bridge, i2c slaves) create
their own connectors within the driver. If such an encoder is placed
in the middle of an encoder chain. It could lead to problems.
We might want to consider these (and probably more things) when working
on the solution.
Thanks,
Archit
--
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project
next prev parent reply other threads:[~2015-07-31 10:38 UTC|newest]
Thread overview: 89+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-27 6:16 [PATCH 0/5] drm/i2c: adv7511: ADV7533 support Archit Taneja
2015-07-27 6:16 ` [PATCH 1/5] drm/i2c: adv7511: Fix mutex deadlock when interrupts are disabled Archit Taneja
2015-07-27 6:16 ` [PATCH 2/5] drm/i2c: adv7511: Initial support for adv7533 Archit Taneja
2015-07-28 3:27 ` Bjorn Andersson
2015-08-03 5:39 ` Archit Taneja
2015-07-27 6:16 ` [PATCH 3/5] drm/i2c: adv7511: Refactor encoder slave functions Archit Taneja
2015-07-27 8:59 ` Laurent Pinchart
2015-07-28 8:17 ` Archit Taneja
2015-07-28 14:38 ` Boris Brezillon
2015-07-31 5:26 ` Archit Taneja
2015-07-31 9:12 ` Boris Brezillon
2015-07-31 10:38 ` Archit Taneja [this message]
2015-07-31 12:13 ` Rob Clark
2015-07-31 12:58 ` Boris Brezillon
2015-07-31 14:48 ` Rob Clark
2015-08-03 12:03 ` Andrzej Hajda
2015-08-03 14:04 ` Rob Clark
2015-08-04 5:16 ` Andrzej Hajda
2015-08-04 12:24 ` Rob Clark
2015-09-02 6:30 ` Archit Taneja
2015-12-03 15:02 ` Rob Clark
2015-12-03 15:28 ` Laurent Pinchart
2015-12-03 15:55 ` Rob Clark
2015-12-03 16:06 ` Laurent Pinchart
2015-12-03 16:11 ` Archit Taneja
2016-01-09 17:03 ` Archit Taneja
2015-07-27 6:16 ` [PATCH 4/5] drm/i2c: adv7511: Add drm_bridge/connector for ADV7533 Archit Taneja
2015-07-27 6:16 ` [PATCH 5/5] drm/i2c: adv7511: Create mipi_dsi_device " Archit Taneja
2015-09-07 11:36 ` [PATCH v2 0/5] drm/i2c: adv7511: ADV7533 support Archit Taneja
2015-09-07 11:36 ` [PATCH v2 1/5] drm/i2c: adv7511: Fix mutex deadlock when interrupts are disabled Archit Taneja
2015-09-07 11:36 ` [PATCH v2 2/5] drm/i2c: adv7511: Initial support for adv7533 Archit Taneja
2015-09-07 11:36 ` [PATCH v2 3/5] drm/i2c: adv7511: Refactor encoder slave functions Archit Taneja
2015-09-07 11:36 ` [PATCH v2 4/5] drm/i2c: adv7511: Add drm_bridge/connector for ADV7533 Archit Taneja
2015-09-07 11:36 ` [PATCH v2 5/5] drm/i2c: adv7511: Add dsi driver for adv7533 Archit Taneja
2016-03-09 10:57 ` [PATCH v3 0/7] drm/i2c: adv7511: ADV7533 support Archit Taneja
2016-03-09 10:57 ` [PATCH v3 1/7] drm/i2c: adv7511: Convert to drm_bridge Archit Taneja
2016-03-09 10:57 ` [PATCH v3 2/7] drm/i2c: adv7511: Fix mutex deadlock when interrupts are disabled Archit Taneja
2016-03-09 10:57 ` [PATCH v3 3/7] drm/i2c: adv7511: Initial support for ADV7533 Archit Taneja
2016-03-09 10:57 ` [PATCH v3 4/7] drm/i2c: adv7511: Create a MIPI DSI device Archit Taneja
2016-04-21 22:29 ` Laurent Pinchart
2016-04-22 5:10 ` Archit Taneja
2016-05-03 6:57 ` Archit Taneja
2016-05-09 20:38 ` Laurent Pinchart
2016-05-11 10:19 ` Archit Taneja
2016-03-09 10:57 ` [PATCH v3 5/7] drm/i2c: adv7511: Use internal timing generator Archit Taneja
2016-03-09 10:57 ` [PATCH v3 6/7] drm/i2c: adv7511: Change number of DSI lanes dynamically Archit Taneja
[not found] ` <1457521038-5906-1-git-send-email-architt-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2016-03-09 10:57 ` [PATCH v3 7/7] dt-bindings: drm/bridge: Update bindings for ADV7533 Archit Taneja
2016-03-17 19:12 ` Rob Herring
2016-04-21 22:32 ` Laurent Pinchart
2016-04-22 5:40 ` Archit Taneja
[not found] ` <5719B942.8070907-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2016-05-16 12:01 ` Laurent Pinchart
2016-05-17 3:43 ` Archit Taneja
2016-05-17 4:18 ` Xinliang Liu
2016-05-24 5:15 ` Archit Taneja
2016-04-14 14:56 ` [PATCH v3 0/7] drm/i2c: adv7511: ADV7533 support Archit Taneja
2016-04-21 22:33 ` Laurent Pinchart
2016-04-22 5:45 ` Archit Taneja
2016-04-17 11:31 ` Xinliang Liu
2016-04-18 9:48 ` Archit Taneja
2016-04-19 8:44 ` Xinliang Liu
2016-04-21 22:36 ` Laurent Pinchart
2016-04-22 5:44 ` Archit Taneja
2016-05-03 1:52 ` Xinliang Liu
2016-05-03 6:53 ` Archit Taneja
2016-05-16 10:41 ` [PATCH v4 " Archit Taneja
2016-05-16 10:41 ` [PATCH v4 1/7] drm/i2c: adv7511: Convert to drm_bridge Archit Taneja
2016-05-16 10:41 ` [PATCH v4 2/7] drm/i2c: adv7511: Fix mutex deadlock when interrupts are disabled Archit Taneja
2016-05-16 10:41 ` [PATCH v4 3/7] drm/i2c: adv7511: Initial support for ADV7533 Archit Taneja
2016-05-16 10:41 ` [PATCH v4 4/7] drm/i2c: adv7533: Create a MIPI DSI device Archit Taneja
2016-05-16 10:41 ` [PATCH v4 5/7] drm/i2c: adv7533: Use internal timing generator Archit Taneja
2016-05-16 10:41 ` [PATCH v4 6/7] drm/i2c: adv7533: Change number of DSI lanes dynamically Archit Taneja
2016-05-16 10:41 ` [PATCH v4 7/7] dt-bindings: drm/bridge: Update bindings for ADV7533 Archit Taneja
2016-06-08 10:27 ` [PATCH v5 0/7] drm/i2c: adv7511: ADV7533 support Archit Taneja
2016-06-08 10:27 ` [PATCH v5 1/7] drm/i2c: adv7511: Convert to drm_bridge Archit Taneja
2016-06-08 10:27 ` [PATCH v5 2/7] drm/i2c: adv7511: Fix mutex deadlock when interrupts are disabled Archit Taneja
2016-06-08 10:27 ` [PATCH v5 3/7] drm/i2c: adv7511: Initial support for ADV7533 Archit Taneja
2016-06-08 10:27 ` [PATCH v5 4/7] drm/i2c: adv7533: Create a MIPI DSI device Archit Taneja
2016-06-08 10:27 ` [PATCH v5 5/7] drm/i2c: adv7533: Use internal timing generator Archit Taneja
2016-06-08 10:27 ` [PATCH v5 6/7] drm/i2c: adv7533: Change number of DSI lanes dynamically Archit Taneja
2016-06-08 10:27 ` [PATCH v5 7/7] dt-bindings: drm/bridge: Update bindings for ADV7533 Archit Taneja
2016-06-17 7:53 ` [PATCH v6 0/8] drm/i2c: adv7511: ADV7533 support Archit Taneja
2016-06-17 7:53 ` [PATCH v6 1/8] drm/i2c: adv7511: Convert to drm_bridge Archit Taneja
2016-06-17 7:53 ` [PATCH v6 2/8] drm/i2c: adv7511: Move to bridge folder Archit Taneja
2016-06-17 7:53 ` [PATCH v6 3/8] drm/bridge: adv7511: Fix mutex deadlock when interrupts are disabled Archit Taneja
2016-06-17 7:53 ` [PATCH v6 4/8] drm/bridge: adv7533: Initial support for ADV7533 Archit Taneja
2016-06-17 7:53 ` [PATCH v6 5/8] drm/bridge: adv7533: Create a MIPI DSI device Archit Taneja
2016-06-17 7:53 ` [PATCH v6 6/8] drm/bridge: adv7533: Use internal timing generator Archit Taneja
2016-06-17 7:53 ` [PATCH v6 7/8] drm/bridge: adv7533: Change number of DSI lanes dynamically Archit Taneja
2016-06-17 7:53 ` [PATCH v6 8/8] dt-bindings: drm/bridge: Update bindings for ADV7533 Archit Taneja
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=55BB502B.1000004@codeaurora.org \
--to=architt@codeaurora.org \
--cc=andy.green@linaro.org \
--cc=boris.brezillon@free-electrons.com \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=lars@metafoo.de \
--cc=laurent.pinchart@ideasonboard.com \
--cc=linux-arm-msm@vger.kernel.org \
--cc=srinivas.kandagatla@linaro.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;
as well as URLs for NNTP newsgroup(s).