mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2025-01-18 11:54:37 +08:00
drm/i915/gvt: Rename ggtt related functions to be more specific
Accurate names help to avoid confusing so improve readability. Signed-off-by: Changbin Du <changbin.du@intel.com> Reviewed-by: Zhi Wang <zhi.a.wang@intel.com> Signed-off-by: Zhenyu Wang <zhenyuw@linux.intel.com>
This commit is contained in:
parent
bc37ab5679
commit
a143cef7db
@ -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);
|
||||
@ -1873,7 +1873,7 @@ err:
|
||||
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;
|
||||
@ -1902,7 +1902,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;
|
||||
@ -1912,11 +1912,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;
|
||||
@ -1969,13 +1969,13 @@ static int emulate_gtt_mmio_write(struct intel_vgpu *vgpu, unsigned int off,
|
||||
|
||||
out:
|
||||
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
|
||||
@ -1986,8 +1986,8 @@ out:
|
||||
* 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;
|
||||
@ -1996,7 +1996,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;
|
||||
}
|
||||
|
||||
@ -2457,7 +2457,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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -280,10 +280,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,
|
||||
|
@ -124,7 +124,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;
|
||||
@ -197,7 +197,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;
|
||||
|
Loading…
Reference in New Issue
Block a user