Skip to contentSkip to conversation

drm/i915: Cache max number of pipes

PATCH In review Mika Kahola 4 participants 8 messages Oct 12, 2017 – Oct 16, 2017

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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

---
 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(-)
drivers/gpu/drm/i915/i915_drv.h +1 -0
index 770305b..6229ff8 100644
@@ -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 */
 
drivers/gpu/drm/i915/intel_audio.c +1 -1
index 0ddba16..147bd3d 100644
@@ -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 */
drivers/gpu/drm/i915/intel_device_info.c +2 -0
index 875d428..ba1a807 100644
@@ -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;
Signature · 6 lines
2.7.4

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#1 lore raw

HI,

Quoted 12 lines

-----Original Message-----
From: Intel-gfx [mailto:[email protected]] On Behalf Of Mika Kahola
Sent: torstai 12. lokakuuta 2017 9.30
To: [email protected]
Cc: [email protected]; Vivi, Rodrigo <[email protected]>
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()'.

Quoted 5 lines

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

This was also tested successfully on try-bot fixing issue seen, so maybe we can say tested-by: try-bot?

Quoted 46 lines
---
 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(-)
(quoted diff) +0 -0

b/drivers/gpu/drm/i915/i915_drv.h index 770305b..6229ff8 100644

drivers/gpu/drm/i915/i915_drv.h +1 -0
@@ -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 */
 
drivers/gpu/drm/i915/intel_audio.c +1 -1
index 0ddba16..147bd3d 100644
@@ -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 */
drivers/gpu/drm/i915/intel_device_info.c +2 -0
index 875d428..ba1a807 100644
@@ -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");
Quoted 3 lines

info->num_pipes = 0;
--
2.7.4

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

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

maintainer
#2 lore raw
Quoted 2 lines · Jani

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.

Signature · 5 lines
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
maintainer
#3 lore raw
In reply to Mika Kahola
Quoted 7 lines · Mika Kahola

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.

Quoted 1 line

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.

Quoted 45 lines
---
 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(-)
drivers/gpu/drm/i915/i915_drv.h +1 -0
index 770305b..6229ff8 100644
@@ -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 */
 
drivers/gpu/drm/i915/intel_audio.c +1 -1
index 0ddba16..147bd3d 100644
@@ -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 */
drivers/gpu/drm/i915/intel_device_info.c +2 -0
index 875d428..ba1a807 100644
@@ -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;
Signature · 5 lines
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#4 lore raw
Quoted 19 lines · Jani Nikula
Quoted 11 lines · Mika Kahola

CI system spotted an error on CFL system when running IGT tests with
display disabled. In this case, the 'INTEL_INFO(dev_priv)-

Quoted 1 line

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.

Quoted 2 lines

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.

Quoted 64 lines

late.

Quoted 2 lines

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.

Quoted 52 lines

---
 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(-)
drivers/gpu/drm/i915/i915_drv.h +1 -0
index 770305b..6229ff8 100644
@@ -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 */

drivers/gpu/drm/i915/intel_audio.c +0 -0
index 0ddba16..147bd3d 100644
@@ -754,7 +754,7 @@ static struct intel_encoder
 *get_saved_enc(struct drm_i915_private *dev_priv,
  {
  	struct intel_encoder *encoder;

drivers/gpu/drm/i915/intel_audio.c +1 -1
-	if (WARN_ON(pipe >= INTEL_INFO(dev_priv)->num_pipes))
+	if (WARN_ON(pipe >= INTEL_INFO(dev_priv)->max_pipes))

  return NULL;

  /* MST */

drivers/gpu/drm/i915/intel_device_info.c +0 -0
index 875d428..ba1a807 100644
@@ -376,6 +376,8 @@ void intel_device_info_runtime_init(struct
 drm_i915_private *dev_priv)
  			info->num_sprites[pipe] = 1;
  	}

drivers/gpu/drm/i915/intel_device_info.c +2 -0
+	info->max_pipes = info->num_pipes;
+

  if (i915_modparams.disable_display) { DRM_INFO("Display disabled (module parameter)\n"); info->num_pipes = 0;

Signature · 6 lines
Mika Kahola - Intel OTC

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
maintainer
#5 lore raw
Quoted 20 lines · Mika Kahola
Quoted 19 lines · Jani Nikula
Quoted 11 lines · Mika Kahola

CI system spotted an error on CFL system when running IGT tests with
display disabled. In this case, the 'INTEL_INFO(dev_priv)-

Quoted 1 line

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.

Quoted 5 lines
Quoted 2 lines

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.

Quoted 65 lines

Quoted 64 lines

late.

Quoted 2 lines

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.

Quoted 52 lines

---
 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(-)
drivers/gpu/drm/i915/i915_drv.h +1 -0
index 770305b..6229ff8 100644
@@ -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 */

drivers/gpu/drm/i915/intel_audio.c +0 -0
index 0ddba16..147bd3d 100644
@@ -754,7 +754,7 @@ static struct intel_encoder
 *get_saved_enc(struct drm_i915_private *dev_priv,
  {
  	struct intel_encoder *encoder;

drivers/gpu/drm/i915/intel_audio.c +1 -1
-	if (WARN_ON(pipe >= INTEL_INFO(dev_priv)->num_pipes))
+	if (WARN_ON(pipe >= INTEL_INFO(dev_priv)->max_pipes))

  return NULL;

  /* MST */

drivers/gpu/drm/i915/intel_device_info.c +0 -0
index 875d428..ba1a807 100644
@@ -376,6 +376,8 @@ void intel_device_info_runtime_init(struct
 drm_i915_private *dev_priv)
  			info->num_sprites[pipe] = 1;
  	}

drivers/gpu/drm/i915/intel_device_info.c +2 -0
+	info->max_pipes = info->num_pipes;
+

  if (i915_modparams.disable_display) { DRM_INFO("Display disabled (module parameter)\n"); info->num_pipes = 0;

Signature · 5 lines
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#6 lore raw

✓ Fi.CI.BAT: success for drm/i915: Cache max number of pipes

In reply to Mika Kahola
== Series Details ==

== 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
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#7 lore raw

✓ Fi.CI.IGT: success for drm/i915: Cache max number of pipes

In reply to Mika Kahola
== Series Details ==

== 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
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx