diff mbox

drm/edid: Reset more of the display info

Message ID 20180424130250.7028-1-ville.syrjala@linux.intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Ville Syrjälä April 24, 2018, 1:02 p.m. UTC
From: Ville Syrjälä <ville.syrjala@linux.intel.com>

We're currently failing to reset everything in display_info.hdmi
which will potentially cause us to use stale information when
swapping monitors. Eg. if the user replaces a HDMI 2.0 monitor
with a HDMI 1.x monitor we will continue to think that the monitor
supports scrambling. That will lead to a black screen since the
HDMI 1.x monitor won't understand the scrambled signal.

Fix the problem by clearing display_info.hdmi fully. And while at
eliminate some duplicated code by calling drm_reset_display_info()
in drm_add_display_info().

Cc: Antony Chen <antonychen@qnap.com>
Cc: Shashank Sharma <shashank.sharma@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=105655
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 drivers/gpu/drm/drm_edid.c | 11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)

Comments

Daniel Vetter April 24, 2018, 2:18 p.m. UTC | #1
On Tue, Apr 24, 2018 at 04:02:50PM +0300, Ville Syrjala wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> 
> We're currently failing to reset everything in display_info.hdmi
> which will potentially cause us to use stale information when
> swapping monitors. Eg. if the user replaces a HDMI 2.0 monitor
> with a HDMI 1.x monitor we will continue to think that the monitor
> supports scrambling. That will lead to a black screen since the
> HDMI 1.x monitor won't understand the scrambled signal.
> 
> Fix the problem by clearing display_info.hdmi fully. And while at
> eliminate some duplicated code by calling drm_reset_display_info()
> in drm_add_display_info().
> 
> Cc: Antony Chen <antonychen@qnap.com>
> Cc: Shashank Sharma <shashank.sharma@intel.com>
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=105655
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> ---
>  drivers/gpu/drm/drm_edid.c | 11 +++--------
>  1 file changed, 3 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
> index 134069f36482..39f1db4acda4 100644
> --- a/drivers/gpu/drm/drm_edid.c
> +++ b/drivers/gpu/drm/drm_edid.c
> @@ -4451,6 +4451,7 @@ drm_reset_display_info(struct drm_connector *connector)
>  	info->max_tmds_clock = 0;
>  	info->dvi_dual = false;
>  	info->has_hdmi_infoframe = false;
> +	memset(&info->hdmi, 0, sizeof(info->hdmi));
>  
>  	info->non_desktop = 0;
>  }
> @@ -4462,17 +4463,11 @@ u32 drm_add_display_info(struct drm_connector *connector, const struct edid *edi
>  
>  	u32 quirks = edid_get_quirks(edid);
>  
> +	drm_reset_display_info(connector);
> +

Strictly speaking this is a separate bugfix, for the case where you
immediately go from one output to a different one. Keith already fixed the
case where at least somewhere in between you go to the disconnected state
in:

commit 170178fe99dd212bf25e70c89bc4b6e195564ffc
Author: Keith Packard <keithp@keithp.com>
Date:   Wed Dec 13 00:44:26 2017 -0800

    drm: Update edid-derived drm_display_info fields at edid property set [v2]

With the above explained in the commit message:

Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>

>  	info->width_mm = edid->width_cm * 10;
>  	info->height_mm = edid->height_cm * 10;
>  
> -	/* driver figures it out in this case */
> -	info->bpc = 0;
> -	info->color_formats = 0;
> -	info->cea_rev = 0;
> -	info->max_tmds_clock = 0;
> -	info->dvi_dual = false;
> -	info->has_hdmi_infoframe = false;
> -
>  	info->non_desktop = !!(quirks & EDID_QUIRK_NON_DESKTOP);
>  
>  	DRM_DEBUG_KMS("non_desktop set to %d\n", info->non_desktop);
> -- 
> 2.16.1
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Ville Syrjälä April 24, 2018, 2:26 p.m. UTC | #2
On Tue, Apr 24, 2018 at 04:18:37PM +0200, Daniel Vetter wrote:
> On Tue, Apr 24, 2018 at 04:02:50PM +0300, Ville Syrjala wrote:
> > From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > 
> > We're currently failing to reset everything in display_info.hdmi
> > which will potentially cause us to use stale information when
> > swapping monitors. Eg. if the user replaces a HDMI 2.0 monitor
> > with a HDMI 1.x monitor we will continue to think that the monitor
> > supports scrambling. That will lead to a black screen since the
> > HDMI 1.x monitor won't understand the scrambled signal.
> > 
> > Fix the problem by clearing display_info.hdmi fully. And while at
> > eliminate some duplicated code by calling drm_reset_display_info()
> > in drm_add_display_info().
> > 
> > Cc: Antony Chen <antonychen@qnap.com>
> > Cc: Shashank Sharma <shashank.sharma@intel.com>
> > Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=105655
> > Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > ---
> >  drivers/gpu/drm/drm_edid.c | 11 +++--------
> >  1 file changed, 3 insertions(+), 8 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
> > index 134069f36482..39f1db4acda4 100644
> > --- a/drivers/gpu/drm/drm_edid.c
> > +++ b/drivers/gpu/drm/drm_edid.c
> > @@ -4451,6 +4451,7 @@ drm_reset_display_info(struct drm_connector *connector)
> >  	info->max_tmds_clock = 0;
> >  	info->dvi_dual = false;
> >  	info->has_hdmi_infoframe = false;
> > +	memset(&info->hdmi, 0, sizeof(info->hdmi));
> >  
> >  	info->non_desktop = 0;
> >  }
> > @@ -4462,17 +4463,11 @@ u32 drm_add_display_info(struct drm_connector *connector, const struct edid *edi
> >  
> >  	u32 quirks = edid_get_quirks(edid);
> >  
> > +	drm_reset_display_info(connector);
> > +
> 
> Strictly speaking this is a separate bugfix, for the case where you
> immediately go from one output to a different one. Keith already fixed the
> case where at least somewhere in between you go to the disconnected state
> in:
> 
> commit 170178fe99dd212bf25e70c89bc4b6e195564ffc
> Author: Keith Packard <keithp@keithp.com>
> Date:   Wed Dec 13 00:44:26 2017 -0800
> 
>     drm: Update edid-derived drm_display_info fields at edid property set [v2]
> 
> With the above explained in the commit message:

The drm_reset_display_info() call is just the "deduplicate the code"
part. The memset() is the bugfix, and applies in all cases.

> 
> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
> 
> >  	info->width_mm = edid->width_cm * 10;
> >  	info->height_mm = edid->height_cm * 10;
> >  
> > -	/* driver figures it out in this case */
> > -	info->bpc = 0;
> > -	info->color_formats = 0;
> > -	info->cea_rev = 0;
> > -	info->max_tmds_clock = 0;
> > -	info->dvi_dual = false;
> > -	info->has_hdmi_infoframe = false;
> > -
> >  	info->non_desktop = !!(quirks & EDID_QUIRK_NON_DESKTOP);
> >  
> >  	DRM_DEBUG_KMS("non_desktop set to %d\n", info->non_desktop);
> > -- 
> > 2.16.1
> > 
> > _______________________________________________
> > Intel-gfx mailing list
> > Intel-gfx@lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/intel-gfx
> 
> -- 
> Daniel Vetter
> Software Engineer, Intel Corporation
> http://blog.ffwll.ch
Daniel Vetter April 24, 2018, 7:36 p.m. UTC | #3
On Tue, Apr 24, 2018 at 05:26:30PM +0300, Ville Syrjälä wrote:
> On Tue, Apr 24, 2018 at 04:18:37PM +0200, Daniel Vetter wrote:
> > On Tue, Apr 24, 2018 at 04:02:50PM +0300, Ville Syrjala wrote:
> > > From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > > 
> > > We're currently failing to reset everything in display_info.hdmi
> > > which will potentially cause us to use stale information when
> > > swapping monitors. Eg. if the user replaces a HDMI 2.0 monitor
> > > with a HDMI 1.x monitor we will continue to think that the monitor
> > > supports scrambling. That will lead to a black screen since the
> > > HDMI 1.x monitor won't understand the scrambled signal.
> > > 
> > > Fix the problem by clearing display_info.hdmi fully. And while at
> > > eliminate some duplicated code by calling drm_reset_display_info()
> > > in drm_add_display_info().
> > > 
> > > Cc: Antony Chen <antonychen@qnap.com>
> > > Cc: Shashank Sharma <shashank.sharma@intel.com>
> > > Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=105655
> > > Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > > ---
> > >  drivers/gpu/drm/drm_edid.c | 11 +++--------
> > >  1 file changed, 3 insertions(+), 8 deletions(-)
> > > 
> > > diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
> > > index 134069f36482..39f1db4acda4 100644
> > > --- a/drivers/gpu/drm/drm_edid.c
> > > +++ b/drivers/gpu/drm/drm_edid.c
> > > @@ -4451,6 +4451,7 @@ drm_reset_display_info(struct drm_connector *connector)
> > >  	info->max_tmds_clock = 0;
> > >  	info->dvi_dual = false;
> > >  	info->has_hdmi_infoframe = false;
> > > +	memset(&info->hdmi, 0, sizeof(info->hdmi));
> > >  
> > >  	info->non_desktop = 0;
> > >  }
> > > @@ -4462,17 +4463,11 @@ u32 drm_add_display_info(struct drm_connector *connector, const struct edid *edi
> > >  
> > >  	u32 quirks = edid_get_quirks(edid);
> > >  
> > > +	drm_reset_display_info(connector);
> > > +
> > 
> > Strictly speaking this is a separate bugfix, for the case where you
> > immediately go from one output to a different one. Keith already fixed the
> > case where at least somewhere in between you go to the disconnected state
> > in:
> > 
> > commit 170178fe99dd212bf25e70c89bc4b6e195564ffc
> > Author: Keith Packard <keithp@keithp.com>
> > Date:   Wed Dec 13 00:44:26 2017 -0800
> > 
> >     drm: Update edid-derived drm_display_info fields at edid property set [v2]
> > 
> > With the above explained in the commit message:
> 
> The drm_reset_display_info() call is just the "deduplicate the code"
> part. The memset() is the bugfix, and applies in all cases.

Hm ... I guess my brain wasn't fully working.

Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>

as-is.
-Daniel

> 
> > 
> > Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
> > 
> > >  	info->width_mm = edid->width_cm * 10;
> > >  	info->height_mm = edid->height_cm * 10;
> > >  
> > > -	/* driver figures it out in this case */
> > > -	info->bpc = 0;
> > > -	info->color_formats = 0;
> > > -	info->cea_rev = 0;
> > > -	info->max_tmds_clock = 0;
> > > -	info->dvi_dual = false;
> > > -	info->has_hdmi_infoframe = false;
> > > -
> > >  	info->non_desktop = !!(quirks & EDID_QUIRK_NON_DESKTOP);
> > >  
> > >  	DRM_DEBUG_KMS("non_desktop set to %d\n", info->non_desktop);
> > > -- 
> > > 2.16.1
> > > 
> > > _______________________________________________
> > > Intel-gfx mailing list
> > > Intel-gfx@lists.freedesktop.org
> > > https://lists.freedesktop.org/mailman/listinfo/intel-gfx
> > 
> > -- 
> > Daniel Vetter
> > Software Engineer, Intel Corporation
> > http://blog.ffwll.ch
> 
> -- 
> Ville Syrjälä
> Intel
Antony Chen April 25, 2018, 11:03 a.m. UTC | #4
Hi all,

The patch works: drivers/gpu/drm/drm_edid.c
I switch 4K@60 and 4K@30 monitors some times, monitors show correct output.
Thanks for your help.

What are the steps to close the issue in freedesktop? Append the patch by Ville
Syrjälä, then I close it?

Antony

2018-04-25 3:36 GMT+08:00 Daniel Vetter <daniel@ffwll.ch>:

> On Tue, Apr 24, 2018 at 05:26:30PM +0300, Ville Syrjälä wrote:
> > On Tue, Apr 24, 2018 at 04:18:37PM +0200, Daniel Vetter wrote:
> > > On Tue, Apr 24, 2018 at 04:02:50PM +0300, Ville Syrjala wrote:
> > > > From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > > >
> > > > We're currently failing to reset everything in display_info.hdmi
> > > > which will potentially cause us to use stale information when
> > > > swapping monitors. Eg. if the user replaces a HDMI 2.0 monitor
> > > > with a HDMI 1.x monitor we will continue to think that the monitor
> > > > supports scrambling. That will lead to a black screen since the
> > > > HDMI 1.x monitor won't understand the scrambled signal.
> > > >
> > > > Fix the problem by clearing display_info.hdmi fully. And while at
> > > > eliminate some duplicated code by calling drm_reset_display_info()
> > > > in drm_add_display_info().
> > > >
> > > > Cc: Antony Chen <antonychen@qnap.com>
> > > > Cc: Shashank Sharma <shashank.sharma@intel.com>
> > > > Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=105655
> > > > Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > > > ---
> > > >  drivers/gpu/drm/drm_edid.c | 11 +++--------
> > > >  1 file changed, 3 insertions(+), 8 deletions(-)
> > > >
> > > > diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
> > > > index 134069f36482..39f1db4acda4 100644
> > > > --- a/drivers/gpu/drm/drm_edid.c
> > > > +++ b/drivers/gpu/drm/drm_edid.c
> > > > @@ -4451,6 +4451,7 @@ drm_reset_display_info(struct drm_connector
> *connector)
> > > >   info->max_tmds_clock = 0;
> > > >   info->dvi_dual = false;
> > > >   info->has_hdmi_infoframe = false;
> > > > + memset(&info->hdmi, 0, sizeof(info->hdmi));
> > > >
> > > >   info->non_desktop = 0;
> > > >  }
> > > > @@ -4462,17 +4463,11 @@ u32 drm_add_display_info(struct
> drm_connector *connector, const struct edid *edi
> > > >
> > > >   u32 quirks = edid_get_quirks(edid);
> > > >
> > > > + drm_reset_display_info(connector);
> > > > +
> > >
> > > Strictly speaking this is a separate bugfix, for the case where you
> > > immediately go from one output to a different one. Keith already fixed
> the
> > > case where at least somewhere in between you go to the disconnected
> state
> > > in:
> > >
> > > commit 170178fe99dd212bf25e70c89bc4b6e195564ffc
> > > Author: Keith Packard <keithp@keithp.com>
> > > Date:   Wed Dec 13 00:44:26 2017 -0800
> > >
> > >     drm: Update edid-derived drm_display_info fields at edid property
> set [v2]
> > >
> > > With the above explained in the commit message:
> >
> > The drm_reset_display_info() call is just the "deduplicate the code"
> > part. The memset() is the bugfix, and applies in all cases.
>
> Hm ... I guess my brain wasn't fully working.
>
> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
>
> as-is.
> -Daniel
>
> >
> > >
> > > Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
> > >
> > > >   info->width_mm = edid->width_cm * 10;
> > > >   info->height_mm = edid->height_cm * 10;
> > > >
> > > > - /* driver figures it out in this case */
> > > > - info->bpc = 0;
> > > > - info->color_formats = 0;
> > > > - info->cea_rev = 0;
> > > > - info->max_tmds_clock = 0;
> > > > - info->dvi_dual = false;
> > > > - info->has_hdmi_infoframe = false;
> > > > -
> > > >   info->non_desktop = !!(quirks & EDID_QUIRK_NON_DESKTOP);
> > > >
> > > >   DRM_DEBUG_KMS("non_desktop set to %d\n", info->non_desktop);
> > > > --
> > > > 2.16.1
> > > >
> > > > _______________________________________________
> > > > Intel-gfx mailing list
> > > > Intel-gfx@lists.freedesktop.org
> > > > https://lists.freedesktop.org/mailman/listinfo/intel-gfx
> > >
> > > --
> > > Daniel Vetter
> > > Software Engineer, Intel Corporation
> > > http://blog.ffwll.ch
> >
> > --
> > Ville Syrjälä
> > Intel
>
> --
> Daniel Vetter
> Software Engineer, Intel Corporation
> http://blog.ffwll.ch
>
Ville Syrjälä April 25, 2018, 2:09 p.m. UTC | #5
On Tue, Apr 24, 2018 at 09:36:29PM +0200, Daniel Vetter wrote:
> On Tue, Apr 24, 2018 at 05:26:30PM +0300, Ville Syrjälä wrote:
> > On Tue, Apr 24, 2018 at 04:18:37PM +0200, Daniel Vetter wrote:
> > > On Tue, Apr 24, 2018 at 04:02:50PM +0300, Ville Syrjala wrote:
> > > > From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > > > 
> > > > We're currently failing to reset everything in display_info.hdmi
> > > > which will potentially cause us to use stale information when
> > > > swapping monitors. Eg. if the user replaces a HDMI 2.0 monitor
> > > > with a HDMI 1.x monitor we will continue to think that the monitor
> > > > supports scrambling. That will lead to a black screen since the
> > > > HDMI 1.x monitor won't understand the scrambled signal.
> > > > 
> > > > Fix the problem by clearing display_info.hdmi fully. And while at
> > > > eliminate some duplicated code by calling drm_reset_display_info()
> > > > in drm_add_display_info().
> > > > 
> > > > Cc: Antony Chen <antonychen@qnap.com>
> > > > Cc: Shashank Sharma <shashank.sharma@intel.com>
> > > > Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=105655
> > > > Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > > > ---
> > > >  drivers/gpu/drm/drm_edid.c | 11 +++--------
> > > >  1 file changed, 3 insertions(+), 8 deletions(-)
> > > > 
> > > > diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
> > > > index 134069f36482..39f1db4acda4 100644
> > > > --- a/drivers/gpu/drm/drm_edid.c
> > > > +++ b/drivers/gpu/drm/drm_edid.c
> > > > @@ -4451,6 +4451,7 @@ drm_reset_display_info(struct drm_connector *connector)
> > > >  	info->max_tmds_clock = 0;
> > > >  	info->dvi_dual = false;
> > > >  	info->has_hdmi_infoframe = false;
> > > > +	memset(&info->hdmi, 0, sizeof(info->hdmi));
> > > >  
> > > >  	info->non_desktop = 0;
> > > >  }
> > > > @@ -4462,17 +4463,11 @@ u32 drm_add_display_info(struct drm_connector *connector, const struct edid *edi
> > > >  
> > > >  	u32 quirks = edid_get_quirks(edid);
> > > >  
> > > > +	drm_reset_display_info(connector);
> > > > +
> > > 
> > > Strictly speaking this is a separate bugfix, for the case where you
> > > immediately go from one output to a different one. Keith already fixed the
> > > case where at least somewhere in between you go to the disconnected state
> > > in:
> > > 
> > > commit 170178fe99dd212bf25e70c89bc4b6e195564ffc
> > > Author: Keith Packard <keithp@keithp.com>
> > > Date:   Wed Dec 13 00:44:26 2017 -0800
> > > 
> > >     drm: Update edid-derived drm_display_info fields at edid property set [v2]
> > > 
> > > With the above explained in the commit message:
> > 
> > The drm_reset_display_info() call is just the "deduplicate the code"
> > part. The memset() is the bugfix, and applies in all cases.
> 
> Hm ... I guess my brain wasn't fully working.
> 
> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
> 
> as-is.

Cool. Thanks.

Pushed to drm-misc-fixes with
Cc: stable@vger.kernel.org
Tested-by: Antony Chen <antonychen@qnap.com>

> -Daniel
> 
> > 
> > > 
> > > Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
> > > 
> > > >  	info->width_mm = edid->width_cm * 10;
> > > >  	info->height_mm = edid->height_cm * 10;
> > > >  
> > > > -	/* driver figures it out in this case */
> > > > -	info->bpc = 0;
> > > > -	info->color_formats = 0;
> > > > -	info->cea_rev = 0;
> > > > -	info->max_tmds_clock = 0;
> > > > -	info->dvi_dual = false;
> > > > -	info->has_hdmi_infoframe = false;
> > > > -
> > > >  	info->non_desktop = !!(quirks & EDID_QUIRK_NON_DESKTOP);
> > > >  
> > > >  	DRM_DEBUG_KMS("non_desktop set to %d\n", info->non_desktop);
> > > > -- 
> > > > 2.16.1
> > > > 
> > > > _______________________________________________
> > > > Intel-gfx mailing list
> > > > Intel-gfx@lists.freedesktop.org
> > > > https://lists.freedesktop.org/mailman/listinfo/intel-gfx
> > > 
> > > -- 
> > > Daniel Vetter
> > > Software Engineer, Intel Corporation
> > > http://blog.ffwll.ch
> > 
> > -- 
> > Ville Syrjälä
> > Intel
> 
> -- 
> Daniel Vetter
> Software Engineer, Intel Corporation
> http://blog.ffwll.ch
Ville Syrjälä April 25, 2018, 2:10 p.m. UTC | #6
On Wed, Apr 25, 2018 at 07:03:14PM +0800, Antony Chen wrote:
> Hi all,
> 
> The patch works: drivers/gpu/drm/drm_edid.c
> I switch 4K@60 and 4K@30 monitors some times, monitors show correct output.
> Thanks for your help.
> 
> What are the steps to close the issue in freedesktop? Append the patch by Ville
> Syrjälä, then I close it?

The bug is now resolved. Thanks for reporting the problem and testing
the fix.

> 
> Antony
> 
> 2018-04-25 3:36 GMT+08:00 Daniel Vetter <daniel@ffwll.ch>:
> 
> > On Tue, Apr 24, 2018 at 05:26:30PM +0300, Ville Syrjälä wrote:
> > > On Tue, Apr 24, 2018 at 04:18:37PM +0200, Daniel Vetter wrote:
> > > > On Tue, Apr 24, 2018 at 04:02:50PM +0300, Ville Syrjala wrote:
> > > > > From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > > > >
> > > > > We're currently failing to reset everything in display_info.hdmi
> > > > > which will potentially cause us to use stale information when
> > > > > swapping monitors. Eg. if the user replaces a HDMI 2.0 monitor
> > > > > with a HDMI 1.x monitor we will continue to think that the monitor
> > > > > supports scrambling. That will lead to a black screen since the
> > > > > HDMI 1.x monitor won't understand the scrambled signal.
> > > > >
> > > > > Fix the problem by clearing display_info.hdmi fully. And while at
> > > > > eliminate some duplicated code by calling drm_reset_display_info()
> > > > > in drm_add_display_info().
> > > > >
> > > > > Cc: Antony Chen <antonychen@qnap.com>
> > > > > Cc: Shashank Sharma <shashank.sharma@intel.com>
> > > > > Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=105655
> > > > > Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > > > > ---
> > > > >  drivers/gpu/drm/drm_edid.c | 11 +++--------
> > > > >  1 file changed, 3 insertions(+), 8 deletions(-)
> > > > >
> > > > > diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
> > > > > index 134069f36482..39f1db4acda4 100644
> > > > > --- a/drivers/gpu/drm/drm_edid.c
> > > > > +++ b/drivers/gpu/drm/drm_edid.c
> > > > > @@ -4451,6 +4451,7 @@ drm_reset_display_info(struct drm_connector
> > *connector)
> > > > >   info->max_tmds_clock = 0;
> > > > >   info->dvi_dual = false;
> > > > >   info->has_hdmi_infoframe = false;
> > > > > + memset(&info->hdmi, 0, sizeof(info->hdmi));
> > > > >
> > > > >   info->non_desktop = 0;
> > > > >  }
> > > > > @@ -4462,17 +4463,11 @@ u32 drm_add_display_info(struct
> > drm_connector *connector, const struct edid *edi
> > > > >
> > > > >   u32 quirks = edid_get_quirks(edid);
> > > > >
> > > > > + drm_reset_display_info(connector);
> > > > > +
> > > >
> > > > Strictly speaking this is a separate bugfix, for the case where you
> > > > immediately go from one output to a different one. Keith already fixed
> > the
> > > > case where at least somewhere in between you go to the disconnected
> > state
> > > > in:
> > > >
> > > > commit 170178fe99dd212bf25e70c89bc4b6e195564ffc
> > > > Author: Keith Packard <keithp@keithp.com>
> > > > Date:   Wed Dec 13 00:44:26 2017 -0800
> > > >
> > > >     drm: Update edid-derived drm_display_info fields at edid property
> > set [v2]
> > > >
> > > > With the above explained in the commit message:
> > >
> > > The drm_reset_display_info() call is just the "deduplicate the code"
> > > part. The memset() is the bugfix, and applies in all cases.
> >
> > Hm ... I guess my brain wasn't fully working.
> >
> > Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
> >
> > as-is.
> > -Daniel
> >
> > >
> > > >
> > > > Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
> > > >
> > > > >   info->width_mm = edid->width_cm * 10;
> > > > >   info->height_mm = edid->height_cm * 10;
> > > > >
> > > > > - /* driver figures it out in this case */
> > > > > - info->bpc = 0;
> > > > > - info->color_formats = 0;
> > > > > - info->cea_rev = 0;
> > > > > - info->max_tmds_clock = 0;
> > > > > - info->dvi_dual = false;
> > > > > - info->has_hdmi_infoframe = false;
> > > > > -
> > > > >   info->non_desktop = !!(quirks & EDID_QUIRK_NON_DESKTOP);
> > > > >
> > > > >   DRM_DEBUG_KMS("non_desktop set to %d\n", info->non_desktop);
> > > > > --
> > > > > 2.16.1
> > > > >
> > > > > _______________________________________________
> > > > > Intel-gfx mailing list
> > > > > Intel-gfx@lists.freedesktop.org
> > > > > https://lists.freedesktop.org/mailman/listinfo/intel-gfx
> > > >
> > > > --
> > > > Daniel Vetter
> > > > Software Engineer, Intel Corporation
> > > > http://blog.ffwll.ch
> > >
> > > --
> > > Ville Syrjälä
> > > Intel
> >
> > --
> > Daniel Vetter
> > Software Engineer, Intel Corporation
> > http://blog.ffwll.ch
> >
diff mbox

Patch

diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
index 134069f36482..39f1db4acda4 100644
--- a/drivers/gpu/drm/drm_edid.c
+++ b/drivers/gpu/drm/drm_edid.c
@@ -4451,6 +4451,7 @@  drm_reset_display_info(struct drm_connector *connector)
 	info->max_tmds_clock = 0;
 	info->dvi_dual = false;
 	info->has_hdmi_infoframe = false;
+	memset(&info->hdmi, 0, sizeof(info->hdmi));
 
 	info->non_desktop = 0;
 }
@@ -4462,17 +4463,11 @@  u32 drm_add_display_info(struct drm_connector *connector, const struct edid *edi
 
 	u32 quirks = edid_get_quirks(edid);
 
+	drm_reset_display_info(connector);
+
 	info->width_mm = edid->width_cm * 10;
 	info->height_mm = edid->height_cm * 10;
 
-	/* driver figures it out in this case */
-	info->bpc = 0;
-	info->color_formats = 0;
-	info->cea_rev = 0;
-	info->max_tmds_clock = 0;
-	info->dvi_dual = false;
-	info->has_hdmi_infoframe = false;
-
 	info->non_desktop = !!(quirks & EDID_QUIRK_NON_DESKTOP);
 
 	DRM_DEBUG_KMS("non_desktop set to %d\n", info->non_desktop);