Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
To: Tina Zhang <tina.zhang@intel.com>, intel-gvt-dev@lists.freedesktop.org
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH v1 4/4] drm/i915: enable guest full ppgtt when device model supports
Date: Thu, 11 May 2017 12:14:39 +0300	[thread overview]
Message-ID: <1494494079.4542.9.camel@linux.intel.com> (raw)
In-Reply-To: <1494469984-3486-5-git-send-email-tina.zhang@intel.com>

On to, 2017-05-11 at 10:33 +0800, Tina Zhang wrote:
> Add full ppgtt capability check in guest i915 driver and enable the full
> ppgtt in guest only when device mode supports.
> 
> Signed-off-by: Tina Zhang <tina.zhang@intel.com>

<SNIP>

> @@ -1909,6 +1909,7 @@ struct i915_workarounds {
>  
>  struct i915_virtual_gpu {
>  	bool active;
> +	uint32_t  caps;

u32, and no extra spaces.

> @@ -141,8 +141,8 @@ int intel_sanitize_enable_ppgtt(struct drm_i915_private *dev_priv,
>  	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 */
> +	if (intel_vgpu_active(dev_priv) &&
> +	    (!intel_vgpu_has_full_ppgtt(dev_priv))) {
>  		has_full_ppgtt = false;
>  		has_full_48bit_ppgtt = false;

	has_full_ppgtt = dev_priv->info.has_full_ppgtt;

	if (intel_vpgu_active(dev_priv))
		has_full_ppgtt = intel_vgpu_has_full_ppgtt(dev_priv);

 	has_full_48bit_ppgtt = has_full_ppgtt &&
			       dev_priv->info.has_full_48bit_ppgtt;

	Would make for cleanest code.

>  	}
> diff --git a/drivers/gpu/drm/i915/i915_vgpu.c b/drivers/gpu/drm/i915/i915_vgpu.c
> index 4ab8a97..9b92c73 100644
> --- a/drivers/gpu/drm/i915/i915_vgpu.c
> +++ b/drivers/gpu/drm/i915/i915_vgpu.c
> @@ -77,10 +77,16 @@ void i915_check_vgpu(struct drm_i915_private *dev_priv)
>  		return;
>  	}
>  
> +	dev_priv->vgpu.caps = __raw_i915_read32(dev_priv, vgtif_reg(vgt_caps));

Newline.

>  	dev_priv->vgpu.active = true;
>  	DRM_INFO("Virtual GPU for Intel GVT-g detected.\n");
>  }
>  
> +bool intel_vgpu_has_full_ppgtt(struct drm_i915_private *dev_priv)
> +{
> +	return (dev_priv->vgpu.caps & VGT_CAPS_FULL_PPGTT) ? true : false;
> +}

The ternary operator is not needed.

> +
>  struct _balloon_info_ {
>  	/*
>  	 * There are up to 2 regions per mappable/unmappable graphic
> diff --git a/drivers/gpu/drm/i915/i915_vgpu.h b/drivers/gpu/drm/i915/i915_vgpu.h
> index 3c3b2d2..4fc20aa 100644
> --- a/drivers/gpu/drm/i915/i915_vgpu.h
> +++ b/drivers/gpu/drm/i915/i915_vgpu.h
> @@ -29,5 +29,6 @@
>  void i915_check_vgpu(struct drm_i915_private *dev_priv);

Add the new function here and add a newline to separate.

Regards, Joonas

>  int intel_vgt_balloon(struct drm_i915_private *dev_priv);
>  void intel_vgt_deballoon(struct drm_i915_private *dev_priv);
> +bool intel_vgpu_has_full_ppgtt(struct drm_i915_private *dev_priv);
>  
>  #endif /* _I915_VGPU_H_ */
-- 
Joonas Lahtinen
Open Source Technology Center
Intel Corporation
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2017-05-11  9:14 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-11  2:33 [PATCH v1 0/4] Enable guest linux i915 full ppgtt functionality Tina Zhang
2017-05-11  2:33 ` [PATCH v1 1/4] drm/i915/gvt: reorder the shadow ppgtt update process by adding entry first Tina Zhang
2017-05-11  2:33 ` [PATCH v1 2/4] drm/i915: introduce vgt_caps to pvinfo Tina Zhang
2017-05-11  8:58   ` Joonas Lahtinen
2017-05-11  2:33 ` [PATCH v1 3/4] drm/i915/gvt: provide full ppgtt capability for guest i915 driver Tina Zhang
2017-05-11  9:19   ` Joonas Lahtinen
2017-05-11  2:33 ` [PATCH v1 4/4] drm/i915: enable guest full ppgtt when device model supports Tina Zhang
2017-05-11  9:14   ` Joonas Lahtinen [this message]
2017-05-11  2:56 ` ✓ Fi.CI.BAT: success for Enable guest linux i915 full ppgtt functionality Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1494494079.4542.9.camel@linux.intel.com \
    --to=joonas.lahtinen@linux.intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=intel-gvt-dev@lists.freedesktop.org \
    --cc=tina.zhang@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox