* [PATCH v2 1/2] drm/i915: Check num_pipes before initializing audio component
@ 2016-12-19 10:19 Wang Elaine
2016-12-19 10:19 ` [PATCH v2 2/2] drm/i915: Check num_pipes before initializing or calling display hooks Wang Elaine
` (3 more replies)
0 siblings, 4 replies; 8+ messages in thread
From: Wang Elaine @ 2016-12-19 10:19 UTC (permalink / raw)
To: intel-gfx, elaine.wang
From: Elaine Wang <elaine.wang@intel.com>
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 <chris@chris-wilson.co.uk>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Cc: Jani Nikula <jani.nikula@linux.intel.com>
Signed-off-by: Elaine Wang <elaine.wang@intel.com>
---
drivers/gpu/drm/i915/intel_audio.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/gpu/drm/i915/intel_audio.c b/drivers/gpu/drm/i915/intel_audio.c
index 3bbc96c..16c2027 100644
--- a/drivers/gpu/drm/i915/intel_audio.c
+++ b/drivers/gpu/drm/i915/intel_audio.c
@@ -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
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH v2 2/2] drm/i915: Check num_pipes before initializing or calling display hooks
2016-12-19 10:19 [PATCH v2 1/2] drm/i915: Check num_pipes before initializing audio component Wang Elaine
@ 2016-12-19 10:19 ` Wang Elaine
2016-12-22 10:48 ` Jani Nikula
2016-12-19 11:45 ` ✗ Fi.CI.BAT: warning for series starting with [v2,1/2] drm/i915: Check num_pipes before initializing audio component Patchwork
` (2 subsequent siblings)
3 siblings, 1 reply; 8+ messages in thread
From: Wang Elaine @ 2016-12-19 10:19 UTC (permalink / raw)
To: intel-gfx, elaine.wang
From: Elaine Wang <elaine.wang@intel.com>
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 <chris@chris-wilson.co.uk>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Cc: Jani Nikula <jani.nikula@linux.intel.com>
Signed-off-by: Elaine Wang <elaine.wang@intel.com>
---
drivers/gpu/drm/i915/intel_display.c | 6 ++++++
drivers/gpu/drm/i915/intel_pm.c | 10 +++++++++-
2 files changed, 15 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 9cc5dbf..e079ea7 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -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;
diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
index d0834b3..6438ada 100644
--- a/drivers/gpu/drm/i915/intel_pm.c
+++ b/drivers/gpu/drm/i915/intel_pm.c
@@ -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 */
--
1.9.1
_______________________________________________
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
* ✗ Fi.CI.BAT: warning for series starting with [v2,1/2] drm/i915: Check num_pipes before initializing audio component
2016-12-19 10:19 [PATCH v2 1/2] drm/i915: Check num_pipes before initializing audio component Wang Elaine
2016-12-19 10:19 ` [PATCH v2 2/2] drm/i915: Check num_pipes before initializing or calling display hooks Wang Elaine
@ 2016-12-19 11:45 ` Patchwork
2016-12-20 3:04 ` Wang, Elaine
2016-12-22 7:03 ` [PATCH v2 1/2] " Wang, Elaine
2016-12-22 10:48 ` Jani Nikula
3 siblings, 1 reply; 8+ messages in thread
From: Patchwork @ 2016-12-19 11:45 UTC (permalink / raw)
To: Wang Elaine; +Cc: intel-gfx
== 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
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: ✗ Fi.CI.BAT: warning for series starting with [v2,1/2] drm/i915: Check num_pipes before initializing audio component
2016-12-19 11:45 ` ✗ Fi.CI.BAT: warning for series starting with [v2,1/2] drm/i915: Check num_pipes before initializing audio component Patchwork
@ 2016-12-20 3:04 ` Wang, Elaine
0 siblings, 0 replies; 8+ messages in thread
From: Wang, Elaine @ 2016-12-20 3:04 UTC (permalink / raw)
To: intel-gfx
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
> -----Original Message-----
> From: Patchwork [mailto:patchwork@emeril.freedesktop.org]
> Sent: Monday, December 19, 2016 7:46 PM
> To: Wang, Elaine <elaine.wang@intel.com>
> Cc: intel-gfx@lists.freedesktop.org
> 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
>
> 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
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v2 1/2] drm/i915: Check num_pipes before initializing audio component
2016-12-19 10:19 [PATCH v2 1/2] drm/i915: Check num_pipes before initializing audio component Wang Elaine
2016-12-19 10:19 ` [PATCH v2 2/2] drm/i915: Check num_pipes before initializing or calling display hooks Wang Elaine
2016-12-19 11:45 ` ✗ Fi.CI.BAT: warning for series starting with [v2,1/2] drm/i915: Check num_pipes before initializing audio component Patchwork
@ 2016-12-22 7:03 ` Wang, Elaine
2016-12-22 10:48 ` Jani Nikula
3 siblings, 0 replies; 8+ messages in thread
From: Wang, Elaine @ 2016-12-22 7:03 UTC (permalink / raw)
To: Chris Wilson, Joonas Lahtinen, Jani Nikula; +Cc: intel-gfx
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: intel-gfx@lists.freedesktop.org; Wang, Elaine <elaine.wang@intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>; Joonas Lahtinen <joonas.lahtinen@linux.intel.com>; Jani Nikula <jani.nikula@linux.intel.com>
Subject: [PATCH v2 1/2] drm/i915: Check num_pipes before initializing audio component
From: Elaine Wang <elaine.wang@intel.com>
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 <chris@chris-wilson.co.uk>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Cc: Jani Nikula <jani.nikula@linux.intel.com>
Signed-off-by: Elaine Wang <elaine.wang@intel.com>
---
drivers/gpu/drm/i915/intel_audio.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/gpu/drm/i915/intel_audio.c b/drivers/gpu/drm/i915/intel_audio.c
index 3bbc96c..16c2027 100644
--- a/drivers/gpu/drm/i915/intel_audio.c
+++ b/drivers/gpu/drm/i915/intel_audio.c
@@ -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
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 v2 2/2] drm/i915: Check num_pipes before initializing or calling display hooks
2016-12-19 10:19 ` [PATCH v2 2/2] drm/i915: Check num_pipes before initializing or calling display hooks Wang Elaine
@ 2016-12-22 10:48 ` Jani Nikula
2016-12-23 3:33 ` Wang, Elaine
0 siblings, 1 reply; 8+ messages in thread
From: Jani Nikula @ 2016-12-22 10:48 UTC (permalink / raw)
To: Wang Elaine, intel-gfx
On Mon, 19 Dec 2016, Wang Elaine <elaine.wang@intel.com> wrote:
> From: Elaine Wang <elaine.wang@intel.com>
>
> 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 <chris@chris-wilson.co.uk>
> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
> Cc: Jani Nikula <jani.nikula@linux.intel.com>
> Signed-off-by: Elaine Wang <elaine.wang@intel.com>
> ---
> drivers/gpu/drm/i915/intel_display.c | 6 ++++++
> drivers/gpu/drm/i915/intel_pm.c | 10 +++++++++-
> 2 files changed, 15 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index 9cc5dbf..e079ea7 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -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;
> diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
> index d0834b3..6438ada 100644
> --- a/drivers/gpu/drm/i915/intel_pm.c
> +++ b/drivers/gpu/drm/i915/intel_pm.c
> @@ -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;
> +
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.
> 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 */
--
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 v2 1/2] drm/i915: Check num_pipes before initializing audio component
2016-12-19 10:19 [PATCH v2 1/2] drm/i915: Check num_pipes before initializing audio component Wang Elaine
` (2 preceding siblings ...)
2016-12-22 7:03 ` [PATCH v2 1/2] " Wang, Elaine
@ 2016-12-22 10:48 ` Jani Nikula
3 siblings, 0 replies; 8+ messages in thread
From: Jani Nikula @ 2016-12-22 10:48 UTC (permalink / raw)
To: Wang Elaine, intel-gfx
On Mon, 19 Dec 2016, Wang Elaine <elaine.wang@intel.com> wrote:
> From: Elaine Wang <elaine.wang@intel.com>
>
> 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 <chris@chris-wilson.co.uk>
> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
> Cc: Jani Nikula <jani.nikula@linux.intel.com>
> Signed-off-by: Elaine Wang <elaine.wang@intel.com>
Pushed this one to drm-intel-next-queued, thanks for the patch.
BR,
Jani.
> ---
> drivers/gpu/drm/i915/intel_audio.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/drivers/gpu/drm/i915/intel_audio.c b/drivers/gpu/drm/i915/intel_audio.c
> index 3bbc96c..16c2027 100644
> --- a/drivers/gpu/drm/i915/intel_audio.c
> +++ b/drivers/gpu/drm/i915/intel_audio.c
> @@ -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);
--
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 v2 2/2] drm/i915: Check num_pipes before initializing or calling display hooks
2016-12-22 10:48 ` Jani Nikula
@ 2016-12-23 3:33 ` Wang, Elaine
0 siblings, 0 replies; 8+ messages in thread
From: Wang, Elaine @ 2016-12-23 3:33 UTC (permalink / raw)
To: Jani Nikula, intel-gfx
> -----Original Message-----
> From: Jani Nikula [mailto:jani.nikula@linux.intel.com]
> Sent: Thursday, December 22, 2016 6:48 PM
> To: Wang, Elaine <elaine.wang@intel.com>; intel-gfx@lists.freedesktop.org;
> Wang, Elaine <elaine.wang@intel.com>
> Cc: Chris Wilson <chris@chris-wilson.co.uk>; Joonas Lahtinen
> <joonas.lahtinen@linux.intel.com>
> Subject: Re: [PATCH v2 2/2] drm/i915: Check num_pipes before initializing or
> calling display hooks
>
> On Mon, 19 Dec 2016, Wang Elaine <elaine.wang@intel.com> wrote:
> > From: Elaine Wang <elaine.wang@intel.com>
> >
> > 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 <chris@chris-wilson.co.uk>
> > Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
> > Cc: Jani Nikula <jani.nikula@linux.intel.com>
> > Signed-off-by: Elaine Wang <elaine.wang@intel.com>
> > ---
> > drivers/gpu/drm/i915/intel_display.c | 6 ++++++
> > drivers/gpu/drm/i915/intel_pm.c | 10 +++++++++-
> > 2 files changed, 15 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/gpu/drm/i915/intel_display.c
> > b/drivers/gpu/drm/i915/intel_display.c
> > index 9cc5dbf..e079ea7 100644
> > --- a/drivers/gpu/drm/i915/intel_display.c
> > +++ b/drivers/gpu/drm/i915/intel_display.c
> > @@ -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; diff --git
> > a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
> > index d0834b3..6438ada 100644
> > --- a/drivers/gpu/drm/i915/intel_pm.c
> > +++ b/drivers/gpu/drm/i915/intel_pm.c
> > @@ -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;
> > +
>
> 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.
>
I see. Thanks for the comment. I'll update this patch later.
Thanks,
Elaine
>
>
> > 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 */
>
> --
> 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:[~2016-12-23 3:33 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-12-19 10:19 [PATCH v2 1/2] drm/i915: Check num_pipes before initializing audio component Wang Elaine
2016-12-19 10:19 ` [PATCH v2 2/2] drm/i915: Check num_pipes before initializing or calling display hooks Wang Elaine
2016-12-22 10:48 ` Jani Nikula
2016-12-23 3:33 ` Wang, Elaine
2016-12-19 11:45 ` ✗ Fi.CI.BAT: warning for series starting with [v2,1/2] drm/i915: Check num_pipes before initializing audio component Patchwork
2016-12-20 3:04 ` Wang, Elaine
2016-12-22 7:03 ` [PATCH v2 1/2] " Wang, Elaine
2016-12-22 10:48 ` Jani Nikula
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.