[Intel-gfx] [PATCH v6] drm/i915: Enable guest i915 48bit full ppgtt functionality

Zhenyu Wang zhenyuw at linux.intel.com
Wed Jun 21 07:24:43 UTC 2017


On 2017.06.20 21:12:19 +0800, Tina Zhang wrote:
> diff --git a/drivers/gpu/drm/i915/i915_gem_gtt.c b/drivers/gpu/drm/i915/i915_gem_gtt.c
> index 4ff854e..d777405 100644
> --- a/drivers/gpu/drm/i915/i915_gem_gtt.c
> +++ b/drivers/gpu/drm/i915/i915_gem_gtt.c
> @@ -141,14 +141,20 @@ int intel_sanitize_enable_ppgtt(struct drm_i915_private *dev_priv,
>  
>  	has_aliasing_ppgtt = dev_priv->info.has_aliasing_ppgtt;
>  	has_full_ppgtt = dev_priv->info.has_full_ppgtt;
> -	has_full_48bit_ppgtt = dev_priv->info.has_full_48bit_ppgtt;
>  
>  	if (intel_vgpu_active(dev_priv)) {
> -		/* emulation is too hard */
> -		has_full_ppgtt = false;
> -		has_full_48bit_ppgtt = false;
> +		has_full_ppgtt = intel_vgpu_has_full_ppgtt(dev_priv);
> +		/*
> +		 * FIXME: There is a limition of vgpu supporting 32bit full
> +		 * ppgtt.
> +		 */
> +		if (enable_ppgtt == 2)
> +			enable_ppgtt = 1;
>  	}
>  
> +	has_full_48bit_ppgtt = has_full_ppgtt &&
> +		dev_priv->info.has_full_48bit_ppgtt;
> +

Does has_full_ppgtt indicate for generic full ppgtt hw feature or just
mean for legacy 32bit ppgtt? If later, then has_full_48bit_ppgtt is not
requiring has_full_ppgtt, for vgpu they'll be all indicated by caps bits,
so we just need to adjust later code like below?

@@ -180,8 +180,8 @@ int intel_sanitize_enable_ppgtt(struct drm_i915_private *dev_priv,
 		return 0;
 	}
 
-	if (INTEL_GEN(dev_priv) >= 8 && i915.enable_execlists && has_full_ppgtt)
-		return has_full_48bit_ppgtt ? 3 : 2;
+	if (INTEL_GEN(dev_priv) >= 8 && i915.enable_execlists)
+		return has_full_48bit_ppgtt ? 3 : (has_full_ppgtt ? 2 : 1);
 	else
 		return has_aliasing_ppgtt ? 1 : 0;
 }

-- 
Open Source Technology Center, Intel ltd.

$gpg --keyserver wwwkeys.pgp.net --recv-keys 4D781827
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/intel-gfx/attachments/20170621/dc30f171/attachment.sig>


More information about the Intel-gfx mailing list