All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/i915: Configure GPU PM in ->suspend() if not configured
@ 2018-03-19 10:15 Rushikesh S Kadam
  2018-03-19 10:33 ` Chris Wilson
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Rushikesh S Kadam @ 2018-03-19 10:15 UTC (permalink / raw)
  To: rodrigo.vivi, joonas.lahtinen, jani.nikula
  Cc: jianxun.zhang, rushikesh.s.kadam, intel-gfx

The patch implements workaround for a scenario, where the GPU Power
Management, if not configured prior to platform suspend entry, will block
SoC S0ix entry in suspend-to-idle.

Typically the GPU Power Management configuration is restored after a
platform suspend cycle, in the drm ioclts callbacks (such as ioclt
I915_GEM_EXECBUFFER2_WR).

There exists a corner case - if the next platform suspend cycle is
initiated quickly, before the ioctl callbacks are triggered, the GPU
Power Management is not setup at the time of suspend entry.

In such as scenario, the GPU does not enter low power state (RC6), which in
turn prevents the SoC from entering low power package state (PC2 or
deeper). This blocks SoC S0ix entry in suspend-to-idle.

The patch detects such a condition and works around by configuring GPU
Power Management in i915 driver's ->suspend().

Signed-off-by: Rushikesh S Kadam <rushikesh.s.kadam@intel.com>
---
 drivers/gpu/drm/i915/i915_drv.c | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)

diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
index f03555e..9f3cc4c 100644
--- a/drivers/gpu/drm/i915/i915_drv.c
+++ b/drivers/gpu/drm/i915/i915_drv.c
@@ -2076,6 +2076,7 @@ static int i915_pm_suspend(struct device *kdev)
 {
 	struct pci_dev *pdev = to_pci_dev(kdev);
 	struct drm_device *dev = pci_get_drvdata(pdev);
+	struct drm_i915_private *dev_priv = to_i915(dev);
 
 	if (!dev) {
 		dev_err(kdev, "DRM not initialized, aborting suspend.\n");
@@ -2085,6 +2086,31 @@ static int i915_pm_suspend(struct device *kdev)
 	if (dev->switch_power_state == DRM_SWITCH_POWER_OFF)
 		return 0;
 
+	/*
+	 * Implement workaround for a scenario, where the GPU Power
+	 * Management, if not configured prior to platform suspend
+	 * entry, will block SoC S0ix entry in suspend-to-idle.
+	 *
+	 * Typically the GPU Power Management configuration is
+	 * restored in drm runtime / ioclts callbacks (such as
+	 * I915_GEM_EXECBUFFER2_WR) after the platform has resumed
+	 * from a suspend cycle.
+	 *
+	 * There exists a corner case - if the next platform suspend
+	 * cycle is initiated quickly, before the runtime callbacks
+	 * are triggered, the GPU Power Management is not configured
+	 * at time of suspend entry. This blocks SoC S0ix entry in
+	 * suspend-to-idle
+	 *
+	 * Detect such a condition, and workaround by configuring the
+	 * GPU Power Management here.
+	 */
+	if (INTEL_GEN(dev_priv) >= 9 &&
+	    (!(I915_READ(GEN6_RC_CONTROL) & GEN6_RC_CTL_HW_ENABLE))) {
+		DRM_INFO("Detected GPU PM is not configured! Configure now.\n");
+		intel_enable_gt_powersave(dev_priv);
+	}
+
 	return i915_drm_suspend(dev);
 }
 
-- 
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] 4+ messages in thread

* Re: [PATCH] drm/i915: Configure GPU PM in ->suspend() if not configured
  2018-03-19 10:15 [PATCH] drm/i915: Configure GPU PM in ->suspend() if not configured Rushikesh S Kadam
@ 2018-03-19 10:33 ` Chris Wilson
  2018-03-19 10:41 ` ✓ Fi.CI.BAT: success for " Patchwork
  2018-03-19 11:47 ` ✗ Fi.CI.IGT: warning " Patchwork
  2 siblings, 0 replies; 4+ messages in thread
From: Chris Wilson @ 2018-03-19 10:33 UTC (permalink / raw)
  To: rodrigo.vivi, joonas.lahtinen, jani.nikula
  Cc: jianxun.zhang, intel-gfx, rushikesh.s.kadam

Quoting Rushikesh S Kadam (2018-03-19 10:15:44)
> The patch implements workaround for a scenario, where the GPU Power
> Management, if not configured prior to platform suspend entry, will block
> SoC S0ix entry in suspend-to-idle.
> 
> Typically the GPU Power Management configuration is restored after a
> platform suspend cycle, in the drm ioclts callbacks (such as ioclt
> I915_GEM_EXECBUFFER2_WR).

As I indicated on the bug report, this is not how the kernel works
currently. On load/resume, enabling powermanagement is forced.

Please do test upstream.
-Chris
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* ✓ Fi.CI.BAT: success for drm/i915: Configure GPU PM in ->suspend() if not configured
  2018-03-19 10:15 [PATCH] drm/i915: Configure GPU PM in ->suspend() if not configured Rushikesh S Kadam
  2018-03-19 10:33 ` Chris Wilson
@ 2018-03-19 10:41 ` Patchwork
  2018-03-19 11:47 ` ✗ Fi.CI.IGT: warning " Patchwork
  2 siblings, 0 replies; 4+ messages in thread
From: Patchwork @ 2018-03-19 10:41 UTC (permalink / raw)
  To: Rushikesh S Kadam; +Cc: intel-gfx

== Series Details ==

Series: drm/i915: Configure GPU PM in ->suspend() if not configured
URL   : https://patchwork.freedesktop.org/series/40173/
State : success

== Summary ==

Series 40173v1 drm/i915: Configure GPU PM in ->suspend() if not configured
https://patchwork.freedesktop.org/api/1.0/series/40173/revisions/1/mbox/

---- Known issues:

Test kms_flip:
        Subgroup basic-flip-vs-wf_vblank:
                fail       -> PASS       (fi-cfl-s2) fdo#100368
Test kms_pipe_crc_basic:
        Subgroup read-crc-pipe-a-frame-sequence:
                fail       -> PASS       (fi-cfl-s2) fdo#103481
        Subgroup suspend-read-crc-pipe-a:
                pass       -> FAIL       (fi-ivb-3520m) k.org#198519 +2
        Subgroup suspend-read-crc-pipe-b:
                pass       -> INCOMPLETE (fi-snb-2520m) fdo#103713

fdo#100368 https://bugs.freedesktop.org/show_bug.cgi?id=100368
fdo#103481 https://bugs.freedesktop.org/show_bug.cgi?id=103481
k.org#198519 https://bugzilla.kernel.org/show_bug.cgi?id=198519
fdo#103713 https://bugs.freedesktop.org/show_bug.cgi?id=103713

fi-bdw-5557u     total:285  pass:264  dwarn:0   dfail:0   fail:0   skip:21  time:436s
fi-bdw-gvtdvm    total:285  pass:261  dwarn:0   dfail:0   fail:0   skip:24  time:448s
fi-blb-e6850     total:285  pass:220  dwarn:1   dfail:0   fail:0   skip:64  time:381s
fi-bsw-n3050     total:285  pass:239  dwarn:0   dfail:0   fail:0   skip:46  time:543s
fi-bwr-2160      total:285  pass:180  dwarn:0   dfail:0   fail:0   skip:105 time:295s
fi-bxt-dsi       total:285  pass:255  dwarn:0   dfail:0   fail:0   skip:30  time:513s
fi-bxt-j4205     total:285  pass:256  dwarn:0   dfail:0   fail:0   skip:29  time:510s
fi-byt-j1900     total:285  pass:250  dwarn:0   dfail:0   fail:0   skip:35  time:517s
fi-byt-n2820     total:285  pass:246  dwarn:0   dfail:0   fail:0   skip:39  time:503s
fi-cfl-8700k     total:285  pass:257  dwarn:0   dfail:0   fail:0   skip:28  time:410s
fi-cfl-s2        total:285  pass:259  dwarn:0   dfail:0   fail:0   skip:26  time:580s
fi-cfl-u         total:285  pass:259  dwarn:0   dfail:0   fail:0   skip:26  time:510s
fi-cnl-drrs      total:285  pass:254  dwarn:3   dfail:0   fail:0   skip:28  time:529s
fi-elk-e7500     total:285  pass:225  dwarn:1   dfail:0   fail:0   skip:59  time:418s
fi-gdg-551       total:285  pass:176  dwarn:0   dfail:0   fail:1   skip:108 time:316s
fi-hsw-4770      total:285  pass:258  dwarn:0   dfail:0   fail:0   skip:27  time:403s
fi-ilk-650       total:285  pass:225  dwarn:0   dfail:0   fail:0   skip:60  time:422s
fi-ivb-3520m     total:285  pass:253  dwarn:0   dfail:0   fail:3   skip:29  time:413s
fi-ivb-3770      total:285  pass:252  dwarn:0   dfail:0   fail:0   skip:33  time:435s
fi-kbl-7500u     total:285  pass:260  dwarn:1   dfail:0   fail:0   skip:24  time:474s
fi-kbl-7567u     total:285  pass:265  dwarn:0   dfail:0   fail:0   skip:20  time:464s
fi-kbl-r         total:285  pass:258  dwarn:0   dfail:0   fail:0   skip:27  time:513s
fi-pnv-d510      total:285  pass:219  dwarn:1   dfail:0   fail:0   skip:65  time:655s
fi-skl-6260u     total:285  pass:265  dwarn:0   dfail:0   fail:0   skip:20  time:438s
fi-skl-6600u     total:285  pass:258  dwarn:0   dfail:0   fail:0   skip:27  time:537s
fi-skl-6700hq    total:285  pass:259  dwarn:0   dfail:0   fail:0   skip:26  time:544s
fi-skl-6700k2    total:285  pass:261  dwarn:0   dfail:0   fail:0   skip:24  time:499s
fi-skl-6770hq    total:285  pass:265  dwarn:0   dfail:0   fail:0   skip:20  time:488s
fi-skl-guc       total:285  pass:257  dwarn:0   dfail:0   fail:0   skip:28  time:427s
fi-skl-gvtdvm    total:285  pass:262  dwarn:0   dfail:0   fail:0   skip:23  time:448s
fi-snb-2520m     total:242  pass:208  dwarn:0   dfail:0   fail:0   skip:33 
fi-snb-2600      total:285  pass:245  dwarn:0   dfail:0   fail:0   skip:40  time:398s

b3a4e70c4ef29d338f6da4bea7627e9145ef3382 drm-tip: 2018y-03m-19d-08h-13m-36s UTC integration manifest
aa737633e010 drm/i915: Configure GPU PM in ->suspend() if not configured

== Logs ==

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

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

* ✗ Fi.CI.IGT: warning for drm/i915: Configure GPU PM in ->suspend() if not configured
  2018-03-19 10:15 [PATCH] drm/i915: Configure GPU PM in ->suspend() if not configured Rushikesh S Kadam
  2018-03-19 10:33 ` Chris Wilson
  2018-03-19 10:41 ` ✓ Fi.CI.BAT: success for " Patchwork
@ 2018-03-19 11:47 ` Patchwork
  2 siblings, 0 replies; 4+ messages in thread
From: Patchwork @ 2018-03-19 11:47 UTC (permalink / raw)
  To: Rushikesh S Kadam; +Cc: intel-gfx

== Series Details ==

Series: drm/i915: Configure GPU PM in ->suspend() if not configured
URL   : https://patchwork.freedesktop.org/series/40173/
State : warning

== Summary ==

---- Possible new issues:

Test kms_vblank:
        Subgroup pipe-b-ts-continuation-dpms-suspend:
                pass       -> DMESG-WARN (shard-apl)
Test pm_rc6_residency:
        Subgroup rc6-accuracy:
                pass       -> SKIP       (shard-snb)

---- Known issues:

Test drv_hangman:
        Subgroup error-state-capture-blt:
                pass       -> INCOMPLETE (shard-snb) fdo#104058
Test kms_flip:
        Subgroup 2x-plain-flip-fb-recreate-interruptible:
                fail       -> PASS       (shard-hsw) fdo#100368
Test kms_frontbuffer_tracking:
        Subgroup fbc-suspend:
                pass       -> DMESG-WARN (shard-apl) fdo#101623
Test kms_rotation_crc:
        Subgroup primary-rotation-180:
                fail       -> PASS       (shard-hsw) fdo#103925
Test kms_sysfs_edid_timing:
                pass       -> WARN       (shard-apl) fdo#100047
Test kms_vblank:
        Subgroup pipe-c-ts-continuation-dpms-suspend:
                pass       -> DMESG-WARN (shard-apl) k.org#196691

fdo#104058 https://bugs.freedesktop.org/show_bug.cgi?id=104058
fdo#100368 https://bugs.freedesktop.org/show_bug.cgi?id=100368
fdo#101623 https://bugs.freedesktop.org/show_bug.cgi?id=101623
fdo#103925 https://bugs.freedesktop.org/show_bug.cgi?id=103925
fdo#100047 https://bugs.freedesktop.org/show_bug.cgi?id=100047
k.org#196691 https://bugzilla.kernel.org/show_bug.cgi?id=196691

shard-apl        total:3442 pass:1811 dwarn:4   dfail:0   fail:7   skip:1619 time:12967s
shard-hsw        total:3442 pass:1768 dwarn:1   dfail:0   fail:1   skip:1671 time:11892s
shard-snb        total:3378 pass:1333 dwarn:1   dfail:0   fail:2   skip:2041 time:7011s
Blacklisted hosts:
shard-kbl        total:3442 pass:1933 dwarn:6   dfail:0   fail:10  skip:1493 time:9852s

== Logs ==

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

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

end of thread, other threads:[~2018-03-19 11:47 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-19 10:15 [PATCH] drm/i915: Configure GPU PM in ->suspend() if not configured Rushikesh S Kadam
2018-03-19 10:33 ` Chris Wilson
2018-03-19 10:41 ` ✓ Fi.CI.BAT: success for " Patchwork
2018-03-19 11:47 ` ✗ Fi.CI.IGT: warning " Patchwork

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.