public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
* [PATCH] drm/i915: Cache max number of pipes
@ 2017-10-12  6:30 Mika Kahola
  2017-10-12  6:33 ` Saarinen, Jani
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Mika Kahola @ 2017-10-12  6:30 UTC (permalink / raw)
  To: intel-gfx; +Cc: ville.syrjala, rodrigo.vivi

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.

Reference: https://bugs.freedesktop.org/show_bug.cgi?id=103206
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;
-- 
2.7.4

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

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH] drm/i915: Cache max number of pipes
  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
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 8+ messages in thread
From: Saarinen, Jani @ 2017-10-12  6:33 UTC (permalink / raw)
  To: Kahola, Mika, intel-gfx@lists.freedesktop.org
  Cc: ville.syrjala@intel.linux.com, Vivi, Rodrigo

HI, 
> -----Original Message-----
> From: Intel-gfx [mailto:intel-gfx-bounces@lists.freedesktop.org] On Behalf
> Of Mika Kahola
> Sent: torstai 12. lokakuuta 2017 9.30
> To: intel-gfx@lists.freedesktop.org
> Cc: ville.syrjala@intel.linux.com; Vivi, Rodrigo <rodrigo.vivi@intel.com>
> Subject: [Intel-gfx] [PATCH] drm/i915: Cache max number of pipes
> 
> 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.
> 
> Reference: https://bugs.freedesktop.org/show_bug.cgi?id=103206
> Signed-off-by: Mika Kahola <mika.kahola@intel.com>
This was also tested successfully on try-bot fixing issue seen, so maybe we can say tested-by: try-bot? 

> ---
>  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;
> --
> 2.7.4


Jani Saarinen
Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo


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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] drm/i915: Cache max number of pipes
  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  6:55 ` Jani Nikula
  2017-10-16 10:57   ` Mika Kahola
  2017-10-12  7:05 ` ✓ Fi.CI.BAT: success for " Patchwork
  2017-10-12  7:56 ` ✓ Fi.CI.IGT: " Patchwork
  3 siblings, 1 reply; 8+ messages in thread
From: Jani Nikula @ 2017-10-12  6:55 UTC (permalink / raw)
  To: Mika Kahola, intel-gfx; +Cc: ville.syrjala, rodrigo.vivi

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] drm/i915: Cache max number of pipes
  2017-10-12  6:33 ` Saarinen, Jani
@ 2017-10-12  7:02   ` Jani Nikula
  0 siblings, 0 replies; 8+ messages in thread
From: Jani Nikula @ 2017-10-12  7:02 UTC (permalink / raw)
  To: Saarinen, Jani, Kahola, Mika, intel-gfx@lists.freedesktop.org
  Cc: ville.syrjala@intel.linux.com, Vivi, Rodrigo

On Thu, 12 Oct 2017, "Saarinen, Jani" <jani.saarinen@intel.com> wrote:
> This was also tested successfully on try-bot fixing issue seen, so
> maybe we can say tested-by: try-bot?

Sure, but nacked-by: yours truly I'm afraid! ;)

BR,
Jani.

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* ✓ Fi.CI.BAT: success for drm/i915: Cache max number of pipes
  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  6:55 ` Jani Nikula
@ 2017-10-12  7:05 ` Patchwork
  2017-10-12  7:56 ` ✓ Fi.CI.IGT: " Patchwork
  3 siblings, 0 replies; 8+ messages in thread
From: Patchwork @ 2017-10-12  7:05 UTC (permalink / raw)
  To: Mika Kahola; +Cc: intel-gfx

== Series Details ==

Series: drm/i915: Cache max number of pipes
URL   : https://patchwork.freedesktop.org/series/31788/
State : success

== Summary ==

Series 31788v1 drm/i915: Cache max number of pipes
https://patchwork.freedesktop.org/api/1.0/series/31788/revisions/1/mbox/

Test chamelium:
        Subgroup dp-crc-fast:
                pass       -> FAIL       (fi-kbl-7500u) fdo#102514
Test gem_close_race:
        Subgroup basic-threads:
                dmesg-warn -> PASS       (fi-snb-2520m)
Test gem_ringfill:
        Subgroup basic-default-hang:
                incomplete -> DMESG-WARN (fi-blb-e6850) fdo#101600
Test kms_pipe_crc_basic:
        Subgroup suspend-read-crc-pipe-a:
                incomplete -> PASS       (fi-kbl-7567u) fdo#102846
Test drv_module_reload:
        Subgroup basic-reload:
                dmesg-warn -> PASS       (fi-cfl-s) fdo#103206 +1

fdo#102514 https://bugs.freedesktop.org/show_bug.cgi?id=102514
fdo#101600 https://bugs.freedesktop.org/show_bug.cgi?id=101600
fdo#102846 https://bugs.freedesktop.org/show_bug.cgi?id=102846
fdo#103206 https://bugs.freedesktop.org/show_bug.cgi?id=103206

fi-bdw-5557u     total:289  pass:268  dwarn:0   dfail:0   fail:0   skip:21  time:455s
fi-bdw-gvtdvm    total:289  pass:265  dwarn:0   dfail:0   fail:0   skip:24  time:473s
fi-blb-e6850     total:289  pass:223  dwarn:1   dfail:0   fail:0   skip:65  time:387s
fi-bsw-n3050     total:289  pass:243  dwarn:0   dfail:0   fail:0   skip:46  time:557s
fi-bwr-2160      total:289  pass:183  dwarn:0   dfail:0   fail:0   skip:106 time:284s
fi-bxt-dsi       total:289  pass:259  dwarn:0   dfail:0   fail:0   skip:30  time:521s
fi-bxt-j4205     total:289  pass:260  dwarn:0   dfail:0   fail:0   skip:29  time:519s
fi-byt-j1900     total:289  pass:253  dwarn:1   dfail:0   fail:0   skip:35  time:529s
fi-byt-n2820     total:289  pass:249  dwarn:1   dfail:0   fail:0   skip:39  time:517s
fi-cfl-s         total:287  pass:254  dwarn:1   dfail:0   fail:0   skip:31 
fi-elk-e7500     total:289  pass:229  dwarn:0   dfail:0   fail:0   skip:60  time:434s
fi-gdg-551       total:289  pass:178  dwarn:1   dfail:0   fail:1   skip:109 time:270s
fi-glk-1         total:289  pass:261  dwarn:0   dfail:0   fail:0   skip:28  time:600s
fi-hsw-4770r     total:289  pass:262  dwarn:0   dfail:0   fail:0   skip:27  time:437s
fi-ilk-650       total:289  pass:228  dwarn:0   dfail:0   fail:0   skip:61  time:455s
fi-ivb-3520m     total:289  pass:260  dwarn:0   dfail:0   fail:0   skip:29  time:495s
fi-ivb-3770      total:289  pass:260  dwarn:0   dfail:0   fail:0   skip:29  time:474s
fi-kbl-7500u     total:289  pass:263  dwarn:1   dfail:0   fail:1   skip:24  time:493s
fi-kbl-7560u     total:289  pass:270  dwarn:0   dfail:0   fail:0   skip:19  time:584s
fi-kbl-7567u     total:289  pass:265  dwarn:4   dfail:0   fail:0   skip:20  time:487s
fi-kbl-r         total:289  pass:262  dwarn:0   dfail:0   fail:0   skip:27  time:590s
fi-pnv-d510      total:289  pass:222  dwarn:1   dfail:0   fail:0   skip:66  time:657s
fi-skl-6260u     total:289  pass:269  dwarn:0   dfail:0   fail:0   skip:20  time:464s
fi-skl-6700hq    total:289  pass:263  dwarn:0   dfail:0   fail:0   skip:26  time:657s
fi-skl-6700k     total:289  pass:265  dwarn:0   dfail:0   fail:0   skip:24  time:530s
fi-skl-6770hq    total:289  pass:269  dwarn:0   dfail:0   fail:0   skip:20  time:504s
fi-skl-gvtdvm    total:289  pass:266  dwarn:0   dfail:0   fail:0   skip:23  time:473s
fi-snb-2520m     total:289  pass:250  dwarn:0   dfail:0   fail:0   skip:39  time:572s
fi-snb-2600      total:289  pass:249  dwarn:0   dfail:0   fail:0   skip:40  time:428s

6a96415ec560527f41089b246c06e7fd75991791 drm-tip: 2017y-10m-11d-19h-08m-29s UTC integration manifest
261b984bcbc2 drm/i915: Cache max number of pipes

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_6002/
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 8+ messages in thread

* ✓ Fi.CI.IGT: success for drm/i915: Cache max number of pipes
  2017-10-12  6:30 [PATCH] drm/i915: Cache max number of pipes Mika Kahola
                   ` (2 preceding siblings ...)
  2017-10-12  7:05 ` ✓ Fi.CI.BAT: success for " Patchwork
@ 2017-10-12  7:56 ` Patchwork
  3 siblings, 0 replies; 8+ messages in thread
From: Patchwork @ 2017-10-12  7:56 UTC (permalink / raw)
  To: Mika Kahola; +Cc: intel-gfx

== Series Details ==

Series: drm/i915: Cache max number of pipes
URL   : https://patchwork.freedesktop.org/series/31788/
State : success

== Summary ==

Test kms_cursor_legacy:
        Subgroup cursorA-vs-flipA-atomic-transitions:
                pass       -> FAIL       (shard-hsw) fdo#102723
Test kms_setmode:
        Subgroup basic:
                pass       -> FAIL       (shard-hsw) fdo#99912
Test kms_flip:
        Subgroup flip-vs-rmfb:
                dmesg-warn -> PASS       (shard-hsw) fdo#102614

fdo#102723 https://bugs.freedesktop.org/show_bug.cgi?id=102723
fdo#99912 https://bugs.freedesktop.org/show_bug.cgi?id=99912
fdo#102614 https://bugs.freedesktop.org/show_bug.cgi?id=102614

shard-hsw        total:2552 pass:1439 dwarn:0   dfail:0   fail:10  skip:1103 time:9647s

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_6002/shards.html
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] drm/i915: Cache max number of pipes
  2017-10-12  6:55 ` Jani Nikula
@ 2017-10-16 10:57   ` Mika Kahola
  2017-10-16 12:50     ` Jani Nikula
  0 siblings, 1 reply; 8+ messages in thread
From: Mika Kahola @ 2017-10-16 10:57 UTC (permalink / raw)
  To: Jani Nikula, intel-gfx; +Cc: ville.syrjala, rodrigo.vivi

On Thu, 2017-10-12 at 09:55 +0300, Jani Nikula wrote:
> 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
Right. So instead of doing this we shouldn't initialize the audio at
all in case of disabled display? num_pipes variable just gets updated
too late and audio part has already started to initialize itself.
 
>  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;
-- 
Mika Kahola - Intel OTC

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] drm/i915: Cache max number of pipes
  2017-10-16 10:57   ` Mika Kahola
@ 2017-10-16 12:50     ` Jani Nikula
  0 siblings, 0 replies; 8+ messages in thread
From: Jani Nikula @ 2017-10-16 12:50 UTC (permalink / raw)
  To: mika.kahola, intel-gfx; +Cc: ville.syrjala, rodrigo.vivi

On Mon, 16 Oct 2017, Mika Kahola <mika.kahola@intel.com> wrote:
> On Thu, 2017-10-12 at 09:55 +0300, Jani Nikula wrote:
>> 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
> Right. So instead of doing this we shouldn't initialize the audio at
> all in case of disabled display? num_pipes variable just gets updated
> too late and audio part has already started to initialize itself.

Correct.

BR,
Jani.

>  
>>  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

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2017-10-16 12:48 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox