From: Boris Brezillon <boris.brezillon@collabora.com>
To: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: Maxime Ripard <maxime.ripard@bootlin.com>,
Tomi Valkeinen <tomi.valkeinen@ti.com>,
Sean Paul <sean@poorly.run>,
Sebastian Reichel <sebastian.reichel@collabora.com>,
dri-devel@lists.freedesktop.org
Subject: Re: [PATCH v2 13/50] drm/bridge: panel: Implement bridge connector operations
Date: Thu, 22 Aug 2019 20:02:47 +0200 [thread overview]
Message-ID: <20190822200247.13ce7d72@collabora.com> (raw)
In-Reply-To: <20190822163524.GE5027@pendragon.ideasonboard.com>
On Thu, 22 Aug 2019 19:35:24 +0300
Laurent Pinchart <laurent.pinchart@ideasonboard.com> wrote:
> Hi Boris,
>
> On Thu, Aug 22, 2019 at 06:29:09PM +0200, Boris Brezillon wrote:
> > On Tue, 20 Aug 2019 04:16:44 +0300 Laurent Pinchart wrote:
> >
> > > Implement the newly added bridge connector operations, allowing the
> > > usage of drm_bridge_panel with drm_bridge_connector.
> > >
> > > Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> > > ---
> > > drivers/gpu/drm/bridge/panel.c | 18 +++++++++++++++++-
> > > 1 file changed, 17 insertions(+), 1 deletion(-)
> > >
> > > diff --git a/drivers/gpu/drm/bridge/panel.c b/drivers/gpu/drm/bridge/panel.c
> > > index f5b8e55301ac..1c7f5b648f05 100644
> > > --- a/drivers/gpu/drm/bridge/panel.c
> > > +++ b/drivers/gpu/drm/bridge/panel.c
> > > @@ -60,7 +60,7 @@ static int panel_bridge_attach(struct drm_bridge *bridge,
> > > int ret;
> > >
> > > if (flags & DRM_BRIDGE_ATTACH_NO_CONNECTOR)
> > > - return -EINVAL;
> > > + return 0;
> > >
> > > if (!bridge->encoder) {
> > > DRM_ERROR("Missing encoder\n");
> > > @@ -123,6 +123,18 @@ static void panel_bridge_post_disable(struct drm_bridge *bridge)
> > > drm_panel_unprepare(panel_bridge->panel);
> > > }
> > >
> > > +static int panel_bridge_get_modes(struct drm_bridge *bridge,
> > > + struct drm_connector *connector)
> > > +{
> > > + struct panel_bridge *panel_bridge = drm_bridge_to_panel_bridge(bridge);
> > > +
> > > + /*
> > > + * FIXME: drm_panel_get_modes() should take the connector as an
> > > + * argument.
> > > + */
> > > + return drm_panel_get_modes(panel_bridge->panel);
> > > +}
> > > +
> > > static const struct drm_bridge_funcs panel_bridge_bridge_funcs = {
> > > .attach = panel_bridge_attach,
> > > .detach = panel_bridge_detach,
> > > @@ -130,6 +142,7 @@ static const struct drm_bridge_funcs panel_bridge_bridge_funcs = {
> > > .enable = panel_bridge_enable,
> > > .disable = panel_bridge_disable,
> > > .post_disable = panel_bridge_post_disable,
> > > + .get_modes = panel_bridge_get_modes,
> > > };
> > >
> > > /**
> > > @@ -175,6 +188,9 @@ struct drm_bridge *drm_panel_bridge_add(struct drm_panel *panel,
> > > #ifdef CONFIG_OF
> > > panel_bridge->bridge.of_node = panel->dev->of_node;
> > > #endif
> > > + panel_bridge->bridge.ops = DRM_BRIDGE_OP_MODES;
> > > + /* FIXME: The panel should report its type. */
> > > + panel_bridge->bridge.type = DRM_MODE_CONNECTOR_DPI;
> >
> > Shouldn't we patch all panel drivers to expose this type before doing
> > this change? I mean, the connector type is exposed to userspace, and I
> > wouldn't be surprised if some userspace apps/libs decided to base their
> > output selection logic on this field.
>
> Note that this type will only make it to userspace for drivers that use
> the bridge->type field, likely through the drm bridge connector helper.
> I do agree that panel drivers should be updated, but given the number of
> panels in panel-simple and the fact that the information would need to
> be researched for most of them, this will be significant work. Can't
> this be done when converting display controller drivers on a need basis
> ?
I think setting a default value and fixing things on a need basis is
okay, but that doesn't prevent you from adding the necessary
infrastructure to let panel drivers pass this type (we can fallback to a
default type in panel drivers instead of here). I'm also not sure why
'DPI' is chosen as the default, shouldn't we use 'Unknown' instead?
>
> Or maybe we could, as an interim measure, derive the type from the bus
> formats reported by the panel if the panel type is not set ? If the
> panel reports MEDIA_BUS_FMT_RGB666_1X7X3_SPWG,
> MEDIA_BUS_FMT_RGB666_1X7X4_SPWG or MEDIA_BUS_FMT_RGB888_1X7X4_JEIDA then
> we can set the type to LVDS, otherwise we set it to DPI.
Hm, aren't we better off patching panel descs exposing these bus formats
to also explicitly set desc->type to LVDS, leaving others to Unknown
(Unknown is 0, so you don't have to patch all panel_desc definitions)?
> I can submit a
> patch to add a type field to the panel structure and implement this
> logic.
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
next prev parent reply other threads:[~2019-08-22 18:02 UTC|newest]
Thread overview: 106+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-20 1:16 [PATCH v2 00/50] drm/omap: Replace custom display drivers with drm_bridge and drm_panel Laurent Pinchart
2019-08-20 1:16 ` [PATCH v2 01/50] video: hdmi: Change return type of hdmi_avi_infoframe_init() to void Laurent Pinchart
2019-08-20 11:18 ` Bartlomiej Zolnierkiewicz
2019-08-22 9:12 ` Boris Brezillon
2019-08-20 1:16 ` [PATCH v2 02/50] drm/connector: Add helper to get a connector type name Laurent Pinchart
2019-08-22 9:13 ` Boris Brezillon
2019-08-20 1:16 ` [PATCH v2 03/50] drm/edid: Add flag to drm_display_info to identify HDMI sinks Laurent Pinchart
2019-08-22 9:15 ` Boris Brezillon
2019-08-20 1:16 ` [PATCH v2 04/50] drm/bridge: Add connector-related bridge operations and data Laurent Pinchart
2019-08-22 15:24 ` Boris Brezillon
2019-08-22 16:41 ` Boris Brezillon
2019-08-23 0:34 ` Laurent Pinchart
2019-08-23 6:15 ` Boris Brezillon
2019-08-20 1:16 ` [PATCH v2 05/50] drm/bridge: Extend bridge API to disable connector creation Laurent Pinchart
2019-08-22 15:34 ` Boris Brezillon
2019-10-01 7:04 ` Tomi Valkeinen
2019-10-01 19:58 ` Laurent Pinchart
2019-08-20 1:16 ` [PATCH v2 06/50] drm/bridge: dumb-vga-dac: Rename internal symbols to simple-bridge Laurent Pinchart
2019-08-22 15:39 ` Boris Brezillon
2019-08-26 11:25 ` Maxime Ripard
2019-08-20 1:16 ` [PATCH v2 07/50] drm/bridge: dumb-vga-dac: Rename driver " Laurent Pinchart
2019-08-22 15:42 ` Boris Brezillon
2019-08-26 11:26 ` Maxime Ripard
2019-08-20 1:16 ` [PATCH v2 08/50] drm/bridge: simple-bridge: Add support for non-VGA bridges Laurent Pinchart
2019-08-22 15:43 ` Boris Brezillon
2019-08-26 11:27 ` Maxime Ripard
2019-08-20 1:16 ` [PATCH v2 09/50] drm/bridge: simple-bridge: Add support for enable GPIO Laurent Pinchart
2019-08-22 15:45 ` Boris Brezillon
2019-08-26 11:33 ` Maxime Ripard
2019-08-20 1:16 ` [PATCH v2 10/50] drm/bridge: simple-bridge: Add support for the TI OP362 Laurent Pinchart
2019-08-22 15:45 ` Boris Brezillon
2019-08-26 11:34 ` Maxime Ripard
2019-08-20 1:16 ` [PATCH v2 11/50] drm/bridge: Add bridge driver for display connectors Laurent Pinchart
2019-08-22 16:05 ` Boris Brezillon
2019-08-22 16:39 ` Laurent Pinchart
2019-08-26 11:36 ` Maxime Ripard
2019-08-20 1:16 ` [PATCH v2 12/50] drm/bridge: Add driver for the TI TPD12S015 HDMI level shifter Laurent Pinchart
2019-08-20 1:16 ` [PATCH v2 13/50] drm/bridge: panel: Implement bridge connector operations Laurent Pinchart
2019-08-20 10:37 ` Sam Ravnborg
2019-08-20 16:08 ` Laurent Pinchart
2019-10-03 5:56 ` Tomi Valkeinen
2019-10-09 19:24 ` Sam Ravnborg
2019-12-02 15:24 ` Laurent Pinchart
2019-08-22 16:29 ` Boris Brezillon
2019-08-22 16:35 ` Laurent Pinchart
2019-08-22 18:02 ` Boris Brezillon [this message]
2019-08-23 0:39 ` Laurent Pinchart
2019-08-20 1:16 ` [PATCH v2 14/50] drm/bridge: tfp410: Don't include drmP.h Laurent Pinchart
2019-08-22 16:11 ` Boris Brezillon
2019-08-20 1:16 ` [PATCH v2 15/50] drm/bridge: tfp410: Replace manual connector handling with bridge Laurent Pinchart
2019-08-22 16:36 ` Boris Brezillon
2019-08-22 16:54 ` Laurent Pinchart
2019-08-22 17:15 ` Boris Brezillon
2019-08-27 7:43 ` Tomi Valkeinen
2019-08-27 8:00 ` Laurent Pinchart
2019-08-20 1:16 ` [PATCH v2 16/50] drm/bridge: tfp410: Allow operation without drm_connector Laurent Pinchart
2019-08-22 18:17 ` Boris Brezillon
2019-08-20 1:16 ` [PATCH v2 17/50] drm: Add helper to create a connector for a chain of bridges Laurent Pinchart
2019-08-22 18:31 ` Boris Brezillon
2019-08-20 1:16 ` [PATCH v2 18/50] drm/omap: Simplify HDMI mode and infoframe configuration Laurent Pinchart
2019-08-20 1:16 ` [PATCH v2 19/50] drm/omap: Factor out display type to connector type conversion Laurent Pinchart
2019-08-20 1:16 ` [PATCH v2 20/50] drm/omap: Use the drm_panel_bridge API Laurent Pinchart
2019-08-20 1:16 ` [PATCH v2 21/50] drm/omap: dss: Fix output next device lookup in DT Laurent Pinchart
2019-08-20 1:16 ` [PATCH v2 22/50] drm/omap: Add infrastructure to support drm_bridge local to DSS outputs Laurent Pinchart
2019-08-20 1:16 ` [PATCH v2 23/50] drm/omap: dss: Make omap_dss_device_ops optional Laurent Pinchart
2019-08-20 1:16 ` [PATCH v2 24/50] drm/omap: hdmi: Allocate EDID in the .read_edid() operation Laurent Pinchart
2019-08-20 1:16 ` [PATCH v2 25/50] drm/omap: hdmi4: Rework EDID read to isolate data read Laurent Pinchart
2019-08-26 11:39 ` Tomi Valkeinen
2019-08-26 13:06 ` Laurent Pinchart
2019-08-20 1:16 ` [PATCH v2 26/50] drm/omap: hdmi5: " Laurent Pinchart
2019-08-20 1:16 ` [PATCH v2 27/50] drm/omap: hdmi4: Register a drm_bridge for EDID read Laurent Pinchart
2019-08-20 1:16 ` [PATCH v2 28/50] drm/omap: hdmi5: " Laurent Pinchart
2019-08-20 1:17 ` [PATCH v2 29/50] drm/omap: hdmi4: Move mode set, enable and disable operations to bridge Laurent Pinchart
2019-08-26 11:50 ` Tomi Valkeinen
2019-08-20 1:17 ` [PATCH v2 30/50] drm/omap: hdmi5: " Laurent Pinchart
2019-08-20 1:17 ` [PATCH v2 31/50] drm/omap: hdmi4: Implement drm_bridge .hpd_notify() operation Laurent Pinchart
2019-08-20 1:17 ` [PATCH v2 32/50] drm/omap: dss: Remove .set_hdmi_mode() and .set_infoframe() operations Laurent Pinchart
2019-08-20 1:17 ` [PATCH v2 33/50] drm/omap: venc: Register a drm_bridge Laurent Pinchart
2019-08-20 1:17 ` [PATCH v2 34/50] drm/omap: Create connector for bridges Laurent Pinchart
2019-08-22 17:00 ` Boris Brezillon
2019-08-22 23:41 ` Laurent Pinchart
2019-08-20 1:17 ` [PATCH v2 35/50] drm/omap: Switch the HDMI and VENC outputs to drm_bridge Laurent Pinchart
2019-08-20 1:17 ` [PATCH v2 36/50] drm/omap: Remove HPD, detect and EDID omapdss operations Laurent Pinchart
2019-08-20 1:17 ` [PATCH v2 37/50] drm/omap: hdmi: Remove omap_dss_device operations Laurent Pinchart
2019-08-20 1:17 ` [PATCH v2 38/50] drm/omap: venc: " Laurent Pinchart
2019-08-20 1:17 ` [PATCH v2 39/50] drm/omap: hdmi4: Simplify EDID read Laurent Pinchart
2019-08-20 1:17 ` [PATCH v2 40/50] drm/omap: hdmi5: " Laurent Pinchart
2019-08-20 1:17 ` [PATCH v2 41/50] drm/omap: dpi: Sort includes alphabetically Laurent Pinchart
2019-08-20 1:17 ` [PATCH v2 42/50] drm/omap: dpi: Reorder functions in sections Laurent Pinchart
2019-08-20 1:17 ` [PATCH v2 43/50] drm/omap: dpi: Simplify clock setting API Laurent Pinchart
2019-08-20 1:17 ` [PATCH v2 44/50] drm/omap: dpi: Register a drm_bridge Laurent Pinchart
2019-08-27 9:07 ` Hans Verkuil
2019-08-27 9:51 ` Laurent Pinchart
2019-08-27 10:48 ` Laurent Pinchart
2019-08-20 1:17 ` [PATCH v2 45/50] drm/omap: sdi: Sort includes alphabetically Laurent Pinchart
2019-08-20 1:17 ` [PATCH v2 46/50] drm/omap: sdi: Register a drm_bridge Laurent Pinchart
2019-08-20 1:17 ` [PATCH v2 47/50] drm/omap: Simplify connector implementation Laurent Pinchart
2019-08-20 1:17 ` [PATCH v2 48/50] drm/omap: dss: Remove unused omap_dss_device operations Laurent Pinchart
2019-08-20 1:17 ` [PATCH v2 49/50] drm/omap: dss: Inline the omapdss_display_get() function Laurent Pinchart
2019-08-20 1:17 ` [PATCH v2 50/50] drm/omap: dss: Remove unused omapdss_of_find_connected_device() function Laurent Pinchart
2019-08-26 12:15 ` [PATCH v2 00/50] drm/omap: Replace custom display drivers with drm_bridge and drm_panel Tomi Valkeinen
2019-08-26 13:51 ` Laurent Pinchart
2019-08-27 7:34 ` Tomi Valkeinen
2019-08-27 9:29 ` Laurent Pinchart
2019-08-27 9:32 ` Tomi Valkeinen
2019-08-27 9:40 ` 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=20190822200247.13ce7d72@collabora.com \
--to=boris.brezillon@collabora.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=laurent.pinchart@ideasonboard.com \
--cc=maxime.ripard@bootlin.com \
--cc=sean@poorly.run \
--cc=sebastian.reichel@collabora.com \
--cc=tomi.valkeinen@ti.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