Skip to contentSkip to conversation

drm/i915: Check num_pipes before initializing audio component

PATCH In review Wang Elaine 3 participants 8 messages Dec 19, 2016 – Dec 23, 2016

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

PATCH v2 1/2 drm/i915: Check num_pipes before initializing audio component

From: Elaine Wang <[email protected]>

when num_pipes is zero, it indicates there is no display and HDMI audio doesn't exist.

v2: Move the check from caller to callee for consistency.

Cc Chris Wilson <[email protected]>
Cc Joonas Lahtinen <[email protected]>
Cc Jani Nikula <[email protected]>
---
 drivers/gpu/drm/i915/intel_audio.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/gpu/drm/i915/intel_audio.c +3 -0
index 3bbc96c..16c2027 100644
@@ -928,6 +928,9 @@ void i915_audio_component_init(struct drm_i915_private *dev_priv)
 {
 	int ret;
 
+	if (INTEL_INFO(dev_priv)->num_pipes == 0)
+		return;
+
 	ret = component_add(dev_priv->drm.dev, &i915_audio_component_bind_ops);
 	if (ret < 0) {
 		DRM_ERROR("failed to add audio component (%d)\n", ret);
Signature · 6 lines
1.9.1

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

PATCH v2 2/2 drm/i915: Check num_pipes before initializing or calling display hooks

From: Elaine Wang <[email protected]>

when num_pipes is zero, it indicates display doesn't exist, so there is no need to initialize display hooks. And to avoid calling these uninitialized display hooks, respect num_pipes at the beginning of intel_modeset_init_hw and intel_init_clock_gating.

intel_init_pm() calls FBC init function and then initializes water mark hooks. Both aren't needed when display doesn't exist. Add checking num_pipes at the beginning of intel_init_pm().

v2: Move one check from caller to callee for consistency.

Cc Chris Wilson <[email protected]>
Cc Joonas Lahtinen <[email protected]>
Cc Jani Nikula <[email protected]>
---
 drivers/gpu/drm/i915/intel_display.c |  6 ++++++
 drivers/gpu/drm/i915/intel_pm.c      | 10 +++++++++-
 2 files changed, 15 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/intel_display.c +6 -0
index 9cc5dbf..e079ea7 100644
@@ -16030,6 +16030,9 @@ static void intel_atomic_state_free(struct drm_atomic_state *state)
  */
 void intel_init_display_hooks(struct drm_i915_private *dev_priv)
 {
+	if (INTEL_INFO(dev_priv)->num_pipes == 0)
+		return;
+
 	if (INTEL_INFO(dev_priv)->gen >= 9) {
 		dev_priv->display.get_pipe_config = haswell_get_pipe_config;
 		dev_priv->display.get_initial_plane_config =
@@ -16412,6 +16415,9 @@ void intel_modeset_init_hw(struct drm_device *dev)
 {
 	struct drm_i915_private *dev_priv = to_i915(dev);
 
+	if (INTEL_INFO(dev_priv)->num_pipes == 0)
+		return;
+
 	intel_update_cdclk(dev_priv);
 
 	dev_priv->atomic_cdclk_freq = dev_priv->cdclk_freq;
drivers/gpu/drm/i915/intel_pm.c +9 -1
index d0834b3..6438ada 100644
@@ -7619,7 +7619,8 @@ static void i830_init_clock_gating(struct drm_i915_private *dev_priv)
 
 void intel_init_clock_gating(struct drm_i915_private *dev_priv)
 {
-	dev_priv->display.init_clock_gating(dev_priv);
+	if (INTEL_INFO(dev_priv)->num_pipes)
+		dev_priv->display.init_clock_gating(dev_priv);
 }
 
 void intel_suspend_hw(struct drm_i915_private *dev_priv)
@@ -7644,6 +7645,10 @@ static void nop_init_clock_gating(struct drm_i915_private *dev_priv)
  */
 void intel_init_clock_gating_hooks(struct drm_i915_private *dev_priv)
 {
+
+	if (INTEL_INFO(dev_priv)->num_pipes == 0)
+		return;
+
 	if (IS_SKYLAKE(dev_priv))
 		dev_priv->display.init_clock_gating = skylake_init_clock_gating;
 	else if (IS_KABYLAKE(dev_priv))
@@ -7685,6 +7690,9 @@ void intel_init_clock_gating_hooks(struct drm_i915_private *dev_priv)
 /* Set up chip specific power management-related functions */
 void intel_init_pm(struct drm_i915_private *dev_priv)
 {
+	if (INTEL_INFO(dev_priv)->num_pipes == 0)
+		return;
+
 	intel_fbc_init(dev_priv);
 
 	/* For cxsr */
Signature · 6 lines
1.9.1

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

Re: [PATCH v2 2/2] drm/i915: Check num_pipes before initializing or calling display hooks

Quoted 61 lines · Wang Elaine

From: Elaine Wang <[email protected]>

when num_pipes is zero, it indicates display doesn't exist, so there is no need to initialize display hooks. And to avoid calling these uninitialized display hooks, respect num_pipes at the beginning of intel_modeset_init_hw and intel_init_clock_gating.

intel_init_pm() calls FBC init function and then initializes water mark hooks. Both aren't needed when display doesn't exist. Add checking num_pipes at the beginning of intel_init_pm().

v2: Move one check from caller to callee for consistency.

Cc Chris Wilson <[email protected]>
Cc Joonas Lahtinen <[email protected]>
Cc Jani Nikula <[email protected]>
---
 drivers/gpu/drm/i915/intel_display.c |  6 ++++++
 drivers/gpu/drm/i915/intel_pm.c      | 10 +++++++++-
 2 files changed, 15 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/intel_display.c +6 -0
index 9cc5dbf..e079ea7 100644
@@ -16030,6 +16030,9 @@ static void intel_atomic_state_free(struct drm_atomic_state *state)
  */
 void intel_init_display_hooks(struct drm_i915_private *dev_priv)
 {
+	if (INTEL_INFO(dev_priv)->num_pipes == 0)
+		return;
+
 	if (INTEL_INFO(dev_priv)->gen >= 9) {
 		dev_priv->display.get_pipe_config = haswell_get_pipe_config;
 		dev_priv->display.get_initial_plane_config =
@@ -16412,6 +16415,9 @@ void intel_modeset_init_hw(struct drm_device *dev)
 {
 	struct drm_i915_private *dev_priv = to_i915(dev);
 
+	if (INTEL_INFO(dev_priv)->num_pipes == 0)
+		return;
+
 	intel_update_cdclk(dev_priv);
 
 	dev_priv->atomic_cdclk_freq = dev_priv->cdclk_freq;
drivers/gpu/drm/i915/intel_pm.c +2 -1
index d0834b3..6438ada 100644
@@ -7619,7 +7619,8 @@ static void i830_init_clock_gating(struct drm_i915_private *dev_priv)
 
 void intel_init_clock_gating(struct drm_i915_private *dev_priv)
 {
-	dev_priv->display.init_clock_gating(dev_priv);
+	if (INTEL_INFO(dev_priv)->num_pipes)
+		dev_priv->display.init_clock_gating(dev_priv);
 }
 
 void intel_suspend_hw(struct drm_i915_private *dev_priv)

drivers/gpu/drm/i915/intel_pm.c static void nop_init_clock_gating(struct drm_i915_private *dev_priv) · line 7651

Quoted 7 lines
drivers/gpu/drm/i915/intel_pm.c +4 -0
@@ -7644,6 +7645,10 @@ static void nop_init_clock_gating(struct drm_i915_private *dev_priv)
  */
 void intel_init_clock_gating_hooks(struct drm_i915_private *dev_priv)
 {
+
+	if (INTEL_INFO(dev_priv)->num_pipes == 0)
+		return;
+

Looks like this would be neater by doing

	if (INTEL_INFO(dev_priv)->num_pipes == 0)
		dev_priv->display.init_clock_gating = nop_init_clock_gating;
	else if (IS_SKYLAKE(dev_priv))
		...

and you can leave out the check in intel_init_clock_gating().

We really want to minimize the amount of these checks sprinkled around.

BR,
Jani.

Quoted 12 lines
drivers/gpu/drm/i915/intel_pm.c +3 -0
 		dev_priv->display.init_clock_gating = skylake_init_clock_gating;
 	else if (IS_KABYLAKE(dev_priv))
@@ -7685,6 +7690,9 @@ void intel_init_clock_gating_hooks(struct drm_i915_private *dev_priv)
 /* Set up chip specific power management-related functions */
 void intel_init_pm(struct drm_i915_private *dev_priv)
 {
+	if (INTEL_INFO(dev_priv)->num_pipes == 0)
+		return;
+
 	intel_fbc_init(dev_priv);
 
 	/* For cxsr */
Signature · 5 lines
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#3 lore raw

Re: [PATCH v2 2/2] drm/i915: Check num_pipes before initializing or calling display hooks

Quoted 90 lines

-----Original Message-----
From: Jani Nikula [mailto:[email protected]]
Sent: Thursday, December 22, 2016 6:48 PM
To: Wang, Elaine <[email protected]>; [email protected]; Wang, Elaine <[email protected]>
Cc: Chris Wilson <[email protected]>; Joonas Lahtinen <[email protected]>
Subject: Re: [PATCH v2 2/2] drm/i915: Check num_pipes before initializing or calling display hooks

drivers/gpu/drm/i915/intel_display.c static void intel_atomic_state_free(struct

Quoted 28 lines · Wang Elaine

From: Elaine Wang <[email protected]>

when num_pipes is zero, it indicates display doesn't exist, so there is no need to initialize display hooks. And to avoid calling these uninitialized display hooks, respect num_pipes at the beginning of intel_modeset_init_hw and intel_init_clock_gating.

intel_init_pm() calls FBC init function and then initializes water mark hooks. Both aren't needed when display doesn't exist. Add checking num_pipes at the beginning of intel_init_pm().

v2: Move one check from caller to callee for consistency.

Cc Chris Wilson <[email protected]>
Cc Joonas Lahtinen <[email protected]>
Cc Jani Nikula <[email protected]>
---
 drivers/gpu/drm/i915/intel_display.c |  6 ++++++
 drivers/gpu/drm/i915/intel_pm.c      | 10 +++++++++-
 2 files changed, 15 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/intel_display.c +0 -0
index 9cc5dbf..e079ea7 100644
@@ -16030,6 +16030,9 @@ static void intel_atomic_state_free(struct

drm_atomic_state *state)

drivers/gpu/drm/i915/intel_display.c static void intel_atomic_state_free(struct drm_atomic_state *state)

Quoted 7 lines
drivers/gpu/drm/i915/intel_display.c +3 -0
  */
 void intel_init_display_hooks(struct drm_i915_private *dev_priv)  {
+	if (INTEL_INFO(dev_priv)->num_pipes == 0)
+		return;
+
 	if (INTEL_INFO(dev_priv)->gen >= 9) {
 		dev_priv->display.get_pipe_config =

haswell_get_pipe_config;

drivers/gpu/drm/i915/intel_display.c static void intel_atomic_state_free(struct · line 16037

Quoted 1 line
drivers/gpu/drm/i915/intel_display.c +0 -0
 		dev_priv->display.get_initial_plane_config = @@ -16412,6

+16415,9

Quoted 14 lines
drivers/gpu/drm/i915/intel_display.c +0 -0
 @@ void intel_modeset_init_hw(struct drm_device *dev)  {
drivers/gpu/drm/i915/intel_display.c +3 -0
 	struct drm_i915_private *dev_priv = to_i915(dev);
 
+	if (INTEL_INFO(dev_priv)->num_pipes == 0)
+		return;
+
 	intel_update_cdclk(dev_priv);
 
 	dev_priv->atomic_cdclk_freq = dev_priv->cdclk_freq; diff --git

a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c index d0834b3..6438ada 100644

drivers/gpu/drm/i915/intel_pm.c static void i830_init_clock_gating(struct

Quoted 10 lines
drivers/gpu/drm/i915/intel_pm.c +3 -1
@@ -7619,7 +7619,8 @@ static void i830_init_clock_gating(struct
 drm_i915_private *dev_priv)
 
 void intel_init_clock_gating(struct drm_i915_private *dev_priv)  {
-	dev_priv->display.init_clock_gating(dev_priv);
+	if (INTEL_INFO(dev_priv)->num_pipes)
+		dev_priv->display.init_clock_gating(dev_priv);
 }
 
 void intel_suspend_hw(struct drm_i915_private *dev_priv) @@ -7644,6
+7645,10 @@ static void nop_init_clock_gating(struct drm_i915_private

*dev_priv)

drivers/gpu/drm/i915/intel_pm.c static void nop_init_clock_gating(struct drm_i915_private *dev_priv) · line 7651

Quoted 7 lines

*/
void intel_init_clock_gating_hooks(struct drm_i915_private *dev_priv)
{

drivers/gpu/drm/i915/intel_pm.c +4 -0
+
+	if (INTEL_INFO(dev_priv)->num_pipes == 0)
+		return;
+

Looks like this would be neater by doing

	if (INTEL_INFO(dev_priv)->num_pipes == 0)
		dev_priv->display.init_clock_gating = nop_init_clock_gating;
	else if (IS_SKYLAKE(dev_priv))
		...
Quoted 7 lines

and you can leave out the check in intel_init_clock_gating().

We really want to minimize the amount of these checks sprinkled around.

BR,
Jani.

I see. Thanks for the comment. I'll update this patch later. Thanks,
Elaine

Quoted 14 lines
Quoted 3 lines

dev_priv->display.init_clock_gating =

skylake_init_clock_gating;

Quoted 10 lines
drivers/gpu/drm/i915/intel_pm.c +3 -0
 	else if (IS_KABYLAKE(dev_priv))
@@ -7685,6 +7690,9 @@ void intel_init_clock_gating_hooks(struct
 drm_i915_private *dev_priv)
 /* Set up chip specific power management-related functions */  void
 intel_init_pm(struct drm_i915_private *dev_priv)  {
+	if (INTEL_INFO(dev_priv)->num_pipes == 0)
+		return;
+
 	intel_fbc_init(dev_priv);
 
Quoted 4 lines

drivers/gpu/drm/i915/intel_pm.c void intel_init_clock_gating_hooks(struct drm_i915_private *dev_priv) · line 7698

Quoted 1 line
drivers/gpu/drm/i915/intel_pm.c +0 -0
 	/* For cxsr */

--
Jani Nikula, Intel Open Source Technology Center

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

#4 lore raw

✗ Fi.CI.BAT: warning for series starting with [v2,1/2] drm/i915: Check num_pipes before initializing audio component

In reply to Wang Elaine
== Series Details ==

== Series Details ==

Series: series starting with [v2,1/2] drm/i915: Check num_pipes before initializing audio component
URL : https://patchwork.freedesktop.org/series/16987/
State : warning

== Summary ==

Series 16987v1 Series without cover letter
https://patchwork.freedesktop.org/api/1.0/series/16987/revisions/1/mbox/

Test drv_module_reload:

        Subgroup basic-reload-inject:
                dmesg-warn -> PASS       (fi-ilk-650)
Test kms_frontbuffer_tracking:
        Subgroup basic:
                pass       -> DMESG-WARN (fi-bxt-j4205)
Test kms_pipe_crc_basic:
        Subgroup suspend-read-crc-pipe-a:
                skip       -> PASS       (fi-bxt-j4205)
        Subgroup suspend-read-crc-pipe-b:
                skip       -> PASS       (fi-bxt-j4205)
        Subgroup suspend-read-crc-pipe-c:
                skip       -> PASS       (fi-bxt-j4205)
Test pm_backlight:
        Subgroup basic-brightness:
                skip       -> PASS       (fi-bxt-j4205)
fi-bdw-5557u     total:247  pass:233  dwarn:0   dfail:0   fail:0   skip:14 
fi-bsw-n3050     total:247  pass:208  dwarn:0   dfail:0   fail:0   skip:39 
fi-bxt-j4205     total:247  pass:225  dwarn:1   dfail:0   fail:0   skip:21 
fi-bxt-t5700     total:247  pass:220  dwarn:0   dfail:0   fail:0   skip:27 
fi-byt-j1900     total:247  pass:220  dwarn:0   dfail:0   fail:0   skip:27 
fi-byt-n2820     total:247  pass:216  dwarn:0   dfail:0   fail:0   skip:31 
fi-hsw-4770      total:247  pass:228  dwarn:0   dfail:0   fail:0   skip:19 
fi-hsw-4770r     total:247  pass:228  dwarn:0   dfail:0   fail:0   skip:19 
fi-ilk-650       total:247  pass:195  dwarn:0   dfail:0   fail:0   skip:52 
fi-ivb-3520m     total:247  pass:226  dwarn:0   dfail:0   fail:0   skip:21 
fi-ivb-3770      total:247  pass:226  dwarn:0   dfail:0   fail:0   skip:21 
fi-kbl-7500u     total:247  pass:226  dwarn:0   dfail:0   fail:0   skip:21 
fi-skl-6260u     total:247  pass:234  dwarn:0   dfail:0   fail:0   skip:13 
fi-skl-6700hq    total:247  pass:227  dwarn:0   dfail:0   fail:0   skip:20 
fi-skl-6700k     total:247  pass:224  dwarn:3   dfail:0   fail:0   skip:20 
fi-skl-6770hq    total:247  pass:234  dwarn:0   dfail:0   fail:0   skip:13 
fi-snb-2520m     total:247  pass:216  dwarn:0   dfail:0   fail:0   skip:31 
fi-snb-2600      total:247  pass:215  dwarn:0   dfail:0   fail:0   skip:32 

2a932d085375c80a1bbb332799db3df9738e8eba drm-tip: 2016y-12m-18d-16h-31m-05s UTC integration manifest 46a490f drm/i915: Check num_pipes before initializing or calling display hooks cdd47ca drm/i915: Check num_pipes before initializing audio component

== Logs ==

For more details see: https://intel-gfx-ci.01.org/CI/Patchwork_3325/
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#5 lore raw

Re: ✗ Fi.CI.BAT: warning for series starting with [v2,1/2] drm/i915: Check num_pipes before initializing audio component

These 2 patches shouldn't impact the platforms that have none zero num_pipes. BXT has 3 pipes, so the dmesg warning in following test case isn't caused by these 2 patches.

Test kms_frontbuffer_tracking:

         Subgroup basic:
	              pass       -> DMESG-WARN (fi-bxt-j4205)

https://intel-gfx-ci.01.org/CI/Patchwork_3325/fi-bxt-j4205/dmesg-before.log
https://intel-gfx-ci.01.org/CI/Patchwork_3325/fi-bxt-j4205/dmesg-during.log

432.694507] [IGT] kms_frontbuffer_tracking: executing

[  432.726114] [drm:drm_mode_addfb2] [FB:88]
[  432.726471] [drm:drm_mode_addfb2] [FB:90]
[  432.726676] [drm:drm_mode_addfb2] [FB:91]
[  432.731670] [drm:drm_mode_addfb2] [FB:92]
[  432.761242] [drm:drm_mode_addfb2] [FB:93]
[  432.763241] [drm:drm_mode_setcrtc] [CRTC:33:pipe A]
[  432.763456] [drm:drm_mode_setcrtc] [CONNECTOR:51:eDP-1]
[  432.900225] [drm:intel_dp_sink_crc [i915]] *ERROR* Panel is unable to calculate any CRC after 6 vblanks
[  432.918159] [IGT] kms_frontbuffer_tracking: starting subtest basic
....
[  437.896719] [IGT] kms_frontbuffer_tracking: exiting, ret=0
Quoted 56 lines

-----Original Message-----
From: Patchwork [mailto:[email protected]]
Sent: Monday, December 19, 2016 7:46 PM
To: Wang, Elaine <[email protected]>
Cc: [email protected]
Subject: ✗ Fi.CI.BAT: warning for series starting with [v2,1/2] drm/i915: Check num_pipes before initializing audio component

== Series Details ==

Series: series starting with [v2,1/2] drm/i915: Check num_pipes before initializing audio component
URL : https://patchwork.freedesktop.org/series/16987/
State : warning

== Summary ==

Series 16987v1 Series without cover letter
https://patchwork.freedesktop.org/api/1.0/series/16987/revisions/1/mbox/

Test drv_module_reload:

        Subgroup basic-reload-inject:
                dmesg-warn -> PASS       (fi-ilk-650)
Test kms_frontbuffer_tracking:
        Subgroup basic:
                pass       -> DMESG-WARN (fi-bxt-j4205)
Test kms_pipe_crc_basic:
        Subgroup suspend-read-crc-pipe-a:
                skip       -> PASS       (fi-bxt-j4205)
        Subgroup suspend-read-crc-pipe-b:
                skip       -> PASS       (fi-bxt-j4205)
        Subgroup suspend-read-crc-pipe-c:
                skip       -> PASS       (fi-bxt-j4205)
Test pm_backlight:
        Subgroup basic-brightness:
                skip       -> PASS       (fi-bxt-j4205)
fi-bdw-5557u     total:247  pass:233  dwarn:0   dfail:0   fail:0   skip:14
fi-bsw-n3050     total:247  pass:208  dwarn:0   dfail:0   fail:0   skip:39
fi-bxt-j4205     total:247  pass:225  dwarn:1   dfail:0   fail:0   skip:21
fi-bxt-t5700     total:247  pass:220  dwarn:0   dfail:0   fail:0   skip:27
fi-byt-j1900     total:247  pass:220  dwarn:0   dfail:0   fail:0   skip:27
fi-byt-n2820     total:247  pass:216  dwarn:0   dfail:0   fail:0   skip:31
fi-hsw-4770      total:247  pass:228  dwarn:0   dfail:0   fail:0   skip:19
fi-hsw-4770r     total:247  pass:228  dwarn:0   dfail:0   fail:0   skip:19
fi-ilk-650       total:247  pass:195  dwarn:0   dfail:0   fail:0   skip:52
fi-ivb-3520m     total:247  pass:226  dwarn:0   dfail:0   fail:0   skip:21
fi-ivb-3770      total:247  pass:226  dwarn:0   dfail:0   fail:0   skip:21
fi-kbl-7500u     total:247  pass:226  dwarn:0   dfail:0   fail:0   skip:21
fi-skl-6260u     total:247  pass:234  dwarn:0   dfail:0   fail:0   skip:13
fi-skl-6700hq    total:247  pass:227  dwarn:0   dfail:0   fail:0   skip:20
fi-skl-6700k     total:247  pass:224  dwarn:3   dfail:0   fail:0   skip:20
fi-skl-6770hq    total:247  pass:234  dwarn:0   dfail:0   fail:0   skip:13
fi-snb-2520m     total:247  pass:216  dwarn:0   dfail:0   fail:0   skip:31
fi-snb-2600      total:247  pass:215  dwarn:0   dfail:0   fail:0   skip:32
Quoted 8 lines

2a932d085375c80a1bbb332799db3df9738e8eba drm-tip: 2016y-12m-18d-16h- 31m-05s UTC integration manifest 46a490f drm/i915: Check num_pipes before initializing or calling display hooks cdd47ca drm/i915: Check num_pipes before initializing audio component

== Logs ==

For more details see: https://intel-gfx-ci.01.org/CI/Patchwork_3325/

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

#6 lore raw
In reply to Wang Elaine

Hi Chris/Lahtine/Jani,

Could you help to review this patch?

Thanks,
Elaine
-----Original Message-----
From: Wang, Elaine
Sent: Monday, December 19, 2016 6:19 PM
To: [email protected]; Wang, Elaine <[email protected]>
Cc: Chris Wilson <[email protected]>; Joonas Lahtinen <[email protected]>; Jani Nikula <[email protected]>
Subject: [PATCH v2 1/2] drm/i915: Check num_pipes before initializing audio component

From: Elaine Wang <[email protected]>

when num_pipes is zero, it indicates there is no display and HDMI audio doesn't exist.

v2: Move the check from caller to callee for consistency.

Cc Chris Wilson <[email protected]>
Cc Joonas Lahtinen <[email protected]>
Cc Jani Nikula <[email protected]>
---
 drivers/gpu/drm/i915/intel_audio.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/gpu/drm/i915/intel_audio.c +3 -1
index 3bbc96c..16c2027 100644
@@ -928,6 +928,9 @@ void i915_audio_component_init(struct drm_i915_private *dev_priv)  {
 	int ret;
 
+	if (INTEL_INFO(dev_priv)->num_pipes == 0)
+		return;
+
 	ret = component_add(dev_priv->drm.dev, &i915_audio_component_bind_ops);
 	if (ret < 0) {
 		DRM_ERROR("failed to add audio component (%d)\n", ret);
--

1.9.1

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

maintainer
#7 lore raw
In reply to Wang Elaine
Quoted 11 lines · Wang Elaine

From: Elaine Wang <[email protected]>

when num_pipes is zero, it indicates there is no display and HDMI audio doesn't exist.

v2: Move the check from caller to callee for consistency.

Cc Chris Wilson <[email protected]>
Cc Joonas Lahtinen <[email protected]>
Cc Jani Nikula <[email protected]>

Pushed this one to drm-intel-next-queued, thanks for the patch.

BR,
Jani.

Quoted 18 lines
---
 drivers/gpu/drm/i915/intel_audio.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/gpu/drm/i915/intel_audio.c +3 -0
index 3bbc96c..16c2027 100644
@@ -928,6 +928,9 @@ void i915_audio_component_init(struct drm_i915_private *dev_priv)
 {
 	int ret;
 
+	if (INTEL_INFO(dev_priv)->num_pipes == 0)
+		return;
+
 	ret = component_add(dev_priv->drm.dev, &i915_audio_component_bind_ops);
 	if (ret < 0) {
 		DRM_ERROR("failed to add audio component (%d)\n", ret);
Signature · 5 lines
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx