All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@linux.intel.com>
To: Mika Kahola <mika.kahola@intel.com>, intel-gfx@lists.freedesktop.org
Cc: ville.syrjala@intel.linux.com, rodrigo.vivi@intel.com
Subject: Re: [PATCH] drm/i915: Cache max number of pipes
Date: Thu, 12 Oct 2017 09:55:14 +0300	[thread overview]
Message-ID: <87a80wonxp.fsf@intel.com> (raw)
In-Reply-To: <1507789821-10235-1-git-send-email-mika.kahola@intel.com>

On Thu, 12 Oct 2017, Mika Kahola <mika.kahola@intel.com> wrote:
> CI system spotted an error on CFL system when running IGT tests with
> display disabled. In this case, the 'INTEL_INFO(dev_priv)->num_pipes'
> is set to 0. This will cause that we prematurely return from
> 'get_saved_enc()'.
>
> To fix this issue, the patch introduces a 'max_pipes' variable which caches
> the maximum number of available pipes.

This is not the right fix. The audio component init should be skipped
and thus all component calls blocked when num_pipes == 0. It's just that
the num_pipes = 0 happens way too late when the display is fused off or
disabled via modparam.

This makes me wonder how many things we actually screw up because
intel_device_info_runtime_init() happens too late.

> Reference: https://bugs.freedesktop.org/show_bug.cgi?id=103206

If this patch fixes the bug, we use Bugzilla: tag. Reference: is for
other references, e.g. the referenced bug is related to the patch at
hand somehow, but this does not fix the bug.

BR,
Jani.


> Signed-off-by: Mika Kahola <mika.kahola@intel.com>
> ---
>  drivers/gpu/drm/i915/i915_drv.h          | 1 +
>  drivers/gpu/drm/i915/intel_audio.c       | 2 +-
>  drivers/gpu/drm/i915/intel_device_info.c | 2 ++
>  3 files changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
> index 770305b..6229ff8 100644
> --- a/drivers/gpu/drm/i915/i915_drv.h
> +++ b/drivers/gpu/drm/i915/i915_drv.h
> @@ -868,6 +868,7 @@ struct intel_device_info {
>  	u8 num_pipes;
>  	u8 num_sprites[I915_MAX_PIPES];
>  	u8 num_scalers[I915_MAX_PIPES];
> +	u8 max_pipes;
>  
>  	unsigned int page_sizes; /* page sizes supported by the HW */
>  
> diff --git a/drivers/gpu/drm/i915/intel_audio.c b/drivers/gpu/drm/i915/intel_audio.c
> index 0ddba16..147bd3d 100644
> --- a/drivers/gpu/drm/i915/intel_audio.c
> +++ b/drivers/gpu/drm/i915/intel_audio.c
> @@ -754,7 +754,7 @@ static struct intel_encoder *get_saved_enc(struct drm_i915_private *dev_priv,
>  {
>  	struct intel_encoder *encoder;
>  
> -	if (WARN_ON(pipe >= INTEL_INFO(dev_priv)->num_pipes))
> +	if (WARN_ON(pipe >= INTEL_INFO(dev_priv)->max_pipes))
>  		return NULL;
>  
>  	/* MST */
> diff --git a/drivers/gpu/drm/i915/intel_device_info.c b/drivers/gpu/drm/i915/intel_device_info.c
> index 875d428..ba1a807 100644
> --- a/drivers/gpu/drm/i915/intel_device_info.c
> +++ b/drivers/gpu/drm/i915/intel_device_info.c
> @@ -376,6 +376,8 @@ void intel_device_info_runtime_init(struct drm_i915_private *dev_priv)
>  			info->num_sprites[pipe] = 1;
>  	}
>  
> +	info->max_pipes = info->num_pipes;
> +
>  	if (i915_modparams.disable_display) {
>  		DRM_INFO("Display disabled (module parameter)\n");
>  		info->num_pipes = 0;

-- 
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  parent reply	other threads:[~2017-10-12  6:55 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-12  6:30 [PATCH] drm/i915: Cache max number of pipes Mika Kahola
2017-10-12  6:33 ` Saarinen, Jani
2017-10-12  7:02   ` Jani Nikula
2017-10-12  6:55 ` Jani Nikula [this message]
2017-10-16 10:57   ` Mika Kahola
2017-10-16 12:50     ` Jani Nikula
2017-10-12  7:05 ` ✓ Fi.CI.BAT: success for " Patchwork
2017-10-12  7:56 ` ✓ 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=87a80wonxp.fsf@intel.com \
    --to=jani.nikula@linux.intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=mika.kahola@intel.com \
    --cc=rodrigo.vivi@intel.com \
    --cc=ville.syrjala@intel.linux.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.