Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel@ffwll.ch>
To: Damien Lespiau <damien.lespiau@intel.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 5/8] drm/i915: Disable display when fused off
Date: Mon, 10 Feb 2014 10:12:02 +0100	[thread overview]
Message-ID: <20140210091202.GM17001@phenom.ffwll.local> (raw)
In-Reply-To: <1391800374-24904-6-git-send-email-damien.lespiau@intel.com>

On Fri, Feb 07, 2014 at 07:12:51PM +0000, Damien Lespiau wrote:
> FUSE_STRAP has a bit to inform us that the display has been fused off.
> Use it to setup the definitive number of pipes at run-time.
> 
> v2: actually tweak num_pipes, not num_planes
> v3: also tests SFUSE_STRAP bit 7
> v4: rebase on top of drm-nightly
>     use DRM_INFO() for the message telling display is fused off
>     try to read the FUSE_LOCK bit to determine if PCH display is disabled
> 
> Reviewed-by: Mika Kuoppala <mika.kuoppala@intel.com> (for v3)
> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com> (for v3)
> Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
> ---
>  drivers/gpu/drm/i915/i915_dma.c | 31 ++++++++++++++++++++++++++++++-
>  drivers/gpu/drm/i915/i915_reg.h |  2 ++
>  2 files changed, 32 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c
> index e281298..283ace8 100644
> --- a/drivers/gpu/drm/i915/i915_dma.c
> +++ b/drivers/gpu/drm/i915/i915_dma.c
> @@ -1466,16 +1466,45 @@ static void i915_dump_device_info(struct drm_i915_private *dev_priv)
>   *   - it's judged too laborious to fill n static structures with the limit
>   *     when a simple if statement does the job,
>   *   - run-time checks (eg read fuse/strap registers) are needed.
> + *
> + * This function needs to be called:
> + *   - after the MMIO has been setup as we are reading registers,
> + *   - after the PCH has been detected,
> + *   - before the first usage of the fields it can tweak.
>   */
>  static void intel_device_info_runtime_init(struct drm_device *dev)
>  {
> +	struct drm_i915_private *dev_priv = dev->dev_private;
>  	struct intel_device_info *info;
>  
> -	info = (struct intel_device_info *)&to_i915(dev)->info;
> +	info = (struct intel_device_info *)&dev_priv->info;
>  
>  	info->num_sprites = 1;
>  	if (IS_VALLEYVIEW(dev))
>  		info->num_sprites = 2;
> +
> +	if ((INTEL_INFO(dev)->gen == 7 || INTEL_INFO(dev)->gen == 8) &&
> +	    !IS_VALLEYVIEW(dev)) {

I think we need a num_pipes > 0 check here, too. Our display hw guy
expressed surprise that we didn't hang the machine when reading pch
registers on a hsw platform, and Ben learned tha hard way that any such
access on ivb hard-hangs the box. Hence I think we need to retain the
current code's invariant that we never access the pch registers when
num_pipes is 0, like with one of the special pci matching rules.

I've merged the preceding patches to dinq meanwhile.
-Daniel

-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch

  reply	other threads:[~2014-02-10  9:12 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-07 19:12 Supporting fused display configurations v5 Damien Lespiau
2014-02-07 19:12 ` [PATCH 1/8] drm/i915: Always use INTEL_INFO() to access the device_info structure Damien Lespiau
2014-02-07 19:12 ` [PATCH 2/8] drm/i915: Make the intel_device_info structure kept in dev_priv writable Damien Lespiau
2014-02-10  9:09   ` Daniel Vetter
2014-02-10 12:49     ` Jani Nikula
2014-02-10 12:53     ` Ville Syrjälä
2014-02-10 14:06       ` Damien Lespiau
2014-02-10 14:17         ` Ville Syrjälä
2014-02-10 16:54           ` Daniel Vetter
2014-02-10 16:55       ` Daniel Vetter
2014-02-07 19:12 ` [PATCH 3/8] drm/i915: Move num_plane to the intel_device_info structure Damien Lespiau
2014-02-07 19:12 ` [PATCH 4/8] drm/i915: Consolidate FUSE_STRAP in one set of defines Damien Lespiau
2014-02-07 19:12 ` [PATCH 5/8] drm/i915: Disable display when fused off Damien Lespiau
2014-02-10  9:12   ` Daniel Vetter [this message]
2014-02-10 17:19     ` [PATCH 5/8 v5] " Damien Lespiau
2014-02-07 19:12 ` [PATCH 6/8] drm/i915: Use I915_MAX_PIPES in the pipe/plane_to_crtc_mapping definitions Damien Lespiau
2014-02-07 19:12 ` [PATCH 7/8] drm/i915: Reorder i915_params fields to not create holes Damien Lespiau
2014-02-07 19:12 ` [PATCH 8/8] drm/i915: Provide a command line option to disable display Damien Lespiau
2014-02-10  9:13   ` Daniel Vetter
2014-02-10 17:20     ` [PATCH 8/8 v2] " Damien Lespiau
2014-02-10 18:24       ` Daniel Vetter

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=20140210091202.GM17001@phenom.ffwll.local \
    --to=daniel@ffwll.ch \
    --cc=damien.lespiau@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    /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