All of lore.kernel.org
 help / color / mirror / Atom feed
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Sam Ravnborg <sam@ravnborg.org>
Cc: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>,
	dri-devel@lists.freedesktop.org,
	Jernej Skrabec <jernej.skrabec@siol.net>,
	Neil Armstrong <narmstrong@baylibre.com>,
	Jonas Karlman <jonas@kwiboo.se>,
	Kieran Bingham <kieran.bingham@ideasonboard.com>,
	linux-renesas-soc@vger.kernel.org,
	Andrzej Hajda <a.hajda@samsung.com>,
	Thomas Zimmermann <tzimmermann@suse.de>,
	Daniel Vetter <daniel@ffwll.ch>
Subject: Re: [PATCH 27/27] drm: Add default modes for connectors in unknown state
Date: Wed, 24 Jun 2020 04:12:09 +0300	[thread overview]
Message-ID: <20200624011209.GU5870@pendragon.ideasonboard.com> (raw)
In-Reply-To: <20200621084000.GM74146@ravnborg.org>

Hi Sam,

On Sun, Jun 21, 2020 at 10:40:00AM +0200, Sam Ravnborg wrote:
> On Tue, May 26, 2020 at 04:15:05AM +0300, Laurent Pinchart wrote:
> > The DRM CRTC helpers add default modes to connectors in the connected
> > state if no mode can be retrieved from the connector. This behaviour is
> > useful for VGA or DVI outputs that have no connected DDC bus. However,
> > in such cases, the status of the output usually can't be retrieved and
> > is reported as connector_status_unknown.
> > 
> > Extend the addition of default modes to connectors in an unknown state
> > to support outputs that can retrieve neither the modes nor the
> > connection status.
> > 
> > Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
> 
> From your description sounds like an OK approach.
> But this is not something I feel too familiar with.
> Acked-by: Sam Ravnborg <sam@ravnborg.org>

Thanks for the ack. I'd like to have Daniel's (CC'ed) feedback on this
too.

> > ---
> >  drivers/gpu/drm/drm_probe_helper.c       | 3 ++-
> >  include/drm/drm_modeset_helper_vtables.h | 8 +++++++-
> >  2 files changed, 9 insertions(+), 2 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/drm_probe_helper.c b/drivers/gpu/drm/drm_probe_helper.c
> > index f5d141e0400f..9055d9573c90 100644
> > --- a/drivers/gpu/drm/drm_probe_helper.c
> > +++ b/drivers/gpu/drm/drm_probe_helper.c
> > @@ -491,7 +491,8 @@ int drm_helper_probe_single_connector_modes(struct drm_connector *connector,
> >  	if (count == 0 && connector->status == connector_status_connected)
> >  		count = drm_add_override_edid_modes(connector);
> >  
> > -	if (count == 0 && connector->status == connector_status_connected)
> > +	if (count == 0 && (connector->status == connector_status_connected ||
> > +			   connector->status == connector_status_unknown))
> >  		count = drm_add_modes_noedid(connector, 1024, 768);
> >  	count += drm_helper_probe_add_cmdline_mode(connector);
> >  	if (count == 0)
> > diff --git a/include/drm/drm_modeset_helper_vtables.h b/include/drm/drm_modeset_helper_vtables.h
> > index 421a30f08463..afe55e2e93d2 100644
> > --- a/include/drm/drm_modeset_helper_vtables.h
> > +++ b/include/drm/drm_modeset_helper_vtables.h
> > @@ -876,13 +876,19 @@ struct drm_connector_helper_funcs {
> >  	 * The usual way to implement this is to cache the EDID retrieved in the
> >  	 * probe callback somewhere in the driver-private connector structure.
> >  	 * In this function drivers then parse the modes in the EDID and add
> > -	 * them by calling drm_add_edid_modes(). But connectors that driver a
> > +	 * them by calling drm_add_edid_modes(). But connectors that drive a
> >  	 * fixed panel can also manually add specific modes using
> >  	 * drm_mode_probed_add(). Drivers which manually add modes should also
> >  	 * make sure that the &drm_connector.display_info,
> >  	 * &drm_connector.width_mm and &drm_connector.height_mm fields are
> >  	 * filled in.
> >  	 *
> > +	 * Note that the caller function will automatically add standard VESA
> > +	 * DMT modes up to 1024x768 if the .get_modes() helper operation returns
> > +	 * no mode and if the connector status is connector_status_connected or
> > +	 * connector_status_unknown. There is no need to call
> > +	 * drm_add_edid_modes() manually in that case.
> > +	 *
> >  	 * Virtual drivers that just want some standard VESA mode with a given
> >  	 * resolution can call drm_add_modes_noedid(), and mark the preferred
> >  	 * one using drm_set_preferred_mode().

-- 
Regards,

Laurent Pinchart

WARNING: multiple messages have this Message-ID (diff)
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Sam Ravnborg <sam@ravnborg.org>
Cc: Jernej Skrabec <jernej.skrabec@siol.net>,
	Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>,
	Jonas Karlman <jonas@kwiboo.se>,
	Neil Armstrong <narmstrong@baylibre.com>,
	Kieran Bingham <kieran.bingham@ideasonboard.com>,
	dri-devel@lists.freedesktop.org,
	linux-renesas-soc@vger.kernel.org,
	Andrzej Hajda <a.hajda@samsung.com>,
	Thomas Zimmermann <tzimmermann@suse.de>
Subject: Re: [PATCH 27/27] drm: Add default modes for connectors in unknown state
Date: Wed, 24 Jun 2020 04:12:09 +0300	[thread overview]
Message-ID: <20200624011209.GU5870@pendragon.ideasonboard.com> (raw)
In-Reply-To: <20200621084000.GM74146@ravnborg.org>

Hi Sam,

On Sun, Jun 21, 2020 at 10:40:00AM +0200, Sam Ravnborg wrote:
> On Tue, May 26, 2020 at 04:15:05AM +0300, Laurent Pinchart wrote:
> > The DRM CRTC helpers add default modes to connectors in the connected
> > state if no mode can be retrieved from the connector. This behaviour is
> > useful for VGA or DVI outputs that have no connected DDC bus. However,
> > in such cases, the status of the output usually can't be retrieved and
> > is reported as connector_status_unknown.
> > 
> > Extend the addition of default modes to connectors in an unknown state
> > to support outputs that can retrieve neither the modes nor the
> > connection status.
> > 
> > Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
> 
> From your description sounds like an OK approach.
> But this is not something I feel too familiar with.
> Acked-by: Sam Ravnborg <sam@ravnborg.org>

Thanks for the ack. I'd like to have Daniel's (CC'ed) feedback on this
too.

> > ---
> >  drivers/gpu/drm/drm_probe_helper.c       | 3 ++-
> >  include/drm/drm_modeset_helper_vtables.h | 8 +++++++-
> >  2 files changed, 9 insertions(+), 2 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/drm_probe_helper.c b/drivers/gpu/drm/drm_probe_helper.c
> > index f5d141e0400f..9055d9573c90 100644
> > --- a/drivers/gpu/drm/drm_probe_helper.c
> > +++ b/drivers/gpu/drm/drm_probe_helper.c
> > @@ -491,7 +491,8 @@ int drm_helper_probe_single_connector_modes(struct drm_connector *connector,
> >  	if (count == 0 && connector->status == connector_status_connected)
> >  		count = drm_add_override_edid_modes(connector);
> >  
> > -	if (count == 0 && connector->status == connector_status_connected)
> > +	if (count == 0 && (connector->status == connector_status_connected ||
> > +			   connector->status == connector_status_unknown))
> >  		count = drm_add_modes_noedid(connector, 1024, 768);
> >  	count += drm_helper_probe_add_cmdline_mode(connector);
> >  	if (count == 0)
> > diff --git a/include/drm/drm_modeset_helper_vtables.h b/include/drm/drm_modeset_helper_vtables.h
> > index 421a30f08463..afe55e2e93d2 100644
> > --- a/include/drm/drm_modeset_helper_vtables.h
> > +++ b/include/drm/drm_modeset_helper_vtables.h
> > @@ -876,13 +876,19 @@ struct drm_connector_helper_funcs {
> >  	 * The usual way to implement this is to cache the EDID retrieved in the
> >  	 * probe callback somewhere in the driver-private connector structure.
> >  	 * In this function drivers then parse the modes in the EDID and add
> > -	 * them by calling drm_add_edid_modes(). But connectors that driver a
> > +	 * them by calling drm_add_edid_modes(). But connectors that drive a
> >  	 * fixed panel can also manually add specific modes using
> >  	 * drm_mode_probed_add(). Drivers which manually add modes should also
> >  	 * make sure that the &drm_connector.display_info,
> >  	 * &drm_connector.width_mm and &drm_connector.height_mm fields are
> >  	 * filled in.
> >  	 *
> > +	 * Note that the caller function will automatically add standard VESA
> > +	 * DMT modes up to 1024x768 if the .get_modes() helper operation returns
> > +	 * no mode and if the connector status is connector_status_connected or
> > +	 * connector_status_unknown. There is no need to call
> > +	 * drm_add_edid_modes() manually in that case.
> > +	 *
> >  	 * Virtual drivers that just want some standard VESA mode with a given
> >  	 * resolution can call drm_add_modes_noedid(), and mark the preferred
> >  	 * one using drm_set_preferred_mode().

-- 
Regards,

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

  reply	other threads:[~2020-06-24  1:12 UTC|newest]

Thread overview: 148+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-26  1:14 [PATCH 00/27] Converter R-Car DU to the DRM bridge connector helper Laurent Pinchart
2020-05-26  1:14 ` Laurent Pinchart
2020-05-26  1:14 ` [PATCH 01/27] drm: bridge: adv7511: Split EDID read to a separate function Laurent Pinchart
2020-05-26  1:14   ` Laurent Pinchart
2020-05-26  1:14 ` [PATCH 02/27] drm: bridge: adv7511: Split connector creation " Laurent Pinchart
2020-05-26  1:14   ` Laurent Pinchart
2020-05-26  1:14 ` [PATCH 03/27] drm: bridge: adv7511: Implement bridge connector operations Laurent Pinchart
2020-05-26  1:14   ` Laurent Pinchart
2020-06-21  8:25   ` Sam Ravnborg
2020-06-21  8:25     ` Sam Ravnborg
2020-05-26  1:14 ` [PATCH 04/27] drm: bridge: adv7511: Make connector creation optional Laurent Pinchart
2020-05-26  1:14   ` Laurent Pinchart
2020-05-26  1:14 ` [PATCH 05/27] drm: bridge: Return NULL on error from drm_bridge_get_edid() Laurent Pinchart
2020-05-26  1:14   ` Laurent Pinchart
2020-06-21  8:26   ` Sam Ravnborg
2020-06-21  8:26     ` Sam Ravnborg
2020-05-26  1:14 ` [PATCH 06/27] drm: bridge: simple-bridge: Delegate operations to next bridge Laurent Pinchart
2020-05-26  1:14   ` Laurent Pinchart
2020-05-26  1:14 ` [PATCH 07/27] drm: bridge: simple-bridge: Make connector creation optional Laurent Pinchart
2020-05-26  1:14   ` Laurent Pinchart
2020-05-26  1:14 ` [PATCH 08/27] drm: rcar-du: lvds: Convert to DRM panel bridge helper Laurent Pinchart
2020-05-26  1:14   ` Laurent Pinchart
2020-05-26  1:14 ` [PATCH 09/27] drm: edid: Constify connector argument to infoframe functions Laurent Pinchart
2020-05-26  1:14   ` Laurent Pinchart
2020-06-21  8:27   ` Sam Ravnborg
2020-06-21  8:27     ` Sam Ravnborg
2020-05-26  1:14 ` [PATCH 10/27] drm: bridge: Pass drm_display_info to drm_bridge_funcs .mode_valid() Laurent Pinchart
2020-05-26  1:14   ` Laurent Pinchart
2020-05-26 12:51   ` Neil Armstrong
2020-05-26 12:51     ` Neil Armstrong
2020-05-26 12:59   ` Boris Brezillon
2020-05-26 12:59     ` Boris Brezillon
2020-05-26 14:05   ` Guido Günther
2020-05-26 14:05     ` Guido Günther
2020-05-26  1:14 ` [PATCH 11/27] drm: bridge: dw-hdmi: Pass private data pointer to .mode_valid() Laurent Pinchart
2020-05-26  1:14   ` Laurent Pinchart
2020-05-26  1:14   ` Laurent Pinchart
2020-05-26  9:44   ` Neil Armstrong
2020-05-26  9:44     ` Neil Armstrong
2020-05-26  9:44     ` Neil Armstrong
2020-05-26  1:14 ` [PATCH 12/27] drm: bridge: dw-hdmi: Pass private data pointer to .configure_phy() Laurent Pinchart
2020-05-26  1:14   ` Laurent Pinchart
2020-05-26  9:45   ` Neil Armstrong
2020-05-26  9:45     ` Neil Armstrong
2020-05-26  1:14 ` [PATCH 13/27] drm: bridge: dw-hdmi: Remove unused field from dw_hdmi_plat_data Laurent Pinchart
2020-05-26  1:14   ` Laurent Pinchart
2020-05-26  9:45   ` Neil Armstrong
2020-05-26  9:45     ` Neil Armstrong
2020-05-26  1:14 ` [PATCH 14/27] drm: meson: dw-hdmi: Use dw_hdmi context to replace hack Laurent Pinchart
2020-05-26  1:14   ` Laurent Pinchart
2020-05-26  1:14   ` Laurent Pinchart
2020-05-26 12:32   ` Neil Armstrong
2020-05-26 12:32     ` Neil Armstrong
2020-05-26 12:32     ` Neil Armstrong
2020-05-26  1:14 ` [PATCH 15/27] drm: bridge: dw-hdmi: Pass drm_display_info to .mode_valid() Laurent Pinchart
2020-05-26  1:14   ` Laurent Pinchart
2020-05-26  1:14   ` Laurent Pinchart
2020-05-26  9:46   ` Neil Armstrong
2020-05-26  9:46     ` Neil Armstrong
2020-05-26  9:46     ` Neil Armstrong
2020-05-26  1:14 ` [PATCH 16/27] drm: bridge: dw-hdmi: Constify mode argument to dw_hdmi_phy_ops .init() Laurent Pinchart
2020-05-26  1:14   ` Laurent Pinchart
2020-05-26  1:14   ` Laurent Pinchart
2020-05-26  9:46   ` Neil Armstrong
2020-05-26  9:46     ` Neil Armstrong
2020-05-26  9:46     ` Neil Armstrong
2020-05-26  1:14 ` [PATCH 17/27] drm: bridge: dw-hdmi: Constify mode argument to internal functions Laurent Pinchart
2020-05-26  1:14   ` Laurent Pinchart
2020-05-26  9:46   ` Neil Armstrong
2020-05-26  9:46     ` Neil Armstrong
2020-05-26  1:14 ` [PATCH 18/27] drm: bridge: dw-hdmi: Pass drm_display_info to dw_hdmi_support_scdc() Laurent Pinchart
2020-05-26  1:14   ` Laurent Pinchart
2020-05-26  1:14   ` Laurent Pinchart
2020-05-26  9:48   ` Neil Armstrong
2020-05-26  9:48     ` Neil Armstrong
2020-05-26  9:48     ` Neil Armstrong
2020-05-26  1:14 ` [PATCH 19/27] drm: bridge: dw-hdmi: Split connector creation to a separate function Laurent Pinchart
2020-05-26  1:14   ` Laurent Pinchart
2020-05-26  9:49   ` Neil Armstrong
2020-05-26  9:49     ` Neil Armstrong
2020-05-26  1:14 ` [PATCH 20/27] drm: bridge: dw-hdmi: Store current connector in struct dw_hdmi Laurent Pinchart
2020-05-26  1:14   ` Laurent Pinchart
2020-05-26 12:29   ` Neil Armstrong
2020-05-26 12:29     ` Neil Armstrong
2020-05-26  1:14 ` [PATCH 21/27] drm: bridge: dw-hdmi: Pass drm_connector to internal functions as needed Laurent Pinchart
2020-05-26  1:14   ` Laurent Pinchart
2020-05-26 12:29   ` Neil Armstrong
2020-05-26 12:29     ` Neil Armstrong
2020-05-26  1:15 ` [PATCH 22/27] drm: bridge: dw-hdmi: Make connector creation optional Laurent Pinchart
2020-05-26  1:15   ` Laurent Pinchart
2020-05-26 12:35   ` Neil Armstrong
2020-05-26 12:35     ` Neil Armstrong
2020-06-07  1:19     ` Laurent Pinchart
2020-06-07  1:19       ` Laurent Pinchart
2020-05-26  1:15 ` [PATCH 23/27] drm: bridge: dw-hdmi: Attach to next bridge if available Laurent Pinchart
2020-05-26  1:15   ` Laurent Pinchart
2020-05-26 12:50   ` Neil Armstrong
2020-05-26 12:50     ` Neil Armstrong
2020-05-26 14:23     ` Jonas Karlman
2020-05-26 14:23       ` Jonas Karlman
2020-06-07  1:24       ` Laurent Pinchart
2020-06-07  1:24         ` Laurent Pinchart
2020-06-07  1:22     ` Laurent Pinchart
2020-06-07  1:22       ` Laurent Pinchart
2020-05-26  1:15 ` [PATCH 24/27] drm: rcar-du: dw-hdmi: Set output port number Laurent Pinchart
2020-05-26  1:15   ` Laurent Pinchart
2020-05-26  1:15 ` [PATCH 25/27] drm: rcar-du: Fix error handling in rcar_du_encoder_init() Laurent Pinchart
2020-05-26  1:15   ` Laurent Pinchart
2020-05-26  1:15 ` [PATCH 26/27] drm: rcar-du: Use drm_bridge_connector_init() helper Laurent Pinchart
2020-05-26  1:15   ` Laurent Pinchart
2020-05-26  1:15 ` [PATCH 27/27] drm: Add default modes for connectors in unknown state Laurent Pinchart
2020-05-26  1:15   ` Laurent Pinchart
2020-06-21  8:40   ` Sam Ravnborg
2020-06-21  8:40     ` Sam Ravnborg
2020-06-24  1:12     ` Laurent Pinchart [this message]
2020-06-24  1:12       ` Laurent Pinchart
2020-06-24  7:23       ` Daniel Vetter
2020-06-24  7:23         ` Daniel Vetter
2020-06-24 15:24         ` Alex Deucher
2020-06-24 15:24           ` Alex Deucher
2020-06-24 19:31           ` Daniel Vetter
2020-06-24 19:31             ` Daniel Vetter
2020-06-24 19:40             ` Alex Deucher
2020-06-24 19:40               ` Alex Deucher
2020-06-25  7:56               ` Daniel Vetter
2020-06-25  7:56                 ` Daniel Vetter
2020-06-25  7:57                 ` Daniel Vetter
2020-06-25  7:57                   ` Daniel Vetter
2020-06-25 10:31                   ` Pekka Paalanen
2020-06-25 10:31                     ` Pekka Paalanen
2020-06-25 10:44                     ` Daniel Vetter
2020-06-25 10:44                       ` Daniel Vetter
2020-06-26  8:59                       ` Pekka Paalanen
2020-06-26  8:59                         ` Pekka Paalanen
2020-06-26  9:25                         ` Daniel Stone
2020-06-26  9:25                           ` Daniel Stone
2020-06-26 13:35                           ` Daniel Vetter
2020-06-26 13:35                             ` Daniel Vetter
2020-06-24 22:47         ` Laurent Pinchart
2020-06-24 22:47           ` Laurent Pinchart
2020-06-23 18:55 ` [PATCH 00/27] Converter R-Car DU to the DRM bridge connector helper Sam Ravnborg
2020-06-23 18:55   ` Sam Ravnborg
2020-06-25  8:48   ` Liu Ying
2020-06-25  8:48     ` Liu Ying
2020-06-27 19:55     ` Sam Ravnborg
2020-06-27 19:55       ` Sam Ravnborg
2020-06-28  8:28       ` Laurent Pinchart
2020-06-28  8:28         ` 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=20200624011209.GU5870@pendragon.ideasonboard.com \
    --to=laurent.pinchart@ideasonboard.com \
    --cc=a.hajda@samsung.com \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jernej.skrabec@siol.net \
    --cc=jonas@kwiboo.se \
    --cc=kieran.bingham@ideasonboard.com \
    --cc=laurent.pinchart+renesas@ideasonboard.com \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=narmstrong@baylibre.com \
    --cc=sam@ravnborg.org \
    --cc=tzimmermann@suse.de \
    /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.