[Intel-gfx] [PATCH 28/34] drm/i915/gvt: convert to use vfio_register_emulated_iommu_dev

Jason Gunthorpe jgg at nvidia.com
Mon Apr 11 18:36:48 UTC 2022


On Mon, Apr 11, 2022 at 04:13:57PM +0200, Christoph Hellwig wrote:

> -static int intel_vgpu_create(struct mdev_device *mdev)
> -{
> -	struct device *pdev = mdev_parent_dev(mdev);
> -	struct intel_gvt *gvt = kdev_to_i915(pdev)->gvt;
> -	struct intel_vgpu_type *type;
> -	struct intel_vgpu *vgpu;
> -
> -	type = &gvt->types[mdev_get_type_group_id(mdev)];
> -	if (!type)
> -		return -EINVAL;
> -
> -	vgpu = intel_gvt_create_vgpu(gvt, type);
> -	if (IS_ERR(vgpu)) {
> -		gvt_err("failed to create intel vgpu: %ld\n", PTR_ERR(vgpu));
> -		return PTR_ERR(vgpu);
> -	}
> -
> -	INIT_WORK(&vgpu->release_work, intel_vgpu_release_work);
> -
> -	vgpu->mdev = mdev;
> -	mdev_set_drvdata(mdev, vgpu);
> -
> -	gvt_dbg_core("intel_vgpu_create succeeded for mdev: %s\n",
> -		     dev_name(mdev_dev(mdev)));

nit: the debug print has the wrong function name now

Rest looks OK

Reviewed-by: Jason Gunthorpe <jgg at nvidia.com>

Jason


More information about the Intel-gfx mailing list