[PATCH 3/9] drm/i915/gvt: Rename ggtt related functions to be more specific
Zhi Wang
zhi.a.wang at intel.com
Mon Dec 25 10:03:08 UTC 2017
Reviewed-by: Zhi Wang <zhi.a.wang at intel.com>
On 12/25/17 17:11, changbin.du at intel.com wrote:
> From: Changbin Du <changbin.du at intel.com>
>
> Accurate names help to avoid confusing so improve readability.
>
> Signed-off-by: Changbin Du <changbin.du at intel.com>
> ---
> drivers/gpu/drm/i915/gvt/gtt.c | 22 +++++++++++-----------
> drivers/gpu/drm/i915/gvt/gtt.h | 4 ++--
> drivers/gpu/drm/i915/gvt/mmio.c | 4 ++--
> 3 files changed, 15 insertions(+), 15 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/gvt/gtt.c b/drivers/gpu/drm/i915/gvt/gtt.c
> index 337027e..9befbfa 100644
> --- a/drivers/gpu/drm/i915/gvt/gtt.c
> +++ b/drivers/gpu/drm/i915/gvt/gtt.c
> @@ -270,7 +270,7 @@ static u64 read_pte64(struct drm_i915_private *dev_priv, unsigned long index)
> return readq(addr);
> }
>
> -static void gtt_invalidate(struct drm_i915_private *dev_priv)
> +static void ggtt_invalidate(struct drm_i915_private *dev_priv)
> {
> mmio_hw_access_pre(dev_priv);
> I915_WRITE(GFX_FLSH_CNTL_GEN6, GFX_FLSH_CNTL_EN);
> @@ -1861,7 +1861,7 @@ unsigned long intel_vgpu_gma_to_gpa(struct intel_vgpu_mm *mm, unsigned long gma)
> return INTEL_GVT_INVALID_ADDR;
> }
>
> -static int emulate_gtt_mmio_read(struct intel_vgpu *vgpu,
> +static int emulate_ggtt_mmio_read(struct intel_vgpu *vgpu,
> unsigned int off, void *p_data, unsigned int bytes)
> {
> struct intel_vgpu_mm *ggtt_mm = vgpu->gtt.ggtt_mm;
> @@ -1890,7 +1890,7 @@ static int emulate_gtt_mmio_read(struct intel_vgpu *vgpu,
> * Returns:
> * Zero on success, error code if failed.
> */
> -int intel_vgpu_emulate_gtt_mmio_read(struct intel_vgpu *vgpu, unsigned int off,
> +int intel_vgpu_emulate_ggtt_mmio_read(struct intel_vgpu *vgpu, unsigned int off,
> void *p_data, unsigned int bytes)
> {
> const struct intel_gvt_device_info *info = &vgpu->gvt->device_info;
> @@ -1900,11 +1900,11 @@ int intel_vgpu_emulate_gtt_mmio_read(struct intel_vgpu *vgpu, unsigned int off,
> return -EINVAL;
>
> off -= info->gtt_start_offset;
> - ret = emulate_gtt_mmio_read(vgpu, off, p_data, bytes);
> + ret = emulate_ggtt_mmio_read(vgpu, off, p_data, bytes);
> return ret;
> }
>
> -static int emulate_gtt_mmio_write(struct intel_vgpu *vgpu, unsigned int off,
> +static int emulate_ggtt_mmio_write(struct intel_vgpu *vgpu, unsigned int off,
> void *p_data, unsigned int bytes)
> {
> struct intel_gvt *gvt = vgpu->gvt;
> @@ -1946,13 +1946,13 @@ static int emulate_gtt_mmio_write(struct intel_vgpu *vgpu, unsigned int off,
> }
>
> ggtt_set_host_entry(ggtt_mm, &m, g_gtt_index);
> - gtt_invalidate(gvt->dev_priv);
> + ggtt_invalidate(gvt->dev_priv);
> ggtt_set_guest_entry(ggtt_mm, &e, g_gtt_index);
> return 0;
> }
>
> /*
> - * intel_vgpu_emulate_gtt_mmio_write - emulate GTT MMIO register write
> + * intel_vgpu_emulate_ggtt_mmio_write - emulate GTT MMIO register write
> * @vgpu: a vGPU
> * @off: register offset
> * @p_data: data from guest write
> @@ -1963,8 +1963,8 @@ static int emulate_gtt_mmio_write(struct intel_vgpu *vgpu, unsigned int off,
> * Returns:
> * Zero on success, error code if failed.
> */
> -int intel_vgpu_emulate_gtt_mmio_write(struct intel_vgpu *vgpu, unsigned int off,
> - void *p_data, unsigned int bytes)
> +int intel_vgpu_emulate_ggtt_mmio_write(struct intel_vgpu *vgpu,
> + unsigned int off, void *p_data, unsigned int bytes)
> {
> const struct intel_gvt_device_info *info = &vgpu->gvt->device_info;
> int ret;
> @@ -1973,7 +1973,7 @@ int intel_vgpu_emulate_gtt_mmio_write(struct intel_vgpu *vgpu, unsigned int off,
> return -EINVAL;
>
> off -= info->gtt_start_offset;
> - ret = emulate_gtt_mmio_write(vgpu, off, p_data, bytes);
> + ret = emulate_ggtt_mmio_write(vgpu, off, p_data, bytes);
> return ret;
> }
>
> @@ -2433,7 +2433,7 @@ void intel_vgpu_reset_ggtt(struct intel_vgpu *vgpu)
> while (num_entries--)
> ggtt_set_host_entry(vgpu->gtt.ggtt_mm, &entry, index++);
>
> - gtt_invalidate(dev_priv);
> + ggtt_invalidate(dev_priv);
> }
>
> /**
> diff --git a/drivers/gpu/drm/i915/gvt/gtt.h b/drivers/gpu/drm/i915/gvt/gtt.h
> index 534f826..fa94e97 100644
> --- a/drivers/gpu/drm/i915/gvt/gtt.h
> +++ b/drivers/gpu/drm/i915/gvt/gtt.h
> @@ -273,10 +273,10 @@ int intel_vgpu_g2v_create_ppgtt_mm(struct intel_vgpu *vgpu,
>
> int intel_vgpu_g2v_destroy_ppgtt_mm(struct intel_vgpu *vgpu, u64 pdps[]);
>
> -int intel_vgpu_emulate_gtt_mmio_read(struct intel_vgpu *vgpu,
> +int intel_vgpu_emulate_ggtt_mmio_read(struct intel_vgpu *vgpu,
> unsigned int off, void *p_data, unsigned int bytes);
>
> -int intel_vgpu_emulate_gtt_mmio_write(struct intel_vgpu *vgpu,
> +int intel_vgpu_emulate_ggtt_mmio_write(struct intel_vgpu *vgpu,
> unsigned int off, void *p_data, unsigned int bytes);
>
> int intel_vgpu_write_protect_handler(struct intel_vgpu *vgpu, u64 pa,
> diff --git a/drivers/gpu/drm/i915/gvt/mmio.c b/drivers/gpu/drm/i915/gvt/mmio.c
> index eb65b0d..581ba13 100644
> --- a/drivers/gpu/drm/i915/gvt/mmio.c
> +++ b/drivers/gpu/drm/i915/gvt/mmio.c
> @@ -161,7 +161,7 @@ int intel_vgpu_emulate_mmio_read(struct intel_vgpu *vgpu, uint64_t pa,
> if (WARN_ON(!reg_is_gtt(gvt, offset + bytes - 1)))
> goto err;
>
> - ret = intel_vgpu_emulate_gtt_mmio_read(vgpu, offset,
> + ret = intel_vgpu_emulate_ggtt_mmio_read(vgpu, offset,
> p_data, bytes);
> if (ret)
> goto err;
> @@ -239,7 +239,7 @@ int intel_vgpu_emulate_mmio_write(struct intel_vgpu *vgpu, uint64_t pa,
> if (WARN_ON(!reg_is_gtt(gvt, offset + bytes - 1)))
> goto err;
>
> - ret = intel_vgpu_emulate_gtt_mmio_write(vgpu, offset,
> + ret = intel_vgpu_emulate_ggtt_mmio_write(vgpu, offset,
> p_data, bytes);
> if (ret)
> goto err;
>
More information about the intel-gvt-dev
mailing list