#endif
enum dce_version dc_version = DCE_VERSION_UNKNOWN;
-
dc_dceip = kzalloc(sizeof(*dc_dceip), GFP_KERNEL);
if (!dc_dceip) {
dm_error("%s: failed to create dceip\n", __func__);
return vmid;
}
-struct vm_helper init_vm_helper(unsigned int num_vmid, unsigned int num_hubp)
+void init_vm_helper(struct vm_helper *vm_helper, unsigned int num_vmid, unsigned int num_hubp)
{
- static uint64_t ptb_assigned_to_vmid[MAX_VMID];
- static struct vmid_usage hubp_vmid_usage[MAX_HUBP];
-
- return (struct vm_helper){
- .num_vmid = num_vmid,
- .num_hubp = num_hubp,
- .num_vmids_available = num_vmid - 1,
- .ptb_assigned_to_vmid = ptb_assigned_to_vmid,
- .hubp_vmid_usage = hubp_vmid_usage
- };
+ vm_helper->num_vmid = num_vmid;
+ vm_helper->num_hubp = num_hubp;
+ vm_helper->num_vmids_available = num_vmid - 1;
+
+ memset(vm_helper->hubp_vmid_usage, 0, sizeof(vm_helper->hubp_vmid_usage[0]) * MAX_HUBP);
+ memset(vm_helper->ptb_assigned_to_vmid, 0, sizeof(vm_helper->ptb_assigned_to_vmid[0]) * MAX_VMID);
}
unsigned int num_vmid;
unsigned int num_hubp;
unsigned int num_vmids_available;
- uint64_t *ptb_assigned_to_vmid;
- struct vmid_usage *hubp_vmid_usage;
+ uint64_t ptb_assigned_to_vmid[MAX_VMID];
+ struct vmid_usage hubp_vmid_usage[MAX_HUBP];
};
uint8_t get_vmid_for_ptb(
int64_t ptb,
uint8_t pipe_idx);
-struct vm_helper init_vm_helper(
+void init_vm_helper(
+ struct vm_helper *vm_helper,
unsigned int num_vmid,
unsigned int num_hubp);