Exemplo n.º 1
0
/**
 * intel_gvt_init - initialize GVT components
 * @dev_priv: drm i915 private data
 *
 * This function is called at the initialization stage to create a GVT device.
 *
 * Returns:
 * Zero on success, negative error code if failed.
 *
 */
int intel_gvt_init(struct drm_i915_private *dev_priv)
{
	int ret;

	if (!i915.enable_gvt) {
		DRM_DEBUG_DRIVER("GVT-g is disabled by kernel params\n");
		return 0;
	}

	if (!is_supported_device(dev_priv)) {
		DRM_DEBUG_DRIVER("Unsupported device. GVT-g is disabled\n");
		goto bail;
	}

	/*
	 * We're not in host or fail to find a MPT module, disable GVT-g
	 */
	ret = intel_gvt_init_host();
	if (ret) {
		DRM_DEBUG_DRIVER("Not in host or MPT modules not found\n");
		goto bail;
	}

	ret = intel_gvt_init_device(dev_priv);
	if (ret) {
		DRM_DEBUG_DRIVER("Fail to init GVT device\n");
		goto bail;
	}

	return 0;

bail:
	i915.enable_gvt = 0;
	return 0;
}
Exemplo n.º 2
0
/**
 * intel_gvt_init - initialize GVT components
 * @dev_priv: drm i915 private data
 *
 * This function is called at the initialization stage to create a GVT device.
 *
 * Returns:
 * Zero on success, negative error code if failed.
 *
 */
int intel_gvt_init(struct drm_i915_private *dev_priv)
{
	int ret;

	if (i915_inject_load_failure())
		return -ENODEV;

	if (!i915_modparams.enable_gvt) {
		DRM_DEBUG_DRIVER("GVT-g is disabled by kernel params\n");
		return 0;
	}

	if (USES_GUC_SUBMISSION(dev_priv)) {
		DRM_ERROR("i915 GVT-g loading failed due to Graphics virtualization is not yet supported with GuC submission\n");
		return -EIO;
	}

	/*
	 * We're not in host or fail to find a MPT module, disable GVT-g
	 */
	ret = intel_gvt_init_host();
	if (ret) {
		DRM_DEBUG_DRIVER("Not in host or MPT modules not found\n");
		goto bail;
	}

	ret = intel_gvt_init_device(dev_priv);
	if (ret) {
		DRM_DEBUG_DRIVER("Fail to init GVT device\n");
		goto bail;
	}

	return 0;

bail:
	i915_modparams.enable_gvt = 0;
	return 0;
}