}
/**
+ * intel_gvt_sanitize_options - sanitize GVT related options
+ * @dev_priv: drm i915 private data
+ *
+ * This function is called at the i915 options sanitize stage.
+ */
+void intel_gvt_sanitize_options(struct drm_i915_private *dev_priv)
+{
+ if (!i915.enable_gvt)
+ return;
+
+ if (intel_vgpu_active(dev_priv)) {
+ DRM_INFO("GVT-g is disabled for guest\n");
+ goto bail;
+ }
+
+ if (!is_supported_device(dev_priv)) {
+ DRM_INFO("Unsupported device. GVT-g is disabled\n");
+ goto bail;
+ }
+
+ return;
+bail:
+ i915.enable_gvt = 0;
+}
+
+/**
* intel_gvt_init - initialize GVT components
* @dev_priv: drm i915 private data
*
return 0;
}
- if (intel_vgpu_active(dev_priv)) {
- DRM_DEBUG_DRIVER("GVT-g is disabled for guest\n");
- goto bail;
- }
-
- if (!is_supported_device(dev_priv)) {
- DRM_DEBUG_DRIVER("Unsupported device. GVT-g is disabled\n");
- goto bail;
- }
-
if (!i915.enable_execlists) {
DRM_INFO("GPU guest virtualisation [GVT-g] disabled due to disabled execlist submission [i915.enable_execlists module parameter]\n");
goto bail;
int intel_gvt_init_device(struct drm_i915_private *dev_priv);
void intel_gvt_clean_device(struct drm_i915_private *dev_priv);
int intel_gvt_init_host(void);
+void intel_gvt_sanitize_options(struct drm_i915_private *dev_priv);
#else
static inline int intel_gvt_init(struct drm_i915_private *dev_priv)
{
static inline void intel_gvt_cleanup(struct drm_i915_private *dev_priv)
{
}
+
+static inline void intel_gvt_sanitize_options(struct drm_i915_private *dev_priv)
+{
+}
#endif
#endif /* _INTEL_GVT_H_ */