diff mbox series

[3/7] drm/edid: Allow to ignore the HDMI monitor mode

Message ID b346467ee3b9f2b6651e269886cbbdfa94b96b54.1551711042.git-series.maxime.ripard@bootlin.com (mailing list archive)
State New, archived
Headers show
Series drm/vc4: Allow for more boot-time configuration | expand

Commit Message

Maxime Ripard March 4, 2019, 2:52 p.m. UTC
Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
---
 drivers/gpu/drm/drm_edid.c | 8 ++++++++
 1 file changed, 8 insertions(+)

Comments

Paul Kocialkowski March 4, 2019, 3:14 p.m. UTC | #1
Hi,

On Mon, 2019-03-04 at 15:52 +0100, Maxime Ripard wrote:
> Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>

Reviewed-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>

Cheers,

Paul

> ---
>  drivers/gpu/drm/drm_edid.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
> index c0258b011bb2..2f6df10ed9f1 100644
> --- a/drivers/gpu/drm/drm_edid.c
> +++ b/drivers/gpu/drm/drm_edid.c
> @@ -4156,6 +4156,11 @@ int drm_av_sync_delay(struct drm_connector *connector,
>  }
>  EXPORT_SYMBOL(drm_av_sync_delay);
>  
> +static bool force_dvi_monitor = false;
> +module_param(force_dvi_monitor, bool, 0644);
> +MODULE_PARM_DESC(force_dvi_monitor,
> +		 "Ignore the EDID and always consider the monitor as DVI instead of HDMI");
> +
>  /**
>   * drm_detect_hdmi_monitor - detect whether monitor is HDMI
>   * @edid: monitor EDID information
> @@ -4170,6 +4175,9 @@ bool drm_detect_hdmi_monitor(struct edid *edid)
>  	int i;
>  	int start_offset, end_offset;
>  
> +	if (force_dvi_monitor)
> +		return false;
> +
>  	edid_ext = drm_find_cea_extension(edid);
>  	if (!edid_ext)
>  		return false;
Jani Nikula March 4, 2019, 3:48 p.m. UTC | #2
On Mon, 04 Mar 2019, Maxime Ripard <maxime.ripard@bootlin.com> wrote:
> Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
> ---
>  drivers/gpu/drm/drm_edid.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
>
> diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
> index c0258b011bb2..2f6df10ed9f1 100644
> --- a/drivers/gpu/drm/drm_edid.c
> +++ b/drivers/gpu/drm/drm_edid.c
> @@ -4156,6 +4156,11 @@ int drm_av_sync_delay(struct drm_connector *connector,
>  }
>  EXPORT_SYMBOL(drm_av_sync_delay);
>  
> +static bool force_dvi_monitor = false;
> +module_param(force_dvi_monitor, bool, 0644);
> +MODULE_PARM_DESC(force_dvi_monitor,
> +		 "Ignore the EDID and always consider the monitor as DVI instead of HDMI");
> +

Same reply as with patch 2/7.

BR,
Jani.

>  /**
>   * drm_detect_hdmi_monitor - detect whether monitor is HDMI
>   * @edid: monitor EDID information
> @@ -4170,6 +4175,9 @@ bool drm_detect_hdmi_monitor(struct edid *edid)
>  	int i;
>  	int start_offset, end_offset;
>  
> +	if (force_dvi_monitor)
> +		return false;
> +
>  	edid_ext = drm_find_cea_extension(edid);
>  	if (!edid_ext)
>  		return false;
Eric Anholt March 4, 2019, 8:02 p.m. UTC | #3
Maxime Ripard <maxime.ripard@bootlin.com> writes:

> Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>

Googling for users of the firmware's hdmi_drive= flag, I'm seeing lots
of people with hdmi_drive=2 (force HDMI mode) due to Raspberry Pi not
allowing HDMI audio with DMT modes, which it looks like DRM does allow.

The only users of hdmi_drive=1 (force HDMI mode) I'm seeing are people
setting things up for non-EDID monitors, but I think the expectation in
DRM is that people would provide an EDID.  So, I'm not sure it makes
sense to support an equivalent of this flag?  Or, it should probably be
part of specifying a custom mode on the command line.
Maxime Ripard March 5, 2019, 9:24 a.m. UTC | #4
Hi Eric,

On Mon, Mar 04, 2019 at 12:02:16PM -0800, Eric Anholt wrote:
> Maxime Ripard <maxime.ripard@bootlin.com> writes:
> 
> > Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
> 
> Googling for users of the firmware's hdmi_drive= flag, I'm seeing lots
> of people with hdmi_drive=2 (force HDMI mode) due to Raspberry Pi not
> allowing HDMI audio with DMT modes, which it looks like DRM does allow.
> 
> The only users of hdmi_drive=1 (force HDMI mode) I'm seeing are people
> setting things up for non-EDID monitors, but I think the expectation in
> DRM is that people would provide an EDID.  So, I'm not sure it makes
> sense to support an equivalent of this flag?  Or, it should probably be
> part of specifying a custom mode on the command line.

That would be adding one more check before registering the card, or
even coming up with something else entirely to mark the output as
non-working at the moment.

Maybe we should start the discussion with Mark Brown about this, and
see what his opinion is?

Maxime
diff mbox series

Patch

diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
index c0258b011bb2..2f6df10ed9f1 100644
--- a/drivers/gpu/drm/drm_edid.c
+++ b/drivers/gpu/drm/drm_edid.c
@@ -4156,6 +4156,11 @@  int drm_av_sync_delay(struct drm_connector *connector,
 }
 EXPORT_SYMBOL(drm_av_sync_delay);
 
+static bool force_dvi_monitor = false;
+module_param(force_dvi_monitor, bool, 0644);
+MODULE_PARM_DESC(force_dvi_monitor,
+		 "Ignore the EDID and always consider the monitor as DVI instead of HDMI");
+
 /**
  * drm_detect_hdmi_monitor - detect whether monitor is HDMI
  * @edid: monitor EDID information
@@ -4170,6 +4175,9 @@  bool drm_detect_hdmi_monitor(struct edid *edid)
 	int i;
 	int start_offset, end_offset;
 
+	if (force_dvi_monitor)
+		return false;
+
 	edid_ext = drm_find_cea_extension(edid);
 	if (!edid_ext)
 		return false;