Commit 99c79fd4 authored by Du, Changbin's avatar Du, Changbin Committed by Zhenyu Wang

drm/i915/gvt: use well wrapped set_mask_bits() instead of defining new one

Macro set_mask_bits() is ready for us, just invoke it and remove
our write_bits().
Signed-off-by: default avatarDu, Changbin <changbin.du@intel.com>
Signed-off-by: default avatarZhenyu Wang <zhenyuw@linux.intel.com>
parent 2cce9b28
...@@ -1201,20 +1201,19 @@ static int gen8_update_plane_mmio_from_mi_display_flip( ...@@ -1201,20 +1201,19 @@ static int gen8_update_plane_mmio_from_mi_display_flip(
struct drm_i915_private *dev_priv = s->vgpu->gvt->dev_priv; struct drm_i915_private *dev_priv = s->vgpu->gvt->dev_priv;
struct intel_vgpu *vgpu = s->vgpu; struct intel_vgpu *vgpu = s->vgpu;
#define write_bits(reg, e, s, v) do { \ set_mask_bits(&vgpu_vreg(vgpu, info->surf_reg), GENMASK(31, 12),
vgpu_vreg(vgpu, reg) &= ~GENMASK(e, s); \ info->surf_val << 12);
vgpu_vreg(vgpu, reg) |= (v << s); \ if (IS_SKYLAKE(dev_priv)) {
} while (0) set_mask_bits(&vgpu_vreg(vgpu, info->stride_reg), GENMASK(9, 0),
info->stride_val);
write_bits(info->surf_reg, 31, 12, info->surf_val); set_mask_bits(&vgpu_vreg(vgpu, info->ctrl_reg), GENMASK(12, 10),
if (IS_SKYLAKE(dev_priv)) info->tile_val << 10);
write_bits(info->stride_reg, 9, 0, info->stride_val); } else {
else set_mask_bits(&vgpu_vreg(vgpu, info->stride_reg), GENMASK(15, 6),
write_bits(info->stride_reg, 15, 6, info->stride_val); info->stride_val << 6);
write_bits(info->ctrl_reg, IS_SKYLAKE(dev_priv) ? 12 : 10, set_mask_bits(&vgpu_vreg(vgpu, info->ctrl_reg), GENMASK(10, 10),
10, info->tile_val); info->tile_val << 10);
}
#undef write_bits
vgpu_vreg(vgpu, PIPE_FRMCOUNT_G4X(info->pipe))++; vgpu_vreg(vgpu, PIPE_FRMCOUNT_G4X(info->pipe))++;
intel_vgpu_trigger_virtual_event(vgpu, info->event); intel_vgpu_trigger_virtual_event(vgpu, info->event);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment