[PATCH 2/2] drm/i915/gvt: Add GVT suspend/resume routine to i915.

Colin Xu Colin.Xu at intel.com
Thu May 21 00:37:57 UTC 2020


On 2020-05-18 18:45, Zhenyu Wang wrote:
> On 2020.05.18 14:28:52 +0800, Colin Xu wrote:
>> Add GVT suspend/resume routine to i915.
>> GVT relies on i915 so suspend ahead of other i915 routine, and resume
>> at last vice versa.
>>
>> Signed-off-by: Hang Yuan <hang.yuan at linux.intel.com>
>> Signed-off-by: Colin Xu <colin.xu at intel.com>
>> ---
>>   drivers/gpu/drm/i915/i915_drv.c | 15 +++++++++++++++
>>   1 file changed, 15 insertions(+)
>>
>> diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
>> index 34ee12f3f02d..c5d7d58df67e 100644
>> --- a/drivers/gpu/drm/i915/i915_drv.c
>> +++ b/drivers/gpu/drm/i915/i915_drv.c
>> @@ -87,6 +87,10 @@
>>   #include "intel_pm.h"
>>   #include "vlv_suspend.h"
>>   
>> +#if IS_ENABLED(CONFIG_DRM_I915_GVT)
>> +#include "gvt.h"
>> +#endif
>> +
>>   static struct drm_driver driver;
>>   
>>   static int i915_get_bridge_dev(struct drm_i915_private *dev_priv)
>> @@ -1177,6 +1181,11 @@ static int i915_drm_suspend(struct drm_device *dev)
>>   
>>   	drm_kms_helper_poll_disable(dev);
>>   
>> +#if IS_ENABLED(CONFIG_DRM_I915_GVT)
>> +	if (dev_priv->gvt)
>> +		intel_gvt_pm_suspend(dev_priv->gvt);
>> +#endif
>> +
>>   	pci_save_state(pdev);
>>   
>>   	intel_display_suspend(dev);
>> @@ -1354,6 +1363,12 @@ static int i915_drm_resume(struct drm_device *dev)
>>   
>>   	intel_power_domains_enable(dev_priv);
>>   
>> +#if IS_ENABLED(CONFIG_DRM_I915_GVT)
>> +	if (dev_priv->gvt) {
> intel_gvt_active()
Almost forgot we have this function can use. Thanks.
>> +		return intel_gvt_pm_resume(dev_priv->gvt);
>> +	}
>> +#endif
>> +
>>   	enable_rpm_wakeref_asserts(&dev_priv->runtime_pm);
>>
> Just wrap this in intel_gvt.c/.h which is i915 gvt host side caller, then
> i915 code just call intel_gvt_pm_suspend/resume().

It makes the integration more clean.

I'll move the code and update in V2 and include intel-gfx. Thanks.

>>   	return 0;
>> -- 
>> 2.26.2
>>
>> _______________________________________________
>> intel-gvt-dev mailing list
>> intel-gvt-dev at lists.freedesktop.org
>> https://lists.freedesktop.org/mailman/listinfo/intel-gvt-dev

-- 
Best Regards,
Colin Xu



More information about the intel-gvt-dev mailing list