All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Anholt <eric@anholt.net>
To: Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
	Daniel Vetter <daniel@ffwll.ch>
Cc: Archit Taneja <architt@codeaurora.org>,
	dri-devel@lists.freedesktop.org,
	Yannick Fertre <yannick.fertre@st.com>,
	Thierry Reding <treding@nvidia.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] drm/bridge: Refactor out the panel wrapper from the lvds-encoder bridge.
Date: Wed, 03 May 2017 09:17:22 -0700	[thread overview]
Message-ID: <87tw51zzhp.fsf@eliezer.anholt.net> (raw)
In-Reply-To: <2463758.9HmFMyJbcQ@avalon>

[-- Attachment #1: Type: text/plain, Size: 4455 bytes --]

Laurent Pinchart <laurent.pinchart@ideasonboard.com> writes:

> Hi Daniel,
>
> On Wednesday 03 May 2017 16:28:56 Daniel Vetter wrote:
>> On Wed, May 03, 2017 at 12:36:06PM +0300, Laurent Pinchart wrote:
>> > On Wednesday 03 May 2017 11:32:17 Daniel Vetter wrote:
>> >> On Wed, May 03, 2017 at 02:53:00PM +0530, Archit Taneja wrote:
>> >>> +panel/bridge reviewers.
>> >>> 
>> >>> This does make things much cleaner, but it seems a bit strange to
>> >>> create a drm_bridge when there isn't really a HW bridge in the display
>> >>> chain (i.e, when the DSI encoder is directly connected to a DSI panel).
>> >>> 
>> >>> There are kms drivers that use drm_panel, but don't have simple stub
>> >>> connectors that wrap around a drm_panel. They have more complicated
>> >>> connector ops, and may call drm_panel_prepare() and related functions
>> >>> a bit differently. We won't be able to use drm_panel_bridge for those
>> >>> drivers.
>> >>> 
>> >>> For msm, we check whether the DSI encoder is connected directly to a
>> >>> panel or an external bridge. If it's connected to an external bridge,
>> >>> we skip the creation of the stub connector, and rely on the external
>> >>> bridge driver to create the connector:
>> >>> 
>> >>> http://lxr.free-electrons.com/source/drivers/gpu/drm/msm/dsi/dsi.c#L22
>> >>> 7
>> >>> 
>> >>> The msm solution isn't very neat, but it avoids the need to create
>> >>> another bridge to glue things together.
>> >> 
>> >> Since I suggested this, yes I like it. And I think just unconditionally
>> >> creating the panel bridge is probably even simpler, after all bridges
>> >> are supposed to be chainable. I guess there's always going to be drivers
>> >> where we need special handling, but I'm kinda hoping that for most cases
>> >> simply plugging in a panel bridge is all that's need to glue drm_panel
>> >> support into a driver. The simple pipe helpers do support bridges, and
>> >> part of the goal there very much was to make it easy to glue in panel
>> >> drivers.
>> > 
>> > As I've just explained in another reply, I don't see the point in doing
>> > this when we can instead refactor the bridge and panel operations to
>> > expose a common base object that will then be easy to handle in core
>> > code. This isn't just for panels, as connectors should have DT nodes, it
>> > makes sense to instantiate an object for them that can be handled by the
>> > DRM core, without having to push connector handling in all bridge
>> > drivers.
>> 
>> Imo you're aiming too high. We have 21 bridge drivers and 11 panel
>> drivers. Asking someone to refactor them all (plus all the callers and
>> everything) means it won't happen. At least I personally will definitely
>> not block a contribution on this happening, that's a totally outsized
>> demand.
>
> I think you're aiming too low. When the atomic update API was introduced I 
> could have told you that converting all drivers was an impossible task ;-)
>
> Jokes aside, I believe it might be possible to implement something simple. I'm 
> flexible about the naming, so instead of creating a new base structure and 
> refactor drm_bridge and drm_panel to embed it, we could as a first step use 
> drm_bridge as that base structure. We would only need to embed a drm_bridge 
> instance in drm_panel and add a few connector-related operations to the bridge 
> ops structure. As existing bridge drivers wouldn't need to provide those new 
> ops, they wouldn't need to be touched.

I think drm_bridge itself should be the base structure, as it is today.
It's got the entrypoints we want, connected in at the right level in the
modeset chain.  You could call it the "drm_display_chain_link" or
something, but "bridge" is short and I don't think renaming is worth the
trouble.  This helper just makes it easy to make one of these display
chain links for the endpoint of your display chain when it's a
drm_panel.

One of the followons I'd like to see after this is to make a helper that
drivers get to use that does the "grab a bridge?  no?  grab a panel?
Ok? wrap it in a bridge" pattern.  Then the drm_panel/drm_connector are
an implementation detail of whatever is at the end of the chain, and not
something that the middle of the chain needs to know about.

The alternative to that that I see would be to have panel drivers call
this code to advertise themselves through the list of bridges.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

WARNING: multiple messages have this Message-ID (diff)
From: Eric Anholt <eric@anholt.net>
To: Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
	Daniel Vetter <daniel@ffwll.ch>
Cc: Yannick Fertre <yannick.fertre@st.com>,
	Thierry Reding <treding@nvidia.com>,
	linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org
Subject: Re: [PATCH 1/2] drm/bridge: Refactor out the panel wrapper from the lvds-encoder bridge.
Date: Wed, 03 May 2017 09:17:22 -0700	[thread overview]
Message-ID: <87tw51zzhp.fsf@eliezer.anholt.net> (raw)
In-Reply-To: <2463758.9HmFMyJbcQ@avalon>


[-- Attachment #1.1: Type: text/plain, Size: 4455 bytes --]

Laurent Pinchart <laurent.pinchart@ideasonboard.com> writes:

> Hi Daniel,
>
> On Wednesday 03 May 2017 16:28:56 Daniel Vetter wrote:
>> On Wed, May 03, 2017 at 12:36:06PM +0300, Laurent Pinchart wrote:
>> > On Wednesday 03 May 2017 11:32:17 Daniel Vetter wrote:
>> >> On Wed, May 03, 2017 at 02:53:00PM +0530, Archit Taneja wrote:
>> >>> +panel/bridge reviewers.
>> >>> 
>> >>> This does make things much cleaner, but it seems a bit strange to
>> >>> create a drm_bridge when there isn't really a HW bridge in the display
>> >>> chain (i.e, when the DSI encoder is directly connected to a DSI panel).
>> >>> 
>> >>> There are kms drivers that use drm_panel, but don't have simple stub
>> >>> connectors that wrap around a drm_panel. They have more complicated
>> >>> connector ops, and may call drm_panel_prepare() and related functions
>> >>> a bit differently. We won't be able to use drm_panel_bridge for those
>> >>> drivers.
>> >>> 
>> >>> For msm, we check whether the DSI encoder is connected directly to a
>> >>> panel or an external bridge. If it's connected to an external bridge,
>> >>> we skip the creation of the stub connector, and rely on the external
>> >>> bridge driver to create the connector:
>> >>> 
>> >>> http://lxr.free-electrons.com/source/drivers/gpu/drm/msm/dsi/dsi.c#L22
>> >>> 7
>> >>> 
>> >>> The msm solution isn't very neat, but it avoids the need to create
>> >>> another bridge to glue things together.
>> >> 
>> >> Since I suggested this, yes I like it. And I think just unconditionally
>> >> creating the panel bridge is probably even simpler, after all bridges
>> >> are supposed to be chainable. I guess there's always going to be drivers
>> >> where we need special handling, but I'm kinda hoping that for most cases
>> >> simply plugging in a panel bridge is all that's need to glue drm_panel
>> >> support into a driver. The simple pipe helpers do support bridges, and
>> >> part of the goal there very much was to make it easy to glue in panel
>> >> drivers.
>> > 
>> > As I've just explained in another reply, I don't see the point in doing
>> > this when we can instead refactor the bridge and panel operations to
>> > expose a common base object that will then be easy to handle in core
>> > code. This isn't just for panels, as connectors should have DT nodes, it
>> > makes sense to instantiate an object for them that can be handled by the
>> > DRM core, without having to push connector handling in all bridge
>> > drivers.
>> 
>> Imo you're aiming too high. We have 21 bridge drivers and 11 panel
>> drivers. Asking someone to refactor them all (plus all the callers and
>> everything) means it won't happen. At least I personally will definitely
>> not block a contribution on this happening, that's a totally outsized
>> demand.
>
> I think you're aiming too low. When the atomic update API was introduced I 
> could have told you that converting all drivers was an impossible task ;-)
>
> Jokes aside, I believe it might be possible to implement something simple. I'm 
> flexible about the naming, so instead of creating a new base structure and 
> refactor drm_bridge and drm_panel to embed it, we could as a first step use 
> drm_bridge as that base structure. We would only need to embed a drm_bridge 
> instance in drm_panel and add a few connector-related operations to the bridge 
> ops structure. As existing bridge drivers wouldn't need to provide those new 
> ops, they wouldn't need to be touched.

I think drm_bridge itself should be the base structure, as it is today.
It's got the entrypoints we want, connected in at the right level in the
modeset chain.  You could call it the "drm_display_chain_link" or
something, but "bridge" is short and I don't think renaming is worth the
trouble.  This helper just makes it easy to make one of these display
chain links for the endpoint of your display chain when it's a
drm_panel.

One of the followons I'd like to see after this is to make a helper that
drivers get to use that does the "grab a bridge?  no?  grab a panel?
Ok? wrap it in a bridge" pattern.  Then the drm_panel/drm_connector are
an implementation detail of whatever is at the end of the chain, and not
something that the middle of the chain needs to know about.

The alternative to that that I see would be to have panel drivers call
this code to advertise themselves through the list of bridges.

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

[-- Attachment #2: Type: text/plain, Size: 160 bytes --]

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2017-05-03 16:17 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-27 16:36 [PATCH 1/2] drm/bridge: Refactor out the panel wrapper from the lvds-encoder bridge Eric Anholt
2017-04-27 16:36 ` Eric Anholt
2017-04-27 16:36 ` [PATCH 2/2] drm/vc4: Switch to using the panel-bridge layer, and support bridges Eric Anholt
2017-04-27 16:36   ` Eric Anholt
2017-04-27 17:27 ` [PATCH 1/2] drm/bridge: Refactor out the panel wrapper from the lvds-encoder bridge Eric Anholt
2017-04-27 17:27   ` Eric Anholt
2017-05-03  9:23 ` Archit Taneja
2017-05-03  9:23   ` Archit Taneja
2017-05-03  9:32   ` Laurent Pinchart
2017-05-03  9:32     ` Laurent Pinchart
2017-05-03  9:32   ` Daniel Vetter
2017-05-03  9:32     ` Daniel Vetter
2017-05-03  9:36     ` Laurent Pinchart
2017-05-03  9:36       ` Laurent Pinchart
2017-05-03 14:28       ` Daniel Vetter
2017-05-03 14:28         ` Daniel Vetter
2017-05-03 14:44         ` Laurent Pinchart
2017-05-03 14:44           ` Laurent Pinchart
2017-05-03 16:17           ` Eric Anholt [this message]
2017-05-03 16:17             ` Eric Anholt
2017-05-04  5:44             ` Daniel Vetter
2017-05-04  5:44               ` Daniel Vetter
2017-05-04 12:35               ` Thierry Reding
2017-05-04 12:35                 ` Thierry Reding
2017-05-05  6:22                 ` Andrzej Hajda
2017-05-05  6:22                   ` Andrzej Hajda
2017-05-03 16:30   ` Eric Anholt
2017-05-03 16:30     ` Eric Anholt
2017-05-04  8:58     ` Archit Taneja
2017-05-04  8:58       ` Archit Taneja
2017-05-03  9:36 ` Daniel Vetter
2017-05-03  9:36   ` Daniel Vetter

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=87tw51zzhp.fsf@eliezer.anholt.net \
    --to=eric@anholt.net \
    --cc=architt@codeaurora.org \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=treding@nvidia.com \
    --cc=yannick.fertre@st.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.