* [Intel-gfx] [PATCH v5 2/2] drm/i915/gvt: Add GVT suspend/resume routine to i915
@ 2020-10-16 8:13 Colin Xu
2020-10-16 8:17 ` Colin Xu
0 siblings, 1 reply; 2+ messages in thread
From: Colin Xu @ 2020-10-16 8:13 UTC (permalink / raw)
To: intel-gvt-dev, intel-gfx, zhenyuw
This patch add gvt suspend/resume wrapper into i915: i915_drm_suspend()
and i915_drm_resume(). GVT relies on i915 so suspend gvt ahead of other
i915 sub-routine and resume gvt at last.
V2:
- Direct call into gvt suspend/resume wrapper in intel_gvt.h/intel_gvt.c.
The wrapper and implementation will check and call gvt routine. (zhenyu)
V3:
Refresh.
V4:
Rebase.
V5:
Fail intel_gvt_suspend() if fail to save GGTT.
Signed-off-by: Hang Yuan <hang.yuan@linux.intel.com>
Signed-off-by: Colin Xu <colin.xu@intel.com>
---
drivers/gpu/drm/i915/i915_drv.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
index 8bb7e2dcfaaa..b3203292b0ee 100644
--- a/drivers/gpu/drm/i915/i915_drv.c
+++ b/drivers/gpu/drm/i915/i915_drv.c
@@ -1104,6 +1104,9 @@ static int i915_drm_suspend(struct drm_device *dev)
drm_kms_helper_poll_disable(dev);
+ if (intel_gvt_suspend(dev_priv))
+ drm_err(&dev_priv->drm, "failed to suspend GVT\n");
+
pci_save_state(pdev);
intel_display_suspend(dev);
@@ -1281,6 +1284,8 @@ static int i915_drm_resume(struct drm_device *dev)
intel_power_domains_enable(dev_priv);
+ intel_gvt_resume(dev_priv);
+
enable_rpm_wakeref_asserts(&dev_priv->runtime_pm);
return 0;
--
2.28.0
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [Intel-gfx] [PATCH v5 2/2] drm/i915/gvt: Add GVT suspend/resume routine to i915
2020-10-16 8:13 [Intel-gfx] [PATCH v5 2/2] drm/i915/gvt: Add GVT suspend/resume routine to i915 Colin Xu
@ 2020-10-16 8:17 ` Colin Xu
0 siblings, 0 replies; 2+ messages in thread
From: Colin Xu @ 2020-10-16 8:17 UTC (permalink / raw)
To: intel-gvt-dev, intel-gfx, zhenyuw
On 2020-10-16 16:13, Colin Xu wrote:
> This patch add gvt suspend/resume wrapper into i915: i915_drm_suspend()
> and i915_drm_resume(). GVT relies on i915 so suspend gvt ahead of other
> i915 sub-routine and resume gvt at last.
>
> V2:
> - Direct call into gvt suspend/resume wrapper in intel_gvt.h/intel_gvt.c.
> The wrapper and implementation will check and call gvt routine. (zhenyu)
>
> V3:
> Refresh.
>
> V4:
> Rebase.
>
> V5:
> Fail intel_gvt_suspend() if fail to save GGTT.
>
> Signed-off-by: Hang Yuan <hang.yuan@linux.intel.com>
> Signed-off-by: Colin Xu <colin.xu@intel.com>
> ---
> drivers/gpu/drm/i915/i915_drv.c | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
> index 8bb7e2dcfaaa..b3203292b0ee 100644
> --- a/drivers/gpu/drm/i915/i915_drv.c
> +++ b/drivers/gpu/drm/i915/i915_drv.c
> @@ -1104,6 +1104,9 @@ static int i915_drm_suspend(struct drm_device *dev)
>
> drm_kms_helper_poll_disable(dev);
>
> + if (intel_gvt_suspend(dev_priv))
> + drm_err(&dev_priv->drm, "failed to suspend GVT\n");
I'm not quite sure if it's OK to fail i915_drm_suspend() here if
intel_gvt_suspend() fails. I saw intel_display_suspend() may also return
failure but i915_drm_suspend() doesn't handle such case so I just follow
the style for intel_gvt_suspend().
> +
> pci_save_state(pdev);
>
> intel_display_suspend(dev);
> @@ -1281,6 +1284,8 @@ static int i915_drm_resume(struct drm_device *dev)
>
> intel_power_domains_enable(dev_priv);
>
> + intel_gvt_resume(dev_priv);
> +
> enable_rpm_wakeref_asserts(&dev_priv->runtime_pm);
>
> return 0;
--
Best Regards,
Colin Xu
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-10-16 8:17 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-10-16 8:13 [Intel-gfx] [PATCH v5 2/2] drm/i915/gvt: Add GVT suspend/resume routine to i915 Colin Xu
2020-10-16 8:17 ` Colin Xu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox