Lines Matching refs:args

133 	struct kfd_ioctl_get_version_args *args = data;  in kfd_ioctl_get_version()  local
136 args->major_version = KFD_IOCTL_MAJOR_VERSION; in kfd_ioctl_get_version()
137 args->minor_version = KFD_IOCTL_MINOR_VERSION; in kfd_ioctl_get_version()
143 struct kfd_ioctl_create_queue_args *args) in set_queue_properties_from_user() argument
145 if (args->queue_percentage > KFD_MAX_QUEUE_PERCENTAGE) { in set_queue_properties_from_user()
150 if (args->queue_priority > KFD_MAX_QUEUE_PRIORITY) { in set_queue_properties_from_user()
155 if ((args->ring_base_address) && in set_queue_properties_from_user()
157 (const void __user *) args->ring_base_address, in set_queue_properties_from_user()
163 if (!is_power_of_2(args->ring_size) && (args->ring_size != 0)) { in set_queue_properties_from_user()
169 (const void __user *) args->read_pointer_address, in set_queue_properties_from_user()
176 (const void __user *) args->write_pointer_address, in set_queue_properties_from_user()
182 if (args->eop_buffer_address && in set_queue_properties_from_user()
184 (const void __user *) args->eop_buffer_address, in set_queue_properties_from_user()
190 if (args->ctx_save_restore_address && in set_queue_properties_from_user()
192 (const void __user *) args->ctx_save_restore_address, in set_queue_properties_from_user()
199 q_properties->queue_percent = args->queue_percentage; in set_queue_properties_from_user()
200 q_properties->priority = args->queue_priority; in set_queue_properties_from_user()
201 q_properties->queue_address = args->ring_base_address; in set_queue_properties_from_user()
202 q_properties->queue_size = args->ring_size; in set_queue_properties_from_user()
203 q_properties->read_ptr = (uint32_t *) args->read_pointer_address; in set_queue_properties_from_user()
204 q_properties->write_ptr = (uint32_t *) args->write_pointer_address; in set_queue_properties_from_user()
205 q_properties->eop_ring_buffer_address = args->eop_buffer_address; in set_queue_properties_from_user()
206 q_properties->eop_ring_buffer_size = args->eop_buffer_size; in set_queue_properties_from_user()
208 args->ctx_save_restore_address; in set_queue_properties_from_user()
209 q_properties->ctx_save_restore_area_size = args->ctx_save_restore_size; in set_queue_properties_from_user()
210 if (args->queue_type == KFD_IOC_QUEUE_TYPE_COMPUTE || in set_queue_properties_from_user()
211 args->queue_type == KFD_IOC_QUEUE_TYPE_COMPUTE_AQL) in set_queue_properties_from_user()
213 else if (args->queue_type == KFD_IOC_QUEUE_TYPE_SDMA) in set_queue_properties_from_user()
218 if (args->queue_type == KFD_IOC_QUEUE_TYPE_COMPUTE_AQL) in set_queue_properties_from_user()
224 q_properties->queue_percent, args->queue_percentage); in set_queue_properties_from_user()
227 q_properties->priority, args->queue_priority); in set_queue_properties_from_user()
230 q_properties->queue_address, args->ring_base_address); in set_queue_properties_from_user()
233 q_properties->queue_size, args->ring_size); in set_queue_properties_from_user()
252 struct kfd_ioctl_create_queue_args *args = data; in kfd_ioctl_create_queue() local
263 err = set_queue_properties_from_user(&q_properties, args); in kfd_ioctl_create_queue()
267 pr_debug("kfd: looking for gpu id 0x%x\n", args->gpu_id); in kfd_ioctl_create_queue()
268 dev = kfd_device_by_id(args->gpu_id); in kfd_ioctl_create_queue()
270 pr_debug("kfd: gpu id 0x%x was not found\n", args->gpu_id); in kfd_ioctl_create_queue()
291 args->queue_id = queue_id; in kfd_ioctl_create_queue()
295 args->doorbell_offset = (KFD_MMAP_DOORBELL_MASK | args->gpu_id); in kfd_ioctl_create_queue()
296 args->doorbell_offset <<= PAGE_SHIFT; in kfd_ioctl_create_queue()
300 pr_debug("kfd: queue id %d was created successfully\n", args->queue_id); in kfd_ioctl_create_queue()
303 args->ring_base_address); in kfd_ioctl_create_queue()
306 args->read_pointer_address); in kfd_ioctl_create_queue()
309 args->write_pointer_address); in kfd_ioctl_create_queue()
323 struct kfd_ioctl_destroy_queue_args *args = data; in kfd_ioctl_destroy_queue() local
326 args->queue_id, in kfd_ioctl_destroy_queue()
331 retval = pqm_destroy_queue(&p->pqm, args->queue_id); in kfd_ioctl_destroy_queue()
341 struct kfd_ioctl_update_queue_args *args = data; in kfd_ioctl_update_queue() local
344 if (args->queue_percentage > KFD_MAX_QUEUE_PERCENTAGE) { in kfd_ioctl_update_queue()
349 if (args->queue_priority > KFD_MAX_QUEUE_PRIORITY) { in kfd_ioctl_update_queue()
354 if ((args->ring_base_address) && in kfd_ioctl_update_queue()
356 (const void __user *) args->ring_base_address, in kfd_ioctl_update_queue()
362 if (!is_power_of_2(args->ring_size) && (args->ring_size != 0)) { in kfd_ioctl_update_queue()
367 properties.queue_address = args->ring_base_address; in kfd_ioctl_update_queue()
368 properties.queue_size = args->ring_size; in kfd_ioctl_update_queue()
369 properties.queue_percent = args->queue_percentage; in kfd_ioctl_update_queue()
370 properties.priority = args->queue_priority; in kfd_ioctl_update_queue()
373 args->queue_id, p->pasid); in kfd_ioctl_update_queue()
377 retval = pqm_update_queue(&p->pqm, args->queue_id, &properties); in kfd_ioctl_update_queue()
387 struct kfd_ioctl_set_memory_policy_args *args = data; in kfd_ioctl_set_memory_policy() local
393 if (args->default_policy != KFD_IOC_CACHE_POLICY_COHERENT in kfd_ioctl_set_memory_policy()
394 && args->default_policy != KFD_IOC_CACHE_POLICY_NONCOHERENT) { in kfd_ioctl_set_memory_policy()
398 if (args->alternate_policy != KFD_IOC_CACHE_POLICY_COHERENT in kfd_ioctl_set_memory_policy()
399 && args->alternate_policy != KFD_IOC_CACHE_POLICY_NONCOHERENT) { in kfd_ioctl_set_memory_policy()
403 dev = kfd_device_by_id(args->gpu_id); in kfd_ioctl_set_memory_policy()
415 default_policy = (args->default_policy == KFD_IOC_CACHE_POLICY_COHERENT) in kfd_ioctl_set_memory_policy()
419 (args->alternate_policy == KFD_IOC_CACHE_POLICY_COHERENT) in kfd_ioctl_set_memory_policy()
426 (void __user *)args->alternate_aperture_base, in kfd_ioctl_set_memory_policy()
427 args->alternate_aperture_size)) in kfd_ioctl_set_memory_policy()
439 struct kfd_ioctl_dbg_register_args *args = data; in kfd_ioctl_dbg_register() local
446 dev = kfd_device_by_id(args->gpu_id); in kfd_ioctl_dbg_register()
493 struct kfd_ioctl_dbg_unregister_args *args = data; in kfd_ioctl_dbg_unrgesiter() local
497 dev = kfd_device_by_id(args->gpu_id); in kfd_ioctl_dbg_unrgesiter()
531 struct kfd_ioctl_dbg_address_watch_args *args = data; in kfd_ioctl_dbg_address_watch() local
542 dev = kfd_device_by_id(args->gpu_id); in kfd_ioctl_dbg_address_watch()
551 cmd_from_user = (void __user *) args->content_ptr; in kfd_ioctl_dbg_address_watch()
555 if ((args->buf_size_in_bytes > MAX_ALLOWED_AW_BUFF_SIZE) || in kfd_ioctl_dbg_address_watch()
556 (args->buf_size_in_bytes <= sizeof(*args) + sizeof(int) * 2) || in kfd_ioctl_dbg_address_watch()
562 args_buff = kmalloc(args->buf_size_in_bytes - in kfd_ioctl_dbg_address_watch()
563 sizeof(*args), GFP_KERNEL); in kfd_ioctl_dbg_address_watch()
568 args->buf_size_in_bytes - sizeof(*args)); in kfd_ioctl_dbg_address_watch()
593 if (args_idx >= args->buf_size_in_bytes - sizeof(*args)) { in kfd_ioctl_dbg_address_watch()
617 if (args_idx >= args->buf_size_in_bytes - sizeof(args)) { in kfd_ioctl_dbg_address_watch()
640 struct kfd_ioctl_dbg_wave_control_args *args = data; in kfd_ioctl_dbg_wave_control() local
652 computed_buff_size = sizeof(*args) + in kfd_ioctl_dbg_wave_control()
659 dev = kfd_device_by_id(args->gpu_id); in kfd_ioctl_dbg_wave_control()
669 if (args->buf_size_in_bytes != computed_buff_size) { in kfd_ioctl_dbg_wave_control()
671 args->buf_size_in_bytes, computed_buff_size); in kfd_ioctl_dbg_wave_control()
675 cmd_from_user = (void __user *) args->content_ptr; in kfd_ioctl_dbg_wave_control()
682 args_buff = kmalloc(args->buf_size_in_bytes - sizeof(*args), in kfd_ioctl_dbg_wave_control()
690 args->buf_size_in_bytes - sizeof(*args)); in kfd_ioctl_dbg_wave_control()
734 struct kfd_ioctl_get_clock_counters_args *args = data; in kfd_ioctl_get_clock_counters() local
738 dev = kfd_device_by_id(args->gpu_id); in kfd_ioctl_get_clock_counters()
743 args->gpu_clock_counter = in kfd_ioctl_get_clock_counters()
748 args->cpu_clock_counter = (uint64_t)timespec64_to_ns(&time); in kfd_ioctl_get_clock_counters()
751 args->system_clock_counter = (uint64_t)timespec64_to_ns(&time); in kfd_ioctl_get_clock_counters()
754 args->system_clock_freq = 1000000000; in kfd_ioctl_get_clock_counters()
763 struct kfd_ioctl_get_process_apertures_args *args = data; in kfd_ioctl_get_process_apertures() local
769 args->num_of_nodes = 0; in kfd_ioctl_get_process_apertures()
779 &args->process_apertures[args->num_of_nodes]; in kfd_ioctl_get_process_apertures()
789 "node id %u\n", args->num_of_nodes); in kfd_ioctl_get_process_apertures()
805 args->num_of_nodes++; in kfd_ioctl_get_process_apertures()
807 (args->num_of_nodes < NUM_OF_SUPPORTED_GPUS)); in kfd_ioctl_get_process_apertures()
818 struct kfd_ioctl_create_event_args *args = data; in kfd_ioctl_create_event() local
821 err = kfd_event_create(filp, p, args->event_type, in kfd_ioctl_create_event()
822 args->auto_reset != 0, args->node_id, in kfd_ioctl_create_event()
823 &args->event_id, &args->event_trigger_data, in kfd_ioctl_create_event()
824 &args->event_page_offset, in kfd_ioctl_create_event()
825 &args->event_slot_index); in kfd_ioctl_create_event()
833 struct kfd_ioctl_destroy_event_args *args = data; in kfd_ioctl_destroy_event() local
835 return kfd_event_destroy(p, args->event_id); in kfd_ioctl_destroy_event()
841 struct kfd_ioctl_set_event_args *args = data; in kfd_ioctl_set_event() local
843 return kfd_set_event(p, args->event_id); in kfd_ioctl_set_event()
849 struct kfd_ioctl_reset_event_args *args = data; in kfd_ioctl_reset_event() local
851 return kfd_reset_event(p, args->event_id); in kfd_ioctl_reset_event()
857 struct kfd_ioctl_wait_events_args *args = data; in kfd_ioctl_wait_events() local
861 err = kfd_wait_on_events(p, args->num_events, in kfd_ioctl_wait_events()
862 (void __user *)args->events_ptr, in kfd_ioctl_wait_events()
863 (args->wait_for_all != 0), in kfd_ioctl_wait_events()
864 args->timeout, &wait_result); in kfd_ioctl_wait_events()
866 args->wait_result = wait_result; in kfd_ioctl_wait_events()