Commit 2e679d48 authored by Jani Nikula's avatar Jani Nikula Committed by Zhenyu Wang

drm/i915/gvt: switch to kernel types

Mixed C99 and kernel types use is getting ugly. Prefer kernel types.

sed -i 's/\buint\(8\|16\|32\|64\)_t\b/u\1/g'
Acked-by: default avatarZhenyu Wang <zhenyuw@linux.intel.com>
Signed-off-by: default avatarJani Nikula <jani.nikula@intel.com>
Signed-off-by: default avatarZhenyu Wang <zhenyuw@linux.intel.com>
parent 6c46c2e8
...@@ -399,10 +399,10 @@ struct cmd_info { ...@@ -399,10 +399,10 @@ struct cmd_info {
#define R_VECS (1 << VECS) #define R_VECS (1 << VECS)
#define R_ALL (R_RCS | R_VCS | R_BCS | R_VECS) #define R_ALL (R_RCS | R_VCS | R_BCS | R_VECS)
/* rings that support this cmd: BLT/RCS/VCS/VECS */ /* rings that support this cmd: BLT/RCS/VCS/VECS */
uint16_t rings; u16 rings;
/* devices that support this cmd: SNB/IVB/HSW/... */ /* devices that support this cmd: SNB/IVB/HSW/... */
uint16_t devices; u16 devices;
/* which DWords are address that need fix up. /* which DWords are address that need fix up.
* bit 0 means a 32-bit non address operand in command * bit 0 means a 32-bit non address operand in command
...@@ -412,13 +412,13 @@ struct cmd_info { ...@@ -412,13 +412,13 @@ struct cmd_info {
* No matter the address length, each address only takes * No matter the address length, each address only takes
* one bit in the bitmap. * one bit in the bitmap.
*/ */
uint16_t addr_bitmap; u16 addr_bitmap;
/* flag == F_LEN_CONST : command length /* flag == F_LEN_CONST : command length
* flag == F_LEN_VAR : length bias bits * flag == F_LEN_VAR : length bias bits
* Note: length is in DWord * Note: length is in DWord
*/ */
uint8_t len; u8 len;
parser_cmd_handler handler; parser_cmd_handler handler;
}; };
...@@ -1639,7 +1639,7 @@ static int find_bb_size(struct parser_exec_state *s, unsigned long *bb_size) ...@@ -1639,7 +1639,7 @@ static int find_bb_size(struct parser_exec_state *s, unsigned long *bb_size)
{ {
unsigned long gma = 0; unsigned long gma = 0;
const struct cmd_info *info; const struct cmd_info *info;
uint32_t cmd_len = 0; u32 cmd_len = 0;
bool bb_end = false; bool bb_end = false;
struct intel_vgpu *vgpu = s->vgpu; struct intel_vgpu *vgpu = s->vgpu;
u32 cmd; u32 cmd;
...@@ -2678,7 +2678,7 @@ static int scan_wa_ctx(struct intel_shadow_wa_ctx *wa_ctx) ...@@ -2678,7 +2678,7 @@ static int scan_wa_ctx(struct intel_shadow_wa_ctx *wa_ctx)
I915_GTT_PAGE_SIZE))) I915_GTT_PAGE_SIZE)))
return -EINVAL; return -EINVAL;
ring_tail = wa_ctx->indirect_ctx.size + 3 * sizeof(uint32_t); ring_tail = wa_ctx->indirect_ctx.size + 3 * sizeof(u32);
ring_size = round_up(wa_ctx->indirect_ctx.size + CACHELINE_BYTES, ring_size = round_up(wa_ctx->indirect_ctx.size + CACHELINE_BYTES,
PAGE_SIZE); PAGE_SIZE);
gma_head = wa_ctx->indirect_ctx.guest_gma; gma_head = wa_ctx->indirect_ctx.guest_gma;
...@@ -2845,7 +2845,7 @@ static int shadow_indirect_ctx(struct intel_shadow_wa_ctx *wa_ctx) ...@@ -2845,7 +2845,7 @@ static int shadow_indirect_ctx(struct intel_shadow_wa_ctx *wa_ctx)
static int combine_wa_ctx(struct intel_shadow_wa_ctx *wa_ctx) static int combine_wa_ctx(struct intel_shadow_wa_ctx *wa_ctx)
{ {
uint32_t per_ctx_start[CACHELINE_DWORDS] = {0}; u32 per_ctx_start[CACHELINE_DWORDS] = {0};
unsigned char *bb_start_sva; unsigned char *bb_start_sva;
if (!wa_ctx->per_ctx.valid) if (!wa_ctx->per_ctx.valid)
......
...@@ -278,7 +278,7 @@ static int mul_force_wake_write(struct intel_vgpu *vgpu, ...@@ -278,7 +278,7 @@ static int mul_force_wake_write(struct intel_vgpu *vgpu,
unsigned int offset, void *p_data, unsigned int bytes) unsigned int offset, void *p_data, unsigned int bytes)
{ {
u32 old, new; u32 old, new;
uint32_t ack_reg_offset; u32 ack_reg_offset;
old = vgpu_vreg(vgpu, offset); old = vgpu_vreg(vgpu, offset);
new = CALC_MODE_MASK_REG(old, *(u32 *)p_data); new = CALC_MODE_MASK_REG(old, *(u32 *)p_data);
...@@ -833,7 +833,7 @@ static int dp_aux_ch_ctl_trans_done(struct intel_vgpu *vgpu, u32 value, ...@@ -833,7 +833,7 @@ static int dp_aux_ch_ctl_trans_done(struct intel_vgpu *vgpu, u32 value,
} }
static void dp_aux_ch_ctl_link_training(struct intel_vgpu_dpcd_data *dpcd, static void dp_aux_ch_ctl_link_training(struct intel_vgpu_dpcd_data *dpcd,
uint8_t t) u8 t)
{ {
if ((t & DPCD_TRAINING_PATTERN_SET_MASK) == DPCD_TRAINING_PATTERN_1) { if ((t & DPCD_TRAINING_PATTERN_SET_MASK) == DPCD_TRAINING_PATTERN_1) {
/* training pattern 1 for CR */ /* training pattern 1 for CR */
...@@ -917,7 +917,7 @@ static int dp_aux_ch_ctl_mmio_write(struct intel_vgpu *vgpu, ...@@ -917,7 +917,7 @@ static int dp_aux_ch_ctl_mmio_write(struct intel_vgpu *vgpu,
if (op == GVT_AUX_NATIVE_WRITE) { if (op == GVT_AUX_NATIVE_WRITE) {
int t; int t;
uint8_t buf[16]; u8 buf[16];
if ((addr + len + 1) >= DPCD_SIZE) { if ((addr + len + 1) >= DPCD_SIZE) {
/* /*
......
...@@ -712,7 +712,7 @@ static void intel_vgpu_release_work(struct work_struct *work) ...@@ -712,7 +712,7 @@ static void intel_vgpu_release_work(struct work_struct *work)
__intel_vgpu_release(vgpu); __intel_vgpu_release(vgpu);
} }
static uint64_t intel_vgpu_get_bar_addr(struct intel_vgpu *vgpu, int bar) static u64 intel_vgpu_get_bar_addr(struct intel_vgpu *vgpu, int bar)
{ {
u32 start_lo, start_hi; u32 start_lo, start_hi;
u32 mem_type; u32 mem_type;
...@@ -739,10 +739,10 @@ static uint64_t intel_vgpu_get_bar_addr(struct intel_vgpu *vgpu, int bar) ...@@ -739,10 +739,10 @@ static uint64_t intel_vgpu_get_bar_addr(struct intel_vgpu *vgpu, int bar)
return ((u64)start_hi << 32) | start_lo; return ((u64)start_hi << 32) | start_lo;
} }
static int intel_vgpu_bar_rw(struct intel_vgpu *vgpu, int bar, uint64_t off, static int intel_vgpu_bar_rw(struct intel_vgpu *vgpu, int bar, u64 off,
void *buf, unsigned int count, bool is_write) void *buf, unsigned int count, bool is_write)
{ {
uint64_t bar_start = intel_vgpu_get_bar_addr(vgpu, bar); u64 bar_start = intel_vgpu_get_bar_addr(vgpu, bar);
int ret; int ret;
if (is_write) if (is_write)
...@@ -754,13 +754,13 @@ static int intel_vgpu_bar_rw(struct intel_vgpu *vgpu, int bar, uint64_t off, ...@@ -754,13 +754,13 @@ static int intel_vgpu_bar_rw(struct intel_vgpu *vgpu, int bar, uint64_t off,
return ret; return ret;
} }
static inline bool intel_vgpu_in_aperture(struct intel_vgpu *vgpu, uint64_t off) static inline bool intel_vgpu_in_aperture(struct intel_vgpu *vgpu, u64 off)
{ {
return off >= vgpu_aperture_offset(vgpu) && return off >= vgpu_aperture_offset(vgpu) &&
off < vgpu_aperture_offset(vgpu) + vgpu_aperture_sz(vgpu); off < vgpu_aperture_offset(vgpu) + vgpu_aperture_sz(vgpu);
} }
static int intel_vgpu_aperture_rw(struct intel_vgpu *vgpu, uint64_t off, static int intel_vgpu_aperture_rw(struct intel_vgpu *vgpu, u64 off,
void *buf, unsigned long count, bool is_write) void *buf, unsigned long count, bool is_write)
{ {
void *aperture_va; void *aperture_va;
...@@ -792,7 +792,7 @@ static ssize_t intel_vgpu_rw(struct mdev_device *mdev, char *buf, ...@@ -792,7 +792,7 @@ static ssize_t intel_vgpu_rw(struct mdev_device *mdev, char *buf,
{ {
struct intel_vgpu *vgpu = mdev_get_drvdata(mdev); struct intel_vgpu *vgpu = mdev_get_drvdata(mdev);
unsigned int index = VFIO_PCI_OFFSET_TO_INDEX(*ppos); unsigned int index = VFIO_PCI_OFFSET_TO_INDEX(*ppos);
uint64_t pos = *ppos & VFIO_PCI_OFFSET_MASK; u64 pos = *ppos & VFIO_PCI_OFFSET_MASK;
int ret = -EINVAL; int ret = -EINVAL;
...@@ -1038,7 +1038,7 @@ static int intel_vgpu_get_irq_count(struct intel_vgpu *vgpu, int type) ...@@ -1038,7 +1038,7 @@ static int intel_vgpu_get_irq_count(struct intel_vgpu *vgpu, int type)
static int intel_vgpu_set_intx_mask(struct intel_vgpu *vgpu, static int intel_vgpu_set_intx_mask(struct intel_vgpu *vgpu,
unsigned int index, unsigned int start, unsigned int index, unsigned int start,
unsigned int count, uint32_t flags, unsigned int count, u32 flags,
void *data) void *data)
{ {
return 0; return 0;
...@@ -1046,21 +1046,21 @@ static int intel_vgpu_set_intx_mask(struct intel_vgpu *vgpu, ...@@ -1046,21 +1046,21 @@ static int intel_vgpu_set_intx_mask(struct intel_vgpu *vgpu,
static int intel_vgpu_set_intx_unmask(struct intel_vgpu *vgpu, static int intel_vgpu_set_intx_unmask(struct intel_vgpu *vgpu,
unsigned int index, unsigned int start, unsigned int index, unsigned int start,
unsigned int count, uint32_t flags, void *data) unsigned int count, u32 flags, void *data)
{ {
return 0; return 0;
} }
static int intel_vgpu_set_intx_trigger(struct intel_vgpu *vgpu, static int intel_vgpu_set_intx_trigger(struct intel_vgpu *vgpu,
unsigned int index, unsigned int start, unsigned int count, unsigned int index, unsigned int start, unsigned int count,
uint32_t flags, void *data) u32 flags, void *data)
{ {
return 0; return 0;
} }
static int intel_vgpu_set_msi_trigger(struct intel_vgpu *vgpu, static int intel_vgpu_set_msi_trigger(struct intel_vgpu *vgpu,
unsigned int index, unsigned int start, unsigned int count, unsigned int index, unsigned int start, unsigned int count,
uint32_t flags, void *data) u32 flags, void *data)
{ {
struct eventfd_ctx *trigger; struct eventfd_ctx *trigger;
...@@ -1079,12 +1079,12 @@ static int intel_vgpu_set_msi_trigger(struct intel_vgpu *vgpu, ...@@ -1079,12 +1079,12 @@ static int intel_vgpu_set_msi_trigger(struct intel_vgpu *vgpu,
return 0; return 0;
} }
static int intel_vgpu_set_irqs(struct intel_vgpu *vgpu, uint32_t flags, static int intel_vgpu_set_irqs(struct intel_vgpu *vgpu, u32 flags,
unsigned int index, unsigned int start, unsigned int count, unsigned int index, unsigned int start, unsigned int count,
void *data) void *data)
{ {
int (*func)(struct intel_vgpu *vgpu, unsigned int index, int (*func)(struct intel_vgpu *vgpu, unsigned int index,
unsigned int start, unsigned int count, uint32_t flags, unsigned int start, unsigned int count, u32 flags,
void *data) = NULL; void *data) = NULL;
switch (index) { switch (index) {
......
...@@ -57,7 +57,7 @@ int intel_vgpu_gpa_to_mmio_offset(struct intel_vgpu *vgpu, u64 gpa) ...@@ -57,7 +57,7 @@ int intel_vgpu_gpa_to_mmio_offset(struct intel_vgpu *vgpu, u64 gpa)
(reg >= gvt->device_info.gtt_start_offset \ (reg >= gvt->device_info.gtt_start_offset \
&& reg < gvt->device_info.gtt_start_offset + gvt_ggtt_sz(gvt)) && reg < gvt->device_info.gtt_start_offset + gvt_ggtt_sz(gvt))
static void failsafe_emulate_mmio_rw(struct intel_vgpu *vgpu, uint64_t pa, static void failsafe_emulate_mmio_rw(struct intel_vgpu *vgpu, u64 pa,
void *p_data, unsigned int bytes, bool read) void *p_data, unsigned int bytes, bool read)
{ {
struct intel_gvt *gvt = NULL; struct intel_gvt *gvt = NULL;
...@@ -99,7 +99,7 @@ static void failsafe_emulate_mmio_rw(struct intel_vgpu *vgpu, uint64_t pa, ...@@ -99,7 +99,7 @@ static void failsafe_emulate_mmio_rw(struct intel_vgpu *vgpu, uint64_t pa,
* Returns: * Returns:
* Zero on success, negative error code if failed * Zero on success, negative error code if failed
*/ */
int intel_vgpu_emulate_mmio_read(struct intel_vgpu *vgpu, uint64_t pa, int intel_vgpu_emulate_mmio_read(struct intel_vgpu *vgpu, u64 pa,
void *p_data, unsigned int bytes) void *p_data, unsigned int bytes)
{ {
struct intel_gvt *gvt = vgpu->gvt; struct intel_gvt *gvt = vgpu->gvt;
...@@ -171,7 +171,7 @@ int intel_vgpu_emulate_mmio_read(struct intel_vgpu *vgpu, uint64_t pa, ...@@ -171,7 +171,7 @@ int intel_vgpu_emulate_mmio_read(struct intel_vgpu *vgpu, uint64_t pa,
* Returns: * Returns:
* Zero on success, negative error code if failed * Zero on success, negative error code if failed
*/ */
int intel_vgpu_emulate_mmio_write(struct intel_vgpu *vgpu, uint64_t pa, int intel_vgpu_emulate_mmio_write(struct intel_vgpu *vgpu, u64 pa,
void *p_data, unsigned int bytes) void *p_data, unsigned int bytes)
{ {
struct intel_gvt *gvt = vgpu->gvt; struct intel_gvt *gvt = vgpu->gvt;
......
...@@ -94,7 +94,7 @@ static void gvt_balance_timeslice(struct gvt_sched_data *sched_data) ...@@ -94,7 +94,7 @@ static void gvt_balance_timeslice(struct gvt_sched_data *sched_data)
{ {
struct vgpu_sched_data *vgpu_data; struct vgpu_sched_data *vgpu_data;
struct list_head *pos; struct list_head *pos;
static uint64_t stage_check; static u64 stage_check;
int stage = stage_check++ % GVT_TS_BALANCE_STAGE_NUM; int stage = stage_check++ % GVT_TS_BALANCE_STAGE_NUM;
/* The timeslice accumulation reset at stage 0, which is /* The timeslice accumulation reset at stage 0, which is
......
...@@ -61,7 +61,7 @@ struct shadow_indirect_ctx { ...@@ -61,7 +61,7 @@ struct shadow_indirect_ctx {
unsigned long guest_gma; unsigned long guest_gma;
unsigned long shadow_gma; unsigned long shadow_gma;
void *shadow_va; void *shadow_va;
uint32_t size; u32 size;
}; };
#define PER_CTX_ADDR_MASK 0xfffff000 #define PER_CTX_ADDR_MASK 0xfffff000
......
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