mbox series

[v6,0/3] Send a hotplug when edid changes

Message ID 20200623185756.19502-1-kunal1.joshi@intel.com (mailing list archive)
Headers show
Series Send a hotplug when edid changes | expand

Message

Joshi, Kunal1 June 23, 2020, 6:57 p.m. UTC
From: Stanislav Lisovskiy <stanislav.lisovskiy@intel.com>

This series introduce to drm a way to determine if something else
except connection_status had changed during probing, which
can be used by other drivers as well. Another i915 specific part
uses this approach to determine if edid had changed without
changing the connection status and send a hotplug event.

Stanislav Lisovskiy (3):
  drm: Add helper to compare edids.
  drm: Introduce epoch counter to drm_connector
  drm/i915: Send hotplug event if edid had changed

 drivers/gpu/drm/drm_connector.c              | 16 ++++++++
 drivers/gpu/drm/drm_edid.c                   | 39 +++++++++++++++++++-
 drivers/gpu/drm/drm_probe_helper.c           | 38 ++++++++++++++++---
 drivers/gpu/drm/i915/display/intel_hotplug.c | 26 +++++++------
 include/drm/drm_connector.h                  |  2 +
 include/drm/drm_edid.h                       |  9 +++++
 6 files changed, 113 insertions(+), 17 deletions(-)

Comments

Joshi, Kunal1 June 26, 2020, 9:15 a.m. UTC | #1
On 2020-06-26 at 08:25:24 -0700, Lisovskiy, Stanislav wrote:
> Omg, where did those come from?..
> 
> Joshi Kunal: will you fix or should I do that?
> 
> 
> Best Regards,
> 
> Lisovskiy Stanislav
> 
> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo
> 

yes stan floated with checkpatch errors removed
> ________________________________________
> From: Jani Nikula <jani.nikula@linux.intel.com>
> Sent: Friday, June 26, 2020 6:22:31 PM
> To: Patchwork; Lisovskiy, Stanislav
> Cc: intel-gfx@lists.freedesktop.org; Joshi, Kunal1
> Subject: Re: [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for Send a hotplug when edid changes (rev8)
> 
> On Wed, 24 Jun 2020, Patchwork <patchwork@emeril.freedesktop.org> wrote:
> > == Series Details ==
> >
> > Series: Send a hotplug when edid changes (rev8)
> > URL   : https://patchwork.freedesktop.org/series/62816/
> > State : warning
> >
> > == Summary ==
> 
> Please at least fix the spacing issues. Please don't use spaces for
> indentation.
> 
> BR,
> Jani.
> 
> 
> >
> > $ dim checkpatch origin/drm-tip
> > eeee75d80077 drm: Add helper to compare edids.
> > -:32: CHECK:COMPARISON_TO_NULL: Comparison to NULL could be written "edid1"
> > #32: FILE: drivers/gpu/drm/drm_edid.c:1628:
> > +     bool edid1_present = edid1 != NULL;
> >
> > -:33: CHECK:COMPARISON_TO_NULL: Comparison to NULL could be written "edid2"
> > #33: FILE: drivers/gpu/drm/drm_edid.c:1629:
> > +     bool edid2_present = edid2 != NULL;
> >
> > -:39: CHECK:BRACES: Blank lines aren't necessary after an open brace '{'
> > #39: FILE: drivers/gpu/drm/drm_edid.c:1635:
> > +     if (edid1) {
> > +
> >
> > -:54: CHECK:LINE_SPACING: Please don't use multiple blank lines
> > #54: FILE: drivers/gpu/drm/drm_edid.c:1650:
> > +
> > +
> >
> > total: 0 errors, 0 warnings, 4 checks, 54 lines checked
> > 127303584a7e drm: Introduce epoch counter to drm_connector
> > -:56: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis
> > #56: FILE: drivers/gpu/drm/drm_connector.c:2012:
> > +                             DRM_DEBUG_KMS("[CONNECTOR:%d:%s] Edid was changed.\n",
> > +                                 connector->base.id, connector->name);
> >
> > -:60: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis
> > #60: FILE: drivers/gpu/drm/drm_connector.c:2016:
> > +                             DRM_DEBUG_KMS("Updating change counter to %llu\n",
> > +                                 connector->epoch_counter);
> >
> > -:129: CHECK:PREFER_KERNEL_TYPES: Prefer kernel type 'u64' over 'uint64_t'
> > #129: FILE: drivers/gpu/drm/drm_probe_helper.c:790:
> > +     uint64_t old_epoch_counter;
> >
> > -:160: WARNING:BRACES: braces {} are not necessary for single statement blocks
> > #160: FILE: drivers/gpu/drm/drm_probe_helper.c:826:
> > +             if (old_epoch_counter != connector->epoch_counter) {
> >                       changed = true;
> > +             }
> >
> > -:183: ERROR:CODE_INDENT: code indent should use tabs where possible
> > #183: FILE: include/drm/drm_connector.h:1332:
> > +        /** @epoch_counter: used to detect any other changes in connector, besides status */$
> >
> > -:184: ERROR:CODE_INDENT: code indent should use tabs where possible
> > #184: FILE: include/drm/drm_connector.h:1333:
> > +        uint64_t epoch_counter;$
> >
> > -:184: WARNING:LEADING_SPACE: please, no spaces at the start of a line
> > #184: FILE: include/drm/drm_connector.h:1333:
> > +        uint64_t epoch_counter;$
> >
> > -:184: CHECK:PREFER_KERNEL_TYPES: Prefer kernel type 'u64' over 'uint64_t'
> > #184: FILE: include/drm/drm_connector.h:1333:
> > +        uint64_t epoch_counter;
> >
> > total: 2 errors, 2 warnings, 4 checks, 136 lines checked
> > 6f6d00bcff9f drm/i915: Send hotplug event if edid had changed
> > -:42: ERROR:CODE_INDENT: code indent should use tabs where possible
> > #42: FILE: drivers/gpu/drm/i915/display/intel_hotplug.c:286:
> > +        u64 old_epoch_counter;$
> >
> > -:42: WARNING:LEADING_SPACE: please, no spaces at the start of a line
> > #42: FILE: drivers/gpu/drm/i915/display/intel_hotplug.c:286:
> > +        u64 old_epoch_counter;$
> >
> > -:43: ERROR:CODE_INDENT: code indent should use tabs where possible
> > #43: FILE: drivers/gpu/drm/i915/display/intel_hotplug.c:287:
> > +        bool ret = false;$
> >
> > -:43: WARNING:LEADING_SPACE: please, no spaces at the start of a line
> > #43: FILE: drivers/gpu/drm/i915/display/intel_hotplug.c:287:
> > +        bool ret = false;$
> >
> > -:62: ERROR:CODE_INDENT: code indent should use tabs where possible
> > #62: FILE: drivers/gpu/drm/i915/display/intel_hotplug.c:295:
> > +        if (old_epoch_counter != connector->base.epoch_counter)$
> >
> > -:62: WARNING:LEADING_SPACE: please, no spaces at the start of a line
> > #62: FILE: drivers/gpu/drm/i915/display/intel_hotplug.c:295:
> > +        if (old_epoch_counter != connector->base.epoch_counter)$
> >
> > -:63: ERROR:CODE_INDENT: code indent should use tabs where possible
> > #63: FILE: drivers/gpu/drm/i915/display/intel_hotplug.c:296:
> > +                ret = true;$
> >
> > -:63: WARNING:LEADING_SPACE: please, no spaces at the start of a line
> > #63: FILE: drivers/gpu/drm/i915/display/intel_hotplug.c:296:
> > +                ret = true;$
> >
> > -:65: ERROR:CODE_INDENT: code indent should use tabs where possible
> > #65: FILE: drivers/gpu/drm/i915/display/intel_hotplug.c:298:
> > +        if(ret) {$
> >
> > -:65: WARNING:LEADING_SPACE: please, no spaces at the start of a line
> > #65: FILE: drivers/gpu/drm/i915/display/intel_hotplug.c:298:
> > +        if(ret) {$
> >
> > -:65: ERROR:SPACING: space required before the open parenthesis '('
> > #65: FILE: drivers/gpu/drm/i915/display/intel_hotplug.c:298:
> > +        if(ret) {
> >
> > -:73: ERROR:CODE_INDENT: code indent should use tabs where possible
> > #73: FILE: drivers/gpu/drm/i915/display/intel_hotplug.c:306:
> > +        }$
> >
> > -:73: WARNING:LEADING_SPACE: please, no spaces at the start of a line
> > #73: FILE: drivers/gpu/drm/i915/display/intel_hotplug.c:306:
> > +        }$
> >
> > -:74: ERROR:CODE_INDENT: code indent should use tabs where possible
> > #74: FILE: drivers/gpu/drm/i915/display/intel_hotplug.c:307:
> > +        return INTEL_HOTPLUG_UNCHANGED;$
> >
> > -:74: WARNING:LEADING_SPACE: please, no spaces at the start of a line
> > #74: FILE: drivers/gpu/drm/i915/display/intel_hotplug.c:307:
> > +        return INTEL_HOTPLUG_UNCHANGED;$
> >
> > total: 8 errors, 7 warnings, 0 checks, 38 lines checked
> >
> > _______________________________________________
> > Intel-gfx mailing list
> > Intel-gfx@lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/intel-gfx
> 
> --
> Jani Nikula, Intel Open Source Graphics Center
Lisovskiy, Stanislav June 26, 2020, 11:34 a.m. UTC | #2
Sure it is gem as usual. gem_ctx_persistance test is absolutely orthogonal to any hotplug funcitonality.
Also it fails almost on weekly basis.

Best Regards,

Lisovskiy Stanislav

Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo
Jani Nikula June 26, 2020, 3:22 p.m. UTC | #3
On Wed, 24 Jun 2020, Patchwork <patchwork@emeril.freedesktop.org> wrote:
> == Series Details ==
>
> Series: Send a hotplug when edid changes (rev8)
> URL   : https://patchwork.freedesktop.org/series/62816/
> State : warning
>
> == Summary ==

Please at least fix the spacing issues. Please don't use spaces for
indentation.

BR,
Jani.


>
> $ dim checkpatch origin/drm-tip
> eeee75d80077 drm: Add helper to compare edids.
> -:32: CHECK:COMPARISON_TO_NULL: Comparison to NULL could be written "edid1"
> #32: FILE: drivers/gpu/drm/drm_edid.c:1628:
> +	bool edid1_present = edid1 != NULL;
>
> -:33: CHECK:COMPARISON_TO_NULL: Comparison to NULL could be written "edid2"
> #33: FILE: drivers/gpu/drm/drm_edid.c:1629:
> +	bool edid2_present = edid2 != NULL;
>
> -:39: CHECK:BRACES: Blank lines aren't necessary after an open brace '{'
> #39: FILE: drivers/gpu/drm/drm_edid.c:1635:
> +	if (edid1) {
> +
>
> -:54: CHECK:LINE_SPACING: Please don't use multiple blank lines
> #54: FILE: drivers/gpu/drm/drm_edid.c:1650:
> +
> +
>
> total: 0 errors, 0 warnings, 4 checks, 54 lines checked
> 127303584a7e drm: Introduce epoch counter to drm_connector
> -:56: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis
> #56: FILE: drivers/gpu/drm/drm_connector.c:2012:
> +				DRM_DEBUG_KMS("[CONNECTOR:%d:%s] Edid was changed.\n",
> +				    connector->base.id, connector->name);
>
> -:60: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis
> #60: FILE: drivers/gpu/drm/drm_connector.c:2016:
> +				DRM_DEBUG_KMS("Updating change counter to %llu\n",
> +				    connector->epoch_counter);
>
> -:129: CHECK:PREFER_KERNEL_TYPES: Prefer kernel type 'u64' over 'uint64_t'
> #129: FILE: drivers/gpu/drm/drm_probe_helper.c:790:
> +	uint64_t old_epoch_counter;
>
> -:160: WARNING:BRACES: braces {} are not necessary for single statement blocks
> #160: FILE: drivers/gpu/drm/drm_probe_helper.c:826:
> +		if (old_epoch_counter != connector->epoch_counter) {
>  			changed = true;
> +		}
>
> -:183: ERROR:CODE_INDENT: code indent should use tabs where possible
> #183: FILE: include/drm/drm_connector.h:1332:
> +        /** @epoch_counter: used to detect any other changes in connector, besides status */$
>
> -:184: ERROR:CODE_INDENT: code indent should use tabs where possible
> #184: FILE: include/drm/drm_connector.h:1333:
> +        uint64_t epoch_counter;$
>
> -:184: WARNING:LEADING_SPACE: please, no spaces at the start of a line
> #184: FILE: include/drm/drm_connector.h:1333:
> +        uint64_t epoch_counter;$
>
> -:184: CHECK:PREFER_KERNEL_TYPES: Prefer kernel type 'u64' over 'uint64_t'
> #184: FILE: include/drm/drm_connector.h:1333:
> +        uint64_t epoch_counter;
>
> total: 2 errors, 2 warnings, 4 checks, 136 lines checked
> 6f6d00bcff9f drm/i915: Send hotplug event if edid had changed
> -:42: ERROR:CODE_INDENT: code indent should use tabs where possible
> #42: FILE: drivers/gpu/drm/i915/display/intel_hotplug.c:286:
> +        u64 old_epoch_counter;$
>
> -:42: WARNING:LEADING_SPACE: please, no spaces at the start of a line
> #42: FILE: drivers/gpu/drm/i915/display/intel_hotplug.c:286:
> +        u64 old_epoch_counter;$
>
> -:43: ERROR:CODE_INDENT: code indent should use tabs where possible
> #43: FILE: drivers/gpu/drm/i915/display/intel_hotplug.c:287:
> +        bool ret = false;$
>
> -:43: WARNING:LEADING_SPACE: please, no spaces at the start of a line
> #43: FILE: drivers/gpu/drm/i915/display/intel_hotplug.c:287:
> +        bool ret = false;$
>
> -:62: ERROR:CODE_INDENT: code indent should use tabs where possible
> #62: FILE: drivers/gpu/drm/i915/display/intel_hotplug.c:295:
> +        if (old_epoch_counter != connector->base.epoch_counter)$
>
> -:62: WARNING:LEADING_SPACE: please, no spaces at the start of a line
> #62: FILE: drivers/gpu/drm/i915/display/intel_hotplug.c:295:
> +        if (old_epoch_counter != connector->base.epoch_counter)$
>
> -:63: ERROR:CODE_INDENT: code indent should use tabs where possible
> #63: FILE: drivers/gpu/drm/i915/display/intel_hotplug.c:296:
> +                ret = true;$
>
> -:63: WARNING:LEADING_SPACE: please, no spaces at the start of a line
> #63: FILE: drivers/gpu/drm/i915/display/intel_hotplug.c:296:
> +                ret = true;$
>
> -:65: ERROR:CODE_INDENT: code indent should use tabs where possible
> #65: FILE: drivers/gpu/drm/i915/display/intel_hotplug.c:298:
> +        if(ret) {$
>
> -:65: WARNING:LEADING_SPACE: please, no spaces at the start of a line
> #65: FILE: drivers/gpu/drm/i915/display/intel_hotplug.c:298:
> +        if(ret) {$
>
> -:65: ERROR:SPACING: space required before the open parenthesis '('
> #65: FILE: drivers/gpu/drm/i915/display/intel_hotplug.c:298:
> +        if(ret) {
>
> -:73: ERROR:CODE_INDENT: code indent should use tabs where possible
> #73: FILE: drivers/gpu/drm/i915/display/intel_hotplug.c:306:
> +        }$
>
> -:73: WARNING:LEADING_SPACE: please, no spaces at the start of a line
> #73: FILE: drivers/gpu/drm/i915/display/intel_hotplug.c:306:
> +        }$
>
> -:74: ERROR:CODE_INDENT: code indent should use tabs where possible
> #74: FILE: drivers/gpu/drm/i915/display/intel_hotplug.c:307:
> +        return INTEL_HOTPLUG_UNCHANGED;$
>
> -:74: WARNING:LEADING_SPACE: please, no spaces at the start of a line
> #74: FILE: drivers/gpu/drm/i915/display/intel_hotplug.c:307:
> +        return INTEL_HOTPLUG_UNCHANGED;$
>
> total: 8 errors, 7 warnings, 0 checks, 38 lines checked
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Lisovskiy, Stanislav June 26, 2020, 3:25 p.m. UTC | #4
Omg, where did those come from?..

Joshi Kunal: will you fix or should I do that?


Best Regards,

Lisovskiy Stanislav

Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo