intel-gfx.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Rodrigo Vivi <rodrigo.vivi@intel.com>
To: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH V2 5/5] drm/i915/kbl+: Enable IPC only for symmetric memory configurations
Date: Thu, 13 Sep 2018 14:33:42 -0700	[thread overview]
Message-ID: <20180913213342.GG24668@intel.com> (raw)
In-Reply-To: <664b4169-0524-8a25-c845-ade019c9a267@linux.intel.com>

On Fri, Aug 31, 2018 at 12:25:31PM +0200, Maarten Lankhorst wrote:
> Op 24-08-18 om 11:32 schreef Mahesh Kumar:
> > IPC may cause underflows if not used with dual channel symmetric
> > memory configuration. Disable IPC for non symmetric configurations in
> > affected platforms.
> > Display WA #1141
> >
> > Changes Since V1:
> >  - Re-arrange the code.
> >  - update wrapper to return if memory is symmetric (Rodrigo)
> >
> > Signed-off-by: Mahesh Kumar <mahesh1.kumar@intel.com>
> > ---
> >  drivers/gpu/drm/i915/i915_drv.c | 27 ++++++++++++++++++++++-----
> >  drivers/gpu/drm/i915/i915_drv.h |  1 +
> >  drivers/gpu/drm/i915/intel_pm.c |  5 +++++
> >  3 files changed, 28 insertions(+), 5 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
> > index 2bc74c01a0e5..61d756ae7bf0 100644
> > --- a/drivers/gpu/drm/i915/i915_drv.c
> > +++ b/drivers/gpu/drm/i915/i915_drv.c
> > @@ -1154,21 +1154,32 @@ skl_dram_get_channel_info(struct dram_channel_info *ch, u32 val)
> >  	return 0;
> >  }
> >  
> > +static bool
> > +intel_is_dram_symmetric(u32 val_ch0, u32 val_ch1,
> > +			struct dram_channel_info *ch0)
> > +{
> > +	return (val_ch0 == val_ch1 &&
> > +		(ch0->s_info.size == 0 ||
> > +		 (ch0->l_info.size == ch0->s_info.size &&
> > +		  ch0->l_info.width == ch0->s_info.width &&
> > +		  ch0->l_info.rank == ch0->s_info.rank)));
> > +}
> > +
> >  static int
> >  skl_dram_get_channels_info(struct drm_i915_private *dev_priv)
> >  {
> >  	struct dram_info *dram_info = &dev_priv->dram_info;
> >  	struct dram_channel_info ch0, ch1;
> > -	u32 val;
> > +	u32 val_ch0, val_ch1;
> >  	int ret;
> >  
> > -	val = I915_READ(SKL_MAD_DIMM_CH0_0_0_0_MCHBAR_MCMAIN);
> > -	ret = skl_dram_get_channel_info(&ch0, val);
> > +	val_ch0 = I915_READ(SKL_MAD_DIMM_CH0_0_0_0_MCHBAR_MCMAIN);
> > +	ret = skl_dram_get_channel_info(&ch0, val_ch0);
> >  	if (ret == 0)
> >  		dram_info->num_channels++;
> >  
> > -	val = I915_READ(SKL_MAD_DIMM_CH1_0_0_0_MCHBAR_MCMAIN);
> > -	ret = skl_dram_get_channel_info(&ch1, val);
> > +	val_ch1 = I915_READ(SKL_MAD_DIMM_CH1_0_0_0_MCHBAR_MCMAIN);
> > +	ret = skl_dram_get_channel_info(&ch1, val_ch1);
> >  	if (ret == 0)
> >  		dram_info->num_channels++;
> >  
> > @@ -1198,6 +1209,12 @@ skl_dram_get_channels_info(struct drm_i915_private *dev_priv)
> >  	if (ch0.is_16gb_dimm || ch1.is_16gb_dimm)
> >  		dram_info->is_16gb_dimm = true;
> >  
> > +	dev_priv->dram_info.symmetric_memory = intel_is_dram_symmetric(val_ch0,
> > +								       val_ch1,
> > +								       &ch0);
> > +
> > +	DRM_DEBUG_KMS("memory configuration is %sSymmetric memory\n",
> > +		      dev_priv->dram_info.symmetric_memory ? "" : "not ");
> >  	return 0;
> >  }
> >  
> > diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
> > index 6c432684c721..e7faa046f78a 100644
> > --- a/drivers/gpu/drm/i915/i915_drv.h
> > +++ b/drivers/gpu/drm/i915/i915_drv.h
> > @@ -1955,6 +1955,7 @@ struct drm_i915_private {
> >  			I915_DRAM_RANK_DUAL
> >  		} rank;
> >  		u32 bandwidth_kbps;
> > +		bool symmetric_memory;
> >  	} dram_info;
> >  
> >  	struct i915_runtime_pm runtime_pm;
> > diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
> > index 77970e38d939..c27646fb4cec 100644
> > --- a/drivers/gpu/drm/i915/intel_pm.c
> > +++ b/drivers/gpu/drm/i915/intel_pm.c
> > @@ -6124,6 +6124,11 @@ void intel_enable_ipc(struct drm_i915_private *dev_priv)
> >  	if (IS_SKYLAKE(dev_priv))
> >  		dev_priv->ipc_enabled = false;
> >  
> > +	/* Display WA #1141: SKL:all KBL:all CFL */
> > +	if ((IS_KABYLAKE(dev_priv) || IS_COFFEELAKE(dev_priv)) &&
> > +	    !dev_priv->dram_info.symmetric_memory)
> > +		dev_priv->ipc_enabled = false;
> > +
> >  	val = I915_READ(DISP_ARB_CTL2);
> >  
> >  	if (dev_priv->ipc_enabled)
> 
> Patch series looks good with minor nit in 3/5 fixed.
> 
> 
> Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>

Series pushed to dinq. Thanks for patches and reviews.

> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2018-09-13 21:33 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-24  9:32 [PATCH 0/5] Decode memdev info and bandwidth and implemnt latency WA Mahesh Kumar
2018-08-24  9:32 ` [PATCH V3 1/5] drm/i915/bxt: Decode memory bandwidth and parameters Mahesh Kumar
2018-08-24  9:32 ` [PATCH V3 2/5] drm/i915/skl+: " Mahesh Kumar
2018-08-24  9:32 ` [PATCH V3 3/5] drm/i915: Implement 16GB dimm wa for latency level-0 Mahesh Kumar
2018-08-31 10:24   ` Maarten Lankhorst
2018-08-31 11:09     ` [PATCH V4 " Mahesh Kumar
2018-08-24  9:32 ` [PATCH V1 4/5] drm/i915/skl+: don't trust IPC value set by BIOS Mahesh Kumar
2018-08-24  9:32 ` [PATCH V2 5/5] drm/i915/kbl+: Enable IPC only for symmetric memory configurations Mahesh Kumar
2018-08-31 10:25   ` Maarten Lankhorst
2018-09-13 21:33     ` Rodrigo Vivi [this message]
2018-08-24 10:49 ` ✗ Fi.CI.SPARSE: warning for Decode memdev info and bandwidth and implemnt latency WA (rev3) Patchwork
2018-08-24 11:06 ` ✓ Fi.CI.BAT: success " Patchwork
2018-08-24 11:27 ` Patchwork
2018-08-24 11:56 ` ✗ Fi.CI.IGT: failure " Patchwork
2018-08-24 12:40 ` ✓ Fi.CI.IGT: success " Patchwork
2018-08-31 11:22 ` ✗ Fi.CI.CHECKPATCH: warning for Decode memdev info and bandwidth and implemnt latency WA (rev4) Patchwork
2018-09-06  2:08   ` Rodrigo Vivi
2018-08-31 11:24 ` ✗ Fi.CI.SPARSE: " Patchwork
2018-08-31 11:44 ` ✓ Fi.CI.BAT: success " Patchwork
2018-08-31 15:01 ` ✓ 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=20180913213342.GG24668@intel.com \
    --to=rodrigo.vivi@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=maarten.lankhorst@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;
as well as URLs for NNTP newsgroup(s).