Skip to content

Commit

Permalink
drm/i915/gvt: Cleanup struct intel_gvt_mmio_info
Browse files Browse the repository at this point in the history
The size, length, addr_mask fields actually are not necessary. Every
tracked mmio has DWORD size, and addr_mask is a legacy field.

Signed-off-by: Changbin Du <changbin.du@intel.com>
Signed-off-by: Zhenyu Wang <zhenyuw@linux.intel.com>
  • Loading branch information
Changbin Du authored and Zhenyu Wang committed Jun 8, 2017
1 parent 65f9f6f commit d8d94ba
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 16 deletions.
9 changes: 2 additions & 7 deletions drivers/gpu/drm/i915/gvt/firmware.c
Original file line number Diff line number Diff line change
Expand Up @@ -102,13 +102,8 @@ static int expose_firmware_sysfs(struct intel_gvt *gvt)

p = firmware + h->mmio_offset;

hash_for_each(gvt->mmio.mmio_info_table, i, e, node) {
int j;

for (j = 0; j < e->length; j += 4)
*(u32 *)(p + e->offset + j) =
I915_READ_NOTRACE(_MMIO(e->offset + j));
}
hash_for_each(gvt->mmio.mmio_info_table, i, e, node)
*(u32 *)(p + e->offset) = I915_READ_NOTRACE(_MMIO(e->offset));

memcpy(gvt->firmware.mmio, p, info->mmio_size);

Expand Down
7 changes: 1 addition & 6 deletions drivers/gpu/drm/i915/gvt/handlers.c
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,7 @@ static int new_mmio_info(struct intel_gvt *gvt,
if (p)
gvt_err("dup mmio definition offset %x\n",
info->offset);
info->size = size;
info->length = (i + 4) < end ? 4 : (end - i);
info->addr_mask = addr_mask;

info->ro_mask = ro_mask;
info->device = device;
info->read = read ? read : intel_vgpu_default_mmio_read;
Expand Down Expand Up @@ -3114,9 +3112,6 @@ int intel_vgpu_mmio_reg_rw(struct intel_vgpu *vgpu, unsigned int offset,
goto default_rw;
}

if (WARN_ON(bytes > mmio_info->size))
return -EINVAL;

if (is_read)
return mmio_info->read(vgpu, offset, pdata, bytes);
else {
Expand Down
3 changes: 0 additions & 3 deletions drivers/gpu/drm/i915/gvt/mmio.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,6 @@ typedef int (*gvt_mmio_func)(struct intel_vgpu *, unsigned int, void *,

struct intel_gvt_mmio_info {
u32 offset;
u32 size;
u32 length;
u32 addr_mask;
u64 ro_mask;
u32 device;
gvt_mmio_func read;
Expand Down

0 comments on commit d8d94ba

Please sign in to comment.