All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: "Almahallawy, Khaled" <khaled.almahallawy@intel.com>
Cc: "intel-gfx@lists.freedesktop.org"
	<intel-gfx@lists.freedesktop.org>,
	"Srinivas, Vidya" <vidya.srinivas@intel.com>,
	"dri-devel@lists.freedesktop.org"
	<dri-devel@lists.freedesktop.org>
Subject: Re: [Intel-gfx] [PATCH] drm/i915/dp: DP PHY compliance for JSL
Date: Fri, 5 Jun 2020 00:03:19 +0300	[thread overview]
Message-ID: <20200604210319.GJ6112@intel.com> (raw)
In-Reply-To: <fea323968324ceefe813d34d80fdd9779614aa01.camel@intel.com>

On Thu, Jun 04, 2020 at 08:01:03PM +0000, Almahallawy, Khaled wrote:
> On Thu, 2020-06-04 at 22:06 +0300, Ville Syrjälä wrote:
> > On Thu, Jun 04, 2020 at 10:33:48AM +0530, Vidya Srinivas wrote:
> > > Signed-off-by: Khaled Almahallawy <khaled.almahallawy@intel.com>
> > > Signed-off-by: Vidya Srinivas <vidya.srinivas@intel.com>
> > > ---
> > >  drivers/gpu/drm/i915/display/intel_dp.c | 40
> > > ++++++++++++++++++++++++++-------
> > >  1 file changed, 32 insertions(+), 8 deletions(-)
> > > 
> > > diff --git a/drivers/gpu/drm/i915/display/intel_dp.c
> > > b/drivers/gpu/drm/i915/display/intel_dp.c
> > > index 7223367171d1..44663e8ac9a1 100644
> > > --- a/drivers/gpu/drm/i915/display/intel_dp.c
> > > +++ b/drivers/gpu/drm/i915/display/intel_dp.c
> > > @@ -5470,22 +5470,32 @@ intel_dp_autotest_phy_ddi_disable(struct
> > > intel_dp *intel_dp)
> > >  	struct drm_i915_private *dev_priv = to_i915(dev);
> > >  	struct intel_crtc *crtc = to_intel_crtc(intel_dig_port-
> > > >base.base.crtc);
> > >  	enum pipe pipe = crtc->pipe;
> > > -	u32 trans_ddi_func_ctl_value, trans_conf_value,
> > > dp_tp_ctl_value;
> > > +	u32 trans_ddi_func_ctl_value, trans_conf_value,
> > > dp_tp_ctl_value, trans_ddi_port_mask;
> > > +	enum port port = intel_dig_port->base.port;
> > > +	i915_reg_t dp_tp_reg;
> > > +
> > > +	if (IS_ELKHARTLAKE(dev_priv)) {
> > > +		dp_tp_reg = DP_TP_CTL(port);
> > > +		trans_ddi_port_mask = TRANS_DDI_PORT_MASK;
> > > +	} else if (IS_TIGERLAKE(dev_priv)) {
> > > +		dp_tp_reg = TGL_DP_TP_CTL(pipe);
> > > +		trans_ddi_port_mask = TGL_TRANS_DDI_PORT_MASK;
> > > +	}
> > >  
> > >  	trans_ddi_func_ctl_value = intel_de_read(dev_priv,
> > >  						 TRANS_DDI_FUNC_CTL(pip
> > > e));
> > >  	trans_conf_value = intel_de_read(dev_priv, PIPECONF(pipe));
> > > -	dp_tp_ctl_value = intel_de_read(dev_priv, TGL_DP_TP_CTL(pipe));
> > >  
> > > +	dp_tp_ctl_value = intel_de_read(dev_priv, dp_tp_reg);
> > >  	trans_ddi_func_ctl_value &= ~(TRANS_DDI_FUNC_ENABLE |
> > > -				      TGL_TRANS_DDI_PORT_MASK);
> > > +					trans_ddi_port_mask);
> > >  	trans_conf_value &= ~PIPECONF_ENABLE;
> > >  	dp_tp_ctl_value &= ~DP_TP_CTL_ENABLE;
> > >  
> > >  	intel_de_write(dev_priv, PIPECONF(pipe), trans_conf_value);
> > >  	intel_de_write(dev_priv, TRANS_DDI_FUNC_CTL(pipe),
> > >  		       trans_ddi_func_ctl_value);
> > > -	intel_de_write(dev_priv, TGL_DP_TP_CTL(pipe), dp_tp_ctl_value);
> > > +	intel_de_write(dev_priv, dp_tp_reg, dp_tp_ctl_value);
> > 
> > All this ad-hoc modeset code really should not exist. It's going to
> > have different bugs than the norma modeset paths, so compliance
> > testing
> > this special code proves absolutely nothing about the normal modeset
> > code. IMO someone needs to take up the task of rewrtiting all this to
> > just perform normal modesets.
> 
> Agree. I've just found that we get kernel NULL pointer dereference and
> panic when we try to access to_intel_crtc(intel_dig_port-
> >base.base.crtc).

Yeah, that's a legacy pointer which should no longer be used at all
with atomic drivers. I'm slowly trying to clear out all this legacy
cruft. The next step I had hoped to take was
https://patchwork.freedesktop.org/series/76993/ but then this
compliacnce stuff landed and threw another wrench into the works.

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

WARNING: multiple messages have this Message-ID (diff)
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: "Almahallawy, Khaled" <khaled.almahallawy@intel.com>
Cc: "intel-gfx@lists.freedesktop.org"
	<intel-gfx@lists.freedesktop.org>,
	"dri-devel@lists.freedesktop.org"
	<dri-devel@lists.freedesktop.org>
Subject: Re: [Intel-gfx] [PATCH] drm/i915/dp: DP PHY compliance for JSL
Date: Fri, 5 Jun 2020 00:03:19 +0300	[thread overview]
Message-ID: <20200604210319.GJ6112@intel.com> (raw)
In-Reply-To: <fea323968324ceefe813d34d80fdd9779614aa01.camel@intel.com>

On Thu, Jun 04, 2020 at 08:01:03PM +0000, Almahallawy, Khaled wrote:
> On Thu, 2020-06-04 at 22:06 +0300, Ville Syrjälä wrote:
> > On Thu, Jun 04, 2020 at 10:33:48AM +0530, Vidya Srinivas wrote:
> > > Signed-off-by: Khaled Almahallawy <khaled.almahallawy@intel.com>
> > > Signed-off-by: Vidya Srinivas <vidya.srinivas@intel.com>
> > > ---
> > >  drivers/gpu/drm/i915/display/intel_dp.c | 40
> > > ++++++++++++++++++++++++++-------
> > >  1 file changed, 32 insertions(+), 8 deletions(-)
> > > 
> > > diff --git a/drivers/gpu/drm/i915/display/intel_dp.c
> > > b/drivers/gpu/drm/i915/display/intel_dp.c
> > > index 7223367171d1..44663e8ac9a1 100644
> > > --- a/drivers/gpu/drm/i915/display/intel_dp.c
> > > +++ b/drivers/gpu/drm/i915/display/intel_dp.c
> > > @@ -5470,22 +5470,32 @@ intel_dp_autotest_phy_ddi_disable(struct
> > > intel_dp *intel_dp)
> > >  	struct drm_i915_private *dev_priv = to_i915(dev);
> > >  	struct intel_crtc *crtc = to_intel_crtc(intel_dig_port-
> > > >base.base.crtc);
> > >  	enum pipe pipe = crtc->pipe;
> > > -	u32 trans_ddi_func_ctl_value, trans_conf_value,
> > > dp_tp_ctl_value;
> > > +	u32 trans_ddi_func_ctl_value, trans_conf_value,
> > > dp_tp_ctl_value, trans_ddi_port_mask;
> > > +	enum port port = intel_dig_port->base.port;
> > > +	i915_reg_t dp_tp_reg;
> > > +
> > > +	if (IS_ELKHARTLAKE(dev_priv)) {
> > > +		dp_tp_reg = DP_TP_CTL(port);
> > > +		trans_ddi_port_mask = TRANS_DDI_PORT_MASK;
> > > +	} else if (IS_TIGERLAKE(dev_priv)) {
> > > +		dp_tp_reg = TGL_DP_TP_CTL(pipe);
> > > +		trans_ddi_port_mask = TGL_TRANS_DDI_PORT_MASK;
> > > +	}
> > >  
> > >  	trans_ddi_func_ctl_value = intel_de_read(dev_priv,
> > >  						 TRANS_DDI_FUNC_CTL(pip
> > > e));
> > >  	trans_conf_value = intel_de_read(dev_priv, PIPECONF(pipe));
> > > -	dp_tp_ctl_value = intel_de_read(dev_priv, TGL_DP_TP_CTL(pipe));
> > >  
> > > +	dp_tp_ctl_value = intel_de_read(dev_priv, dp_tp_reg);
> > >  	trans_ddi_func_ctl_value &= ~(TRANS_DDI_FUNC_ENABLE |
> > > -				      TGL_TRANS_DDI_PORT_MASK);
> > > +					trans_ddi_port_mask);
> > >  	trans_conf_value &= ~PIPECONF_ENABLE;
> > >  	dp_tp_ctl_value &= ~DP_TP_CTL_ENABLE;
> > >  
> > >  	intel_de_write(dev_priv, PIPECONF(pipe), trans_conf_value);
> > >  	intel_de_write(dev_priv, TRANS_DDI_FUNC_CTL(pipe),
> > >  		       trans_ddi_func_ctl_value);
> > > -	intel_de_write(dev_priv, TGL_DP_TP_CTL(pipe), dp_tp_ctl_value);
> > > +	intel_de_write(dev_priv, dp_tp_reg, dp_tp_ctl_value);
> > 
> > All this ad-hoc modeset code really should not exist. It's going to
> > have different bugs than the norma modeset paths, so compliance
> > testing
> > this special code proves absolutely nothing about the normal modeset
> > code. IMO someone needs to take up the task of rewrtiting all this to
> > just perform normal modesets.
> 
> Agree. I've just found that we get kernel NULL pointer dereference and
> panic when we try to access to_intel_crtc(intel_dig_port-
> >base.base.crtc).

Yeah, that's a legacy pointer which should no longer be used at all
with atomic drivers. I'm slowly trying to clear out all this legacy
cruft. The next step I had hoped to take was
https://patchwork.freedesktop.org/series/76993/ but then this
compliacnce stuff landed and threw another wrench into the works.

-- 
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-06-04 21:03 UTC|newest]

Thread overview: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-04  5:03 [PATCH] drm/i915/dp: DP PHY compliance for JSL Vidya Srinivas
2020-06-04  5:03 ` [Intel-gfx] " Vidya Srinivas
2020-06-04  5:34 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for " Patchwork
2020-06-04  5:56 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2020-06-04 10:28 ` [Intel-gfx] ✗ Fi.CI.IGT: failure " Patchwork
2020-06-04 19:06 ` [Intel-gfx] [PATCH] " Ville Syrjälä
2020-06-04 19:06   ` Ville Syrjälä
2020-06-04 20:01   ` Almahallawy, Khaled
2020-06-04 20:01     ` Almahallawy, Khaled
2020-06-04 21:03     ` Ville Syrjälä [this message]
2020-06-04 21:03       ` Ville Syrjälä
2020-06-12 18:25       ` Manasi Navare
2020-06-12 18:25         ` Manasi Navare
2020-06-12 18:36         ` Ville Syrjälä
2020-06-12 18:36           ` Ville Syrjälä
2020-06-12 18:44           ` Manasi Navare
2020-06-12 18:44             ` Manasi Navare
2020-06-12 19:01             ` Ville Syrjälä
2020-06-12 19:01               ` Ville Syrjälä
2020-06-12 19:12               ` Manasi Navare
2020-06-12 19:12                 ` Manasi Navare
2020-06-12 19:21                 ` Ville Syrjälä
2020-06-12 19:21                   ` Ville Syrjälä
2020-06-12 19:38                   ` Manasi Navare
2020-06-12 19:38                     ` Manasi Navare
2020-06-15 16:19                     ` Ville Syrjälä
2020-06-15 16:19                       ` Ville Syrjälä
2020-06-12 18:33     ` Manasi Navare
2020-06-12 18:33       ` Manasi Navare
2020-06-12 18:39       ` Ville Syrjälä
2020-06-12 18:39         ` Ville Syrjälä
2020-09-04  4:13 ` [Intel-gfx] [PATCH 1/3] drm/dp: Add PHY_TEST_PATTERN CP2520 Pattern 2 and 3 Vidya Srinivas
2020-09-04  4:13   ` Vidya Srinivas
2020-09-04  4:13   ` [Intel-gfx] [PATCH] drm/i915/dp: DP PHY compliance for EHL/JSL Vidya Srinivas
2020-09-04  4:13     ` Vidya Srinivas
2020-09-04  4:13   ` [Intel-gfx] [PATCH 2/3] drm/i915/dp: TPS4 PHY test pattern compliance support Vidya Srinivas
2020-09-04  4:13     ` Vidya Srinivas
2020-09-04  4:13   ` [Intel-gfx] [PATCH 3/3] [RFC] drm/i915/dp: DP PHY compliance for EHL/JSL Vidya Srinivas
2020-09-04  4:13     ` Vidya Srinivas
2020-09-04  4:14 ` [Intel-gfx] [PATCH 1/3] drm/dp: Add PHY_TEST_PATTERN CP2520 Pattern 2 and 3 Vidya Srinivas
2020-09-04  4:14   ` Vidya Srinivas
2020-09-04  4:14   ` [Intel-gfx] [PATCH 2/3] drm/i915/dp: TPS4 PHY test pattern compliance support Vidya Srinivas
2020-09-04  4:14     ` Vidya Srinivas
2020-09-04  4:14   ` [Intel-gfx] [PATCH 3/3] [RFC] drm/i915/dp: DP PHY compliance for EHL/JSL Vidya Srinivas
2020-09-04  4:14     ` Vidya Srinivas
2020-09-04  4:29 ` [Intel-gfx] [PATCH] " Vidya Srinivas
2020-09-04  4:29   ` Vidya Srinivas
2020-09-10  4:00   ` [Intel-gfx] " Vidya Srinivas
2020-09-10  4:00     ` Vidya Srinivas
2020-09-10  4:10 ` [Intel-gfx] ✗ Fi.CI.BUILD: failure for drm/i915/dp: DP PHY compliance for JSL (rev11) 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=20200604210319.GJ6112@intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=khaled.almahallawy@intel.com \
    --cc=vidya.srinivas@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 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.