Lines Matching full:virt

85 	struct amdgpu_virt *virt = &adev->virt;  in amdgpu_virt_request_full_gpu()  local
88 if (virt->ops && virt->ops->req_full_gpu) { in amdgpu_virt_request_full_gpu()
89 r = virt->ops->req_full_gpu(adev, init); in amdgpu_virt_request_full_gpu()
95 adev->virt.caps &= ~AMDGPU_SRIOV_CAPS_RUNTIME; in amdgpu_virt_request_full_gpu()
110 struct amdgpu_virt *virt = &adev->virt; in amdgpu_virt_release_full_gpu() local
113 if (virt->ops && virt->ops->rel_full_gpu) { in amdgpu_virt_release_full_gpu()
114 r = virt->ops->rel_full_gpu(adev, init); in amdgpu_virt_release_full_gpu()
118 adev->virt.caps |= AMDGPU_SRIOV_CAPS_RUNTIME; in amdgpu_virt_release_full_gpu()
131 struct amdgpu_virt *virt = &adev->virt; in amdgpu_virt_reset_gpu() local
134 if (virt->ops && virt->ops->reset_gpu) { in amdgpu_virt_reset_gpu()
135 r = virt->ops->reset_gpu(adev); in amdgpu_virt_reset_gpu()
139 adev->virt.caps &= ~AMDGPU_SRIOV_CAPS_RUNTIME; in amdgpu_virt_reset_gpu()
147 struct amdgpu_virt *virt = &adev->virt; in amdgpu_virt_request_init_data() local
149 if (virt->ops && virt->ops->req_init_data) in amdgpu_virt_request_init_data()
150 virt->ops->req_init_data(adev); in amdgpu_virt_request_init_data()
152 if (adev->virt.req_init_data_ver > 0) in amdgpu_virt_request_init_data()
166 struct amdgpu_virt *virt = &adev->virt; in amdgpu_virt_ready_to_reset() local
168 if (virt->ops && virt->ops->reset_gpu) in amdgpu_virt_ready_to_reset()
169 virt->ops->ready_to_reset(adev); in amdgpu_virt_ready_to_reset()
180 struct amdgpu_virt *virt = &adev->virt; in amdgpu_virt_wait_reset() local
182 if (!virt->ops || !virt->ops->wait_reset) in amdgpu_virt_wait_reset()
185 return virt->ops->wait_reset(adev); in amdgpu_virt_wait_reset()
198 if (!amdgpu_sriov_vf(adev) || adev->virt.mm_table.gpu_addr) in amdgpu_virt_alloc_mm_table()
204 &adev->virt.mm_table.bo, in amdgpu_virt_alloc_mm_table()
205 &adev->virt.mm_table.gpu_addr, in amdgpu_virt_alloc_mm_table()
206 (void *)&adev->virt.mm_table.cpu_addr); in amdgpu_virt_alloc_mm_table()
212 memset((void *)adev->virt.mm_table.cpu_addr, 0, PAGE_SIZE); in amdgpu_virt_alloc_mm_table()
214 adev->virt.mm_table.gpu_addr, in amdgpu_virt_alloc_mm_table()
215 adev->virt.mm_table.cpu_addr); in amdgpu_virt_alloc_mm_table()
226 if (!amdgpu_sriov_vf(adev) || !adev->virt.mm_table.gpu_addr) in amdgpu_virt_free_mm_table()
229 amdgpu_bo_free_kernel(&adev->virt.mm_table.bo, in amdgpu_virt_free_mm_table()
230 &adev->virt.mm_table.gpu_addr, in amdgpu_virt_free_mm_table()
231 (void *)&adev->virt.mm_table.cpu_addr); in amdgpu_virt_free_mm_table()
232 adev->virt.mm_table.gpu_addr = 0; in amdgpu_virt_free_mm_table()
243 struct amdgpu_virt *virt = &adev->virt; in amdgpu_virt_rcvd_ras_interrupt() local
245 if (!virt->ops || !virt->ops->rcvd_ras_intr) in amdgpu_virt_rcvd_ras_interrupt()
248 return virt->ops->rcvd_ras_intr(adev); in amdgpu_virt_rcvd_ras_interrupt()
274 struct amdgpu_virt *virt = &adev->virt; in amdgpu_virt_init_ras_err_handler_data() local
275 struct amdgpu_virt_ras_err_handler_data **data = &virt->virt_eh_data; in amdgpu_virt_init_ras_err_handler_data()
300 virt->ras_init_done = true; in amdgpu_virt_init_ras_err_handler_data()
314 struct amdgpu_virt *virt = &adev->virt; in amdgpu_virt_ras_release_bp() local
315 struct amdgpu_virt_ras_err_handler_data *data = virt->virt_eh_data; in amdgpu_virt_ras_release_bp()
334 struct amdgpu_virt *virt = &adev->virt; in amdgpu_virt_release_ras_err_handler_data() local
335 struct amdgpu_virt_ras_err_handler_data *data = virt->virt_eh_data; in amdgpu_virt_release_ras_err_handler_data()
337 virt->ras_init_done = false; in amdgpu_virt_release_ras_err_handler_data()
347 virt->virt_eh_data = NULL; in amdgpu_virt_release_ras_err_handler_data()
353 struct amdgpu_virt *virt = &adev->virt; in amdgpu_virt_ras_add_bps() local
354 struct amdgpu_virt_ras_err_handler_data *data = virt->virt_eh_data; in amdgpu_virt_ras_add_bps()
365 struct amdgpu_virt *virt = &adev->virt; in amdgpu_virt_ras_reserve_bps() local
366 struct amdgpu_virt_ras_err_handler_data *data = virt->virt_eh_data; in amdgpu_virt_ras_reserve_bps()
404 struct amdgpu_virt *virt = &adev->virt; in amdgpu_virt_ras_check_bad_page() local
405 struct amdgpu_virt_ras_err_handler_data *data = virt->virt_eh_data; in amdgpu_virt_ras_check_bad_page()
452 struct amd_sriov_msg_pf2vf_info_header *pf2vf_info = adev->virt.fw_reserve.p_pf2vf; in amdgpu_virt_read_pf2vf_data()
459 if (adev->virt.fw_reserve.p_pf2vf == NULL) in amdgpu_virt_read_pf2vf_data()
471 adev->virt.fw_reserve.p_pf2vf, pf2vf_info->size, in amdgpu_virt_read_pf2vf_data()
472 adev->virt.fw_reserve.checksum_key, checksum); in amdgpu_virt_read_pf2vf_data()
480 adev->virt.gim_feature = in amdgpu_virt_read_pf2vf_data()
487 adev->virt.fw_reserve.p_pf2vf, pf2vf_info->size, in amdgpu_virt_read_pf2vf_data()
496 adev->virt.vf2pf_update_interval_ms = in amdgpu_virt_read_pf2vf_data()
498 adev->virt.gim_feature = in amdgpu_virt_read_pf2vf_data()
500 adev->virt.reg_access = in amdgpu_virt_read_pf2vf_data()
503 adev->virt.decode_max_dimension_pixels = 0; in amdgpu_virt_read_pf2vf_data()
504 adev->virt.decode_max_frame_pixels = 0; in amdgpu_virt_read_pf2vf_data()
505 adev->virt.encode_max_dimension_pixels = 0; in amdgpu_virt_read_pf2vf_data()
506 adev->virt.encode_max_frame_pixels = 0; in amdgpu_virt_read_pf2vf_data()
507 adev->virt.is_mm_bw_enabled = false; in amdgpu_virt_read_pf2vf_data()
510 adev->virt.decode_max_dimension_pixels = max(tmp, adev->virt.decode_max_dimension_pixels); in amdgpu_virt_read_pf2vf_data()
513 adev->virt.decode_max_frame_pixels = max(tmp, adev->virt.decode_max_frame_pixels); in amdgpu_virt_read_pf2vf_data()
516 adev->virt.encode_max_dimension_pixels = max(tmp, adev->virt.encode_max_dimension_pixels); in amdgpu_virt_read_pf2vf_data()
519 adev->virt.encode_max_frame_pixels = max(tmp, adev->virt.encode_max_frame_pixels); in amdgpu_virt_read_pf2vf_data()
521 if ((adev->virt.decode_max_dimension_pixels > 0) || (adev->virt.encode_max_dimension_pixels > 0)) in amdgpu_virt_read_pf2vf_data()
522 adev->virt.is_mm_bw_enabled = true; in amdgpu_virt_read_pf2vf_data()
533 if (adev->virt.vf2pf_update_interval_ms < 200 || adev->virt.vf2pf_update_interval_ms > 10000) in amdgpu_virt_read_pf2vf_data()
534 adev->virt.vf2pf_update_interval_ms = 2000; in amdgpu_virt_read_pf2vf_data()
542 vf2pf_info = (struct amd_sriov_msg_vf2pf_info *) adev->virt.fw_reserve.p_vf2pf; in amdgpu_virt_populate_vf2pf_ucode_info()
544 if (adev->virt.fw_reserve.p_vf2pf == NULL) in amdgpu_virt_populate_vf2pf_ucode_info()
577 vf2pf_info = (struct amd_sriov_msg_vf2pf_info *) adev->virt.fw_reserve.p_vf2pf; in amdgpu_virt_write_vf2pf_data()
579 if (adev->virt.fw_reserve.p_vf2pf == NULL) in amdgpu_virt_write_vf2pf_data()
628 struct amdgpu_device *adev = container_of(work, struct amdgpu_device, virt.vf2pf_work.work); in amdgpu_virt_update_vf2pf_work_item()
633 adev->virt.vf2pf_update_retry_cnt++; in amdgpu_virt_update_vf2pf_work_item()
636 adev->virt.vf2pf_update_retry_cnt >= AMDGPU_VF2PF_UPDATE_MAX_RETRY_LIMIT) && in amdgpu_virt_update_vf2pf_work_item()
650 adev->virt.vf2pf_update_retry_cnt = 0; in amdgpu_virt_update_vf2pf_work_item()
654 schedule_delayed_work(&(adev->virt.vf2pf_work), adev->virt.vf2pf_update_interval_ms); in amdgpu_virt_update_vf2pf_work_item()
659 if (adev->virt.vf2pf_update_interval_ms != 0) { in amdgpu_virt_fini_data_exchange()
661 cancel_delayed_work_sync(&adev->virt.vf2pf_work); in amdgpu_virt_fini_data_exchange()
662 adev->virt.vf2pf_update_interval_ms = 0; in amdgpu_virt_fini_data_exchange()
668 adev->virt.fw_reserve.p_pf2vf = NULL; in amdgpu_virt_init_data_exchange()
669 adev->virt.fw_reserve.p_vf2pf = NULL; in amdgpu_virt_init_data_exchange()
670 adev->virt.vf2pf_update_interval_ms = 0; in amdgpu_virt_init_data_exchange()
671 adev->virt.vf2pf_update_retry_cnt = 0; in amdgpu_virt_init_data_exchange()
679 INIT_DELAYED_WORK(&adev->virt.vf2pf_work, amdgpu_virt_update_vf2pf_work_item); in amdgpu_virt_init_data_exchange()
680 …schedule_delayed_work(&(adev->virt.vf2pf_work), msecs_to_jiffies(adev->virt.vf2pf_update_interval_… in amdgpu_virt_init_data_exchange()
683 adev->virt.fw_reserve.p_pf2vf = in amdgpu_virt_init_data_exchange()
700 adev->virt.fw_reserve.p_pf2vf = in amdgpu_virt_exchange_data()
703 adev->virt.fw_reserve.p_vf2pf = in amdgpu_virt_exchange_data()
707 adev->virt.fw_reserve.p_pf2vf = in amdgpu_virt_exchange_data()
710 adev->virt.fw_reserve.p_vf2pf = in amdgpu_virt_exchange_data()
719 if (adev->virt.fw_reserve.p_pf2vf->version == 2) { in amdgpu_virt_exchange_data()
720 pf2vf_v2 = (struct amd_sriov_msg_pf2vf_info *)adev->virt.fw_reserve.p_pf2vf; in amdgpu_virt_exchange_data()
726 if (bp_block_size && !adev->virt.ras_init_done) in amdgpu_virt_exchange_data()
729 if (adev->virt.ras_init_done) in amdgpu_virt_exchange_data()
760 adev->virt.caps |= AMDGPU_SRIOV_CAPS_IS_VF; in amdgpu_detect_virtualization()
763 adev->virt.caps |= AMDGPU_SRIOV_CAPS_ENABLE_IOV; in amdgpu_detect_virtualization()
768 adev->virt.caps |= AMDGPU_PASSTHROUGH_MODE; in amdgpu_detect_virtualization()
824 adev->virt.caps &= ~AMDGPU_SRIOV_CAPS_RUNTIME; in amdgpu_virt_enable_access_debugfs()
834 adev->virt.caps |= AMDGPU_SRIOV_CAPS_RUNTIME; in amdgpu_virt_disable_access_debugfs()
943 if (!adev->virt.is_mm_bw_enabled) in amdgpu_virt_update_sriov_video_codec()
948 encode[i].max_width = adev->virt.encode_max_dimension_pixels; in amdgpu_virt_update_sriov_video_codec()
949 encode[i].max_pixels_per_frame = adev->virt.encode_max_frame_pixels; in amdgpu_virt_update_sriov_video_codec()
959 decode[i].max_width = adev->virt.decode_max_dimension_pixels; in amdgpu_virt_update_sriov_video_codec()
960 decode[i].max_pixels_per_frame = adev->virt.decode_max_frame_pixels; in amdgpu_virt_update_sriov_video_codec()
1034 mutex_lock(&adev->virt.rlcg_reg_lock); in amdgpu_virt_rlcg_reg_rw()
1093 mutex_unlock(&adev->virt.rlcg_reg_lock); in amdgpu_virt_rlcg_reg_rw()