public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Jani Nikula <jani.nikula@linux.intel.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [Intel-gfx] [PATCH v2 2/5] drm/i915: Mark all HPD capabled connectors as such
Date: Tue, 18 Feb 2020 15:08:50 +0200	[thread overview]
Message-ID: <20200218130850.GP13686@intel.com> (raw)
In-Reply-To: <87pnecuk0m.fsf@intel.com>

On Tue, Feb 18, 2020 at 03:01:29PM +0200, Jani Nikula wrote:
> On Wed, 05 Feb 2020, Ville Syrjala <ville.syrjala@linux.intel.com> wrote:
> > From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> >
> > Currently we only set the DRM_CONNECTOR_POLL_{DISCONNECT,CONNECT}
> > bits in intel_connector->polled (the base setting), leading to
> > some confusing looking code to reset drm_connector->polled
> > (the actual setting) to DRM_CONNECTOR_POLL_HPD. Let's set
> > intel_connector->polled = DRM_CONNECTOR_POLL_HPD for all hpd
> > capable connectors, and then we don't need so many special
> > cases in the hotplug code.
> >
> > Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> 
> I don't know why it was so hard to wrap my head around this one... I
> guess just tracking all the places that need something that wasn't there
> before.

connector->polled vs. connector->base.polled probably doesn't help.
We should perhaps rename the first one to something else. Just not
sure what to call it. "default_polled" or something maybe?

> 
> Reviewed-by: Jani Nikula <jani.nikula@intel.com>
> 
> 
> > ---
> >  drivers/gpu/drm/i915/display/intel_crt.c     |  1 +
> >  drivers/gpu/drm/i915/display/intel_dp.c      |  1 +
> >  drivers/gpu/drm/i915/display/intel_hdmi.c    |  1 +
> >  drivers/gpu/drm/i915/display/intel_hotplug.c | 17 ++++++++---------
> >  drivers/gpu/drm/i915/display/intel_sdvo.c    |  1 +
> >  5 files changed, 12 insertions(+), 9 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/i915/display/intel_crt.c b/drivers/gpu/drm/i915/display/intel_crt.c
> > index 0e2f63b0d458..ba0717d8c248 100644
> > --- a/drivers/gpu/drm/i915/display/intel_crt.c
> > +++ b/drivers/gpu/drm/i915/display/intel_crt.c
> > @@ -1033,6 +1033,7 @@ void intel_crt_init(struct drm_i915_private *dev_priv)
> >  	    !dmi_check_system(intel_spurious_crt_detect)) {
> >  		crt->base.hpd_pin = HPD_CRT;
> >  		crt->base.hotplug = intel_encoder_hotplug;
> > +		intel_connector->polled = DRM_CONNECTOR_POLL_HPD;
> >  	} else {
> >  		intel_connector->polled = DRM_CONNECTOR_POLL_CONNECT;
> >  	}
> > diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c
> > index f4dede6253f8..4dfb26b2b2f7 100644
> > --- a/drivers/gpu/drm/i915/display/intel_dp.c
> > +++ b/drivers/gpu/drm/i915/display/intel_dp.c
> > @@ -7576,6 +7576,7 @@ intel_dp_init_connector(struct intel_digital_port *intel_dig_port,
> >  		connector->ycbcr_420_allowed = true;
> >  
> >  	intel_encoder->hpd_pin = intel_hpd_pin_default(dev_priv, port);
> > +	intel_connector->polled = DRM_CONNECTOR_POLL_HPD;
> >  
> >  	intel_dp_aux_init(intel_dp);
> >  
> > diff --git a/drivers/gpu/drm/i915/display/intel_hdmi.c b/drivers/gpu/drm/i915/display/intel_hdmi.c
> > index e68bafb76cb1..1a9a3b23cae4 100644
> > --- a/drivers/gpu/drm/i915/display/intel_hdmi.c
> > +++ b/drivers/gpu/drm/i915/display/intel_hdmi.c
> > @@ -3180,6 +3180,7 @@ void intel_hdmi_init_connector(struct intel_digital_port *intel_dig_port,
> >  		connector->ycbcr_420_allowed = true;
> >  
> >  	intel_encoder->hpd_pin = intel_hpd_pin_default(dev_priv, port);
> > +	intel_connector->polled = DRM_CONNECTOR_POLL_HPD;
> >  
> >  	if (HAS_DDI(dev_priv))
> >  		intel_connector->get_hw_state = intel_ddi_connector_get_hw_state;
> > diff --git a/drivers/gpu/drm/i915/display/intel_hotplug.c b/drivers/gpu/drm/i915/display/intel_hotplug.c
> > index 531021002e34..8af0ae61e1bb 100644
> > --- a/drivers/gpu/drm/i915/display/intel_hotplug.c
> > +++ b/drivers/gpu/drm/i915/display/intel_hotplug.c
> > @@ -262,8 +262,6 @@ static void intel_hpd_irq_storm_reenable_work(struct work_struct *work)
> >  			DRM_DEBUG_DRIVER("Reenabling HPD on connector %s\n",
> >  					 connector->base.name);
> >  		connector->base.polled = connector->polled;
> > -		if (!connector->base.polled)
> > -			connector->base.polled = DRM_CONNECTOR_POLL_HPD;
> >  	}
> >  	drm_connector_list_iter_end(&conn_iter);
> >  
> > @@ -620,16 +618,17 @@ static void i915_hpd_poll_init_work(struct work_struct *work)
> >  
> >  	drm_connector_list_iter_begin(dev, &conn_iter);
> >  	for_each_intel_connector_iter(connector, &conn_iter) {
> > -		enum hpd_pin pin = intel_connector_hpd_pin(connector);
> > +		enum hpd_pin pin;
> > +
> > +		pin = intel_connector_hpd_pin(connector);
> > +		if (pin == HPD_NONE)
> > +			continue;
> >  
> >  		connector->base.polled = connector->polled;
> >  
> > -		if (pin != HPD_NONE && I915_HAS_HOTPLUG(dev_priv) &&
> > -		    !connector->base.polled)
> > -			connector->base.polled = enabled ?
> > -				DRM_CONNECTOR_POLL_CONNECT |
> > -				DRM_CONNECTOR_POLL_DISCONNECT :
> > -				DRM_CONNECTOR_POLL_HPD;
> > +		if (enabled && connector->base.polled == DRM_CONNECTOR_POLL_HPD)
> > +			connector->base.polled = DRM_CONNECTOR_POLL_CONNECT |
> > +				DRM_CONNECTOR_POLL_DISCONNECT;
> >  	}
> >  	drm_connector_list_iter_end(&conn_iter);
> >  
> > diff --git a/drivers/gpu/drm/i915/display/intel_sdvo.c b/drivers/gpu/drm/i915/display/intel_sdvo.c
> > index a4921b549f8b..b0588150752c 100644
> > --- a/drivers/gpu/drm/i915/display/intel_sdvo.c
> > +++ b/drivers/gpu/drm/i915/display/intel_sdvo.c
> > @@ -2721,6 +2721,7 @@ intel_sdvo_dvi_init(struct intel_sdvo *intel_sdvo, int device)
> >  		 * Some SDVO devices have one-shot hotplug interrupts.
> >  		 * Ensure that they get re-enabled when an interrupt happens.
> >  		 */
> > +		intel_connector->polled = DRM_CONNECTOR_POLL_HPD;
> >  		intel_encoder->hotplug = intel_sdvo_hotplug;
> >  		intel_sdvo_enable_hotplug(intel_encoder);
> >  	} else {
> 
> -- 
> Jani Nikula, Intel Open Source Graphics Center

-- 
Ville Syrjälä
Intel
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2020-02-18 13:08 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-05 18:35 [Intel-gfx] [PATCH v2 0/5] drm/i915: Hotplug cleanups Ville Syrjala
2020-02-05 18:35 ` [Intel-gfx] [PATCH v2 1/5] drm/i915/hpd: Replace the loop-within-loop with two independent loops Ville Syrjala
2020-02-18 12:36   ` Jani Nikula
2020-02-05 18:35 ` [Intel-gfx] [PATCH v2 2/5] drm/i915: Mark all HPD capabled connectors as such Ville Syrjala
2020-02-18 13:01   ` Jani Nikula
2020-02-18 13:08     ` Ville Syrjälä [this message]
2020-02-05 18:35 ` [Intel-gfx] [PATCH v2 3/5] drm/i915: Turn intel_digital_port_connected() in a vfunc Ville Syrjala
2020-02-05 18:35 ` [Intel-gfx] [PATCH v2 4/5] drm/i915: Stash hpd status bits under dev_priv Ville Syrjala
2020-02-05 18:35 ` [Intel-gfx] [PATCH v2 5/5] drm/i915: Use stashed away hpd isr bits in intel_digital_port_connected() Ville Syrjala
2020-02-05 22:01 ` [Intel-gfx] ✓ Fi.CI.BAT: success for drm/i915: Hotplug cleanups (rev3) Patchwork
2020-02-08  8:49 ` [Intel-gfx] ✓ Fi.CI.IGT: " Patchwork

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=20200218130850.GP13686@intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=jani.nikula@linux.intel.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