Lines Matching refs:dev_priv

52 static bool is_supported_device(struct drm_i915_private *dev_priv)
54 if (IS_BROADWELL(dev_priv))
56 if (IS_SKYLAKE(dev_priv))
58 if (IS_KABYLAKE(dev_priv))
60 if (IS_BROXTON(dev_priv))
62 if (IS_COFFEELAKE(dev_priv))
64 if (IS_COMETLAKE(dev_priv))
70 static void free_initial_hw_state(struct drm_i915_private *dev_priv)
72 struct i915_virtual_gpu *vgpu = &dev_priv->vgpu;
84 struct drm_i915_private *dev_priv = iter->i915;
89 *mmio = intel_uncore_read_notrace(to_gt(dev_priv)->uncore,
104 static int save_initial_hw_state(struct drm_i915_private *dev_priv)
106 struct pci_dev *pdev = to_pci_dev(dev_priv->drm.dev);
107 struct i915_virtual_gpu *vgpu = &dev_priv->vgpu;
129 iter.i915 = dev_priv;
149 static void intel_gvt_init_device(struct drm_i915_private *dev_priv)
151 if (!dev_priv->params.enable_gvt) {
152 drm_dbg(&dev_priv->drm,
157 if (intel_vgpu_active(dev_priv)) {
158 drm_info(&dev_priv->drm, "GVT-g is disabled for guest\n");
162 if (!is_supported_device(dev_priv)) {
163 drm_info(&dev_priv->drm,
168 if (intel_uc_wants_guc_submission(&to_gt(dev_priv)->uc)) {
169 drm_err(&dev_priv->drm,
174 if (save_initial_hw_state(dev_priv)) {
175 drm_dbg(&dev_priv->drm, "Failed to save initial HW state\n");
179 if (intel_gvt_ops->init_device(dev_priv))
180 drm_dbg(&dev_priv->drm, "Fail to init GVT device\n");
183 static void intel_gvt_clean_device(struct drm_i915_private *dev_priv)
185 if (dev_priv->gvt)
186 intel_gvt_ops->clean_device(dev_priv);
187 free_initial_hw_state(dev_priv);
192 struct drm_i915_private *dev_priv;
201 list_for_each_entry(dev_priv, &intel_gvt_devices, vgpu.entry)
202 intel_gvt_init_device(dev_priv);
211 struct drm_i915_private *dev_priv;
219 list_for_each_entry(dev_priv, &intel_gvt_devices, vgpu.entry)
220 intel_gvt_clean_device(dev_priv);
229 * @dev_priv: drm i915 private data
237 int intel_gvt_init(struct drm_i915_private *dev_priv)
239 if (i915_inject_probe_failure(dev_priv))
243 list_add_tail(&dev_priv->vgpu.entry, &intel_gvt_devices);
245 intel_gvt_init_device(dev_priv);
254 * @dev_priv: drm i915 private *
259 void intel_gvt_driver_remove(struct drm_i915_private *dev_priv)
262 intel_gvt_clean_device(dev_priv);
263 list_del(&dev_priv->vgpu.entry);
270 * @dev_priv: drm i915 private *
275 void intel_gvt_resume(struct drm_i915_private *dev_priv)
278 if (dev_priv->gvt)
279 intel_gvt_ops->pm_resume(dev_priv);