All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/i915: Check num_pipes before initializing or calling display hooks
@ 2016-12-23  9:02 Wang Elaine
  2016-12-23  9:53 ` ✓ Fi.CI.BAT: success for " Patchwork
  2016-12-28  7:24 ` [PATCH] " Wang, Elaine
  0 siblings, 2 replies; 3+ messages in thread
From: Wang Elaine @ 2016-12-23  9:02 UTC (permalink / raw)
  To: intel-gfx; +Cc: 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.

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.
v3: Addressed Jani's Review comments(minimize the amount of the checks)
- Assign nop_init_clock_gating() to the clock gating hook when
num_pipes is zero.

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      | 8 +++++++-
 2 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index d8effd4..eb180df 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -16161,6 +16161,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 =
@@ -16543,6 +16546,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 338b542..bf63ba5 100644
--- a/drivers/gpu/drm/i915/intel_pm.c
+++ b/drivers/gpu/drm/i915/intel_pm.c
@@ -7642,7 +7642,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 (IS_SKYLAKE(dev_priv))
+
+	if (INTEL_INFO(dev_priv)->num_pipes == 0)
+		dev_priv->display.init_clock_gating = nop_init_clock_gating;
+	else if (IS_SKYLAKE(dev_priv))
 		dev_priv->display.init_clock_gating = skylake_init_clock_gating;
 	else if (IS_KABYLAKE(dev_priv))
 		dev_priv->display.init_clock_gating = kabylake_init_clock_gating;
@@ -7683,6 +7686,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] 3+ messages in thread

* ✓ Fi.CI.BAT: success for drm/i915: Check num_pipes before initializing or calling display hooks
  2016-12-23  9:02 [PATCH] drm/i915: Check num_pipes before initializing or calling display hooks Wang Elaine
@ 2016-12-23  9:53 ` Patchwork
  2016-12-28  7:24 ` [PATCH] " Wang, Elaine
  1 sibling, 0 replies; 3+ messages in thread
From: Patchwork @ 2016-12-23  9:53 UTC (permalink / raw)
  To: Wang Elaine; +Cc: intel-gfx

== Series Details ==

Series: drm/i915: Check num_pipes before initializing or calling display hooks
URL   : https://patchwork.freedesktop.org/series/17173/
State : success

== Summary ==

Series 17173v1 drm/i915: Check num_pipes before initializing or calling display hooks
https://patchwork.freedesktop.org/api/1.0/series/17173/revisions/1/mbox/


fi-bdw-5557u     total:246  pass:232  dwarn:0   dfail:0   fail:0   skip:14 
fi-bsw-n3050     total:246  pass:207  dwarn:0   dfail:0   fail:0   skip:39 
fi-bxt-j4205     total:246  pass:224  dwarn:0   dfail:0   fail:0   skip:22 
fi-bxt-t5700     total:82   pass:69   dwarn:0   dfail:0   fail:0   skip:12 
fi-byt-j1900     total:246  pass:219  dwarn:0   dfail:0   fail:0   skip:27 
fi-byt-n2820     total:246  pass:215  dwarn:0   dfail:0   fail:0   skip:31 
fi-hsw-4770      total:246  pass:227  dwarn:0   dfail:0   fail:0   skip:19 
fi-hsw-4770r     total:246  pass:227  dwarn:0   dfail:0   fail:0   skip:19 
fi-ivb-3520m     total:246  pass:225  dwarn:0   dfail:0   fail:0   skip:21 
fi-ivb-3770      total:246  pass:225  dwarn:0   dfail:0   fail:0   skip:21 
fi-kbl-7500u     total:246  pass:225  dwarn:0   dfail:0   fail:0   skip:21 
fi-skl-6260u     total:246  pass:233  dwarn:0   dfail:0   fail:0   skip:13 
fi-skl-6700hq    total:246  pass:226  dwarn:0   dfail:0   fail:0   skip:20 
fi-skl-6700k     total:246  pass:222  dwarn:3   dfail:0   fail:0   skip:21 
fi-skl-6770hq    total:246  pass:233  dwarn:0   dfail:0   fail:0   skip:13 
fi-snb-2520m     total:246  pass:215  dwarn:0   dfail:0   fail:0   skip:31 
fi-snb-2600      total:246  pass:214  dwarn:0   dfail:0   fail:0   skip:32 

7165fdc7f0b0b536557fcd0a222d083a901be57c drm-tip: 2016y-12m-22d-19h-42m-25s UTC integration manifest
b906d67 drm/i915: Check num_pipes before initializing or calling display hooks

== Logs ==

For more details see: https://intel-gfx-ci.01.org/CI/Patchwork_3384/
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [PATCH] drm/i915: Check num_pipes before initializing or calling display hooks
  2016-12-23  9:02 [PATCH] drm/i915: Check num_pipes before initializing or calling display hooks Wang Elaine
  2016-12-23  9:53 ` ✓ Fi.CI.BAT: success for " Patchwork
@ 2016-12-28  7:24 ` Wang, Elaine
  1 sibling, 0 replies; 3+ messages in thread
From: Wang, Elaine @ 2016-12-28  7:24 UTC (permalink / raw)
  To: intel-gfx, Jani Nikula

Hi Nikula,

Could you help to review this patch? 

Thanks,
Elaine
-----Original Message-----
From: Wang, Elaine 
Sent: Friday, December 23, 2016 5:02 PM
To: intel-gfx@lists.freedesktop.org
Cc: Wang, Elaine <elaine.wang@intel.com>; Chris Wilson <chris@chris-wilson.co.uk>; Joonas Lahtinen <joonas.lahtinen@linux.intel.com>; Jani Nikula <jani.nikula@linux.intel.com>
Subject: [PATCH] drm/i915: Check num_pipes before initializing or calling display hooks

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.

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.
v3: Addressed Jani's Review comments(minimize the amount of the checks)
- Assign nop_init_clock_gating() to the clock gating hook when num_pipes is zero.

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      | 8 +++++++-
 2 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index d8effd4..eb180df 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -16161,6 +16161,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 = @@ -16543,6 +16546,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 338b542..bf63ba5 100644
--- a/drivers/gpu/drm/i915/intel_pm.c
+++ b/drivers/gpu/drm/i915/intel_pm.c
@@ -7642,7 +7642,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 (IS_SKYLAKE(dev_priv))
+
+	if (INTEL_INFO(dev_priv)->num_pipes == 0)
+		dev_priv->display.init_clock_gating = nop_init_clock_gating;
+	else if (IS_SKYLAKE(dev_priv))
 		dev_priv->display.init_clock_gating = skylake_init_clock_gating;
 	else if (IS_KABYLAKE(dev_priv))
 		dev_priv->display.init_clock_gating = kabylake_init_clock_gating; @@ -7683,6 +7686,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] 3+ messages in thread

end of thread, other threads:[~2016-12-28  7:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-12-23  9:02 [PATCH] drm/i915: Check num_pipes before initializing or calling display hooks Wang Elaine
2016-12-23  9:53 ` ✓ Fi.CI.BAT: success for " Patchwork
2016-12-28  7:24 ` [PATCH] " Wang, Elaine

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.