Lines Matching refs:virt
119 struct amdgpu_virt *virt = &adev->virt; in amdgpu_virt_request_full_gpu() local
122 if (virt->ops && virt->ops->req_full_gpu) { in amdgpu_virt_request_full_gpu()
123 r = virt->ops->req_full_gpu(adev, init); in amdgpu_virt_request_full_gpu()
127 adev->virt.caps &= ~AMDGPU_SRIOV_CAPS_RUNTIME; in amdgpu_virt_request_full_gpu()
142 struct amdgpu_virt *virt = &adev->virt; in amdgpu_virt_release_full_gpu() local
145 if (virt->ops && virt->ops->rel_full_gpu) { in amdgpu_virt_release_full_gpu()
146 r = virt->ops->rel_full_gpu(adev, init); in amdgpu_virt_release_full_gpu()
150 adev->virt.caps |= AMDGPU_SRIOV_CAPS_RUNTIME; in amdgpu_virt_release_full_gpu()
163 struct amdgpu_virt *virt = &adev->virt; in amdgpu_virt_reset_gpu() local
166 if (virt->ops && virt->ops->reset_gpu) { in amdgpu_virt_reset_gpu()
167 r = virt->ops->reset_gpu(adev); in amdgpu_virt_reset_gpu()
171 adev->virt.caps &= ~AMDGPU_SRIOV_CAPS_RUNTIME; in amdgpu_virt_reset_gpu()
179 struct amdgpu_virt *virt = &adev->virt; in amdgpu_virt_request_init_data() local
181 if (virt->ops && virt->ops->req_init_data) in amdgpu_virt_request_init_data()
182 virt->ops->req_init_data(adev); in amdgpu_virt_request_init_data()
184 if (adev->virt.req_init_data_ver > 0) in amdgpu_virt_request_init_data()
198 struct amdgpu_virt *virt = &adev->virt; in amdgpu_virt_wait_reset() local
200 if (!virt->ops || !virt->ops->wait_reset) in amdgpu_virt_wait_reset()
203 return virt->ops->wait_reset(adev); in amdgpu_virt_wait_reset()
216 if (!amdgpu_sriov_vf(adev) || adev->virt.mm_table.gpu_addr) in amdgpu_virt_alloc_mm_table()
221 &adev->virt.mm_table.bo, in amdgpu_virt_alloc_mm_table()
222 &adev->virt.mm_table.gpu_addr, in amdgpu_virt_alloc_mm_table()
223 (void *)&adev->virt.mm_table.cpu_addr); in amdgpu_virt_alloc_mm_table()
229 memset((void *)adev->virt.mm_table.cpu_addr, 0, PAGE_SIZE); in amdgpu_virt_alloc_mm_table()
231 adev->virt.mm_table.gpu_addr, in amdgpu_virt_alloc_mm_table()
232 adev->virt.mm_table.cpu_addr); in amdgpu_virt_alloc_mm_table()
243 if (!amdgpu_sriov_vf(adev) || !adev->virt.mm_table.gpu_addr) in amdgpu_virt_free_mm_table()
246 amdgpu_bo_free_kernel(&adev->virt.mm_table.bo, in amdgpu_virt_free_mm_table()
247 &adev->virt.mm_table.gpu_addr, in amdgpu_virt_free_mm_table()
248 (void *)&adev->virt.mm_table.cpu_addr); in amdgpu_virt_free_mm_table()
249 adev->virt.mm_table.gpu_addr = 0; in amdgpu_virt_free_mm_table()
275 struct amdgpu_virt *virt = &adev->virt; in amdgpu_virt_init_ras_err_handler_data() local
276 struct amdgpu_virt_ras_err_handler_data **data = &virt->virt_eh_data; in amdgpu_virt_init_ras_err_handler_data()
303 virt->ras_init_done = true; in amdgpu_virt_init_ras_err_handler_data()
310 struct amdgpu_virt *virt = &adev->virt; in amdgpu_virt_ras_release_bp() local
311 struct amdgpu_virt_ras_err_handler_data *data = virt->virt_eh_data; in amdgpu_virt_ras_release_bp()
328 struct amdgpu_virt *virt = &adev->virt; in amdgpu_virt_release_ras_err_handler_data() local
329 struct amdgpu_virt_ras_err_handler_data *data = virt->virt_eh_data; in amdgpu_virt_release_ras_err_handler_data()
331 virt->ras_init_done = false; in amdgpu_virt_release_ras_err_handler_data()
341 virt->virt_eh_data = NULL; in amdgpu_virt_release_ras_err_handler_data()
347 struct amdgpu_virt *virt = &adev->virt; in amdgpu_virt_ras_add_bps() local
348 struct amdgpu_virt_ras_err_handler_data *data = virt->virt_eh_data; in amdgpu_virt_ras_add_bps()
359 struct amdgpu_virt *virt = &adev->virt; in amdgpu_virt_ras_reserve_bps() local
360 struct amdgpu_virt_ras_err_handler_data *data = virt->virt_eh_data; in amdgpu_virt_ras_reserve_bps()
391 struct amdgpu_virt *virt = &adev->virt; in amdgpu_virt_ras_check_bad_page() local
392 struct amdgpu_virt_ras_err_handler_data *data = virt->virt_eh_data; in amdgpu_virt_ras_check_bad_page()
431 struct amd_sriov_msg_pf2vf_info_header *pf2vf_info = adev->virt.fw_reserve.p_pf2vf; in amdgpu_virt_read_pf2vf_data()
438 if (adev->virt.fw_reserve.p_pf2vf == NULL) in amdgpu_virt_read_pf2vf_data()
450 adev->virt.fw_reserve.p_pf2vf, pf2vf_info->size, in amdgpu_virt_read_pf2vf_data()
451 adev->virt.fw_reserve.checksum_key, checksum); in amdgpu_virt_read_pf2vf_data()
457 adev->virt.gim_feature = in amdgpu_virt_read_pf2vf_data()
464 adev->virt.fw_reserve.p_pf2vf, pf2vf_info->size, in amdgpu_virt_read_pf2vf_data()
471 adev->virt.vf2pf_update_interval_ms = in amdgpu_virt_read_pf2vf_data()
473 adev->virt.gim_feature = in amdgpu_virt_read_pf2vf_data()
475 adev->virt.reg_access = in amdgpu_virt_read_pf2vf_data()
478 adev->virt.decode_max_dimension_pixels = 0; in amdgpu_virt_read_pf2vf_data()
479 adev->virt.decode_max_frame_pixels = 0; in amdgpu_virt_read_pf2vf_data()
480 adev->virt.encode_max_dimension_pixels = 0; in amdgpu_virt_read_pf2vf_data()
481 adev->virt.encode_max_frame_pixels = 0; in amdgpu_virt_read_pf2vf_data()
482 adev->virt.is_mm_bw_enabled = false; in amdgpu_virt_read_pf2vf_data()
485 adev->virt.decode_max_dimension_pixels = max(tmp, adev->virt.decode_max_dimension_pixels); in amdgpu_virt_read_pf2vf_data()
488 adev->virt.decode_max_frame_pixels = max(tmp, adev->virt.decode_max_frame_pixels); in amdgpu_virt_read_pf2vf_data()
491 adev->virt.encode_max_dimension_pixels = max(tmp, adev->virt.encode_max_dimension_pixels); in amdgpu_virt_read_pf2vf_data()
494 adev->virt.encode_max_frame_pixels = max(tmp, adev->virt.encode_max_frame_pixels); in amdgpu_virt_read_pf2vf_data()
496 if((adev->virt.decode_max_dimension_pixels > 0) || (adev->virt.encode_max_dimension_pixels > 0)) in amdgpu_virt_read_pf2vf_data()
497 adev->virt.is_mm_bw_enabled = true; in amdgpu_virt_read_pf2vf_data()
508 if (adev->virt.vf2pf_update_interval_ms < 200 || adev->virt.vf2pf_update_interval_ms > 10000) in amdgpu_virt_read_pf2vf_data()
509 adev->virt.vf2pf_update_interval_ms = 2000; in amdgpu_virt_read_pf2vf_data()
517 vf2pf_info = (struct amd_sriov_msg_vf2pf_info *) adev->virt.fw_reserve.p_vf2pf; in amdgpu_virt_populate_vf2pf_ucode_info()
519 if (adev->virt.fw_reserve.p_vf2pf == NULL) in amdgpu_virt_populate_vf2pf_ucode_info()
553 vf2pf_info = (struct amd_sriov_msg_vf2pf_info *) adev->virt.fw_reserve.p_vf2pf; in amdgpu_virt_write_vf2pf_data()
555 if (adev->virt.fw_reserve.p_vf2pf == NULL) in amdgpu_virt_write_vf2pf_data()
597 struct amdgpu_device *adev = container_of(work, struct amdgpu_device, virt.vf2pf_work.work); in amdgpu_virt_update_vf2pf_work_item()
606 schedule_delayed_work(&(adev->virt.vf2pf_work), adev->virt.vf2pf_update_interval_ms); in amdgpu_virt_update_vf2pf_work_item()
611 if (adev->virt.vf2pf_update_interval_ms != 0) { in amdgpu_virt_fini_data_exchange()
613 cancel_delayed_work_sync(&adev->virt.vf2pf_work); in amdgpu_virt_fini_data_exchange()
614 adev->virt.vf2pf_update_interval_ms = 0; in amdgpu_virt_fini_data_exchange()
624 adev->virt.fw_reserve.p_pf2vf = NULL; in amdgpu_virt_init_data_exchange()
625 adev->virt.fw_reserve.p_vf2pf = NULL; in amdgpu_virt_init_data_exchange()
626 adev->virt.vf2pf_update_interval_ms = 0; in amdgpu_virt_init_data_exchange()
629 adev->virt.vf2pf_update_interval_ms = 2000; in amdgpu_virt_init_data_exchange()
631 adev->virt.fw_reserve.p_pf2vf = in amdgpu_virt_init_data_exchange()
634 adev->virt.fw_reserve.p_vf2pf = in amdgpu_virt_init_data_exchange()
642 if (adev->virt.fw_reserve.p_pf2vf->version == 2) { in amdgpu_virt_init_data_exchange()
643 pf2vf_v2 = (struct amd_sriov_msg_pf2vf_info *)adev->virt.fw_reserve.p_pf2vf; in amdgpu_virt_init_data_exchange()
649 if (bp_block_size && !adev->virt.ras_init_done) in amdgpu_virt_init_data_exchange()
652 if (adev->virt.ras_init_done) in amdgpu_virt_init_data_exchange()
656 adev->virt.fw_reserve.p_pf2vf = in amdgpu_virt_init_data_exchange()
665 if (adev->virt.vf2pf_update_interval_ms != 0) { in amdgpu_virt_init_data_exchange()
666 INIT_DELAYED_WORK(&adev->virt.vf2pf_work, amdgpu_virt_update_vf2pf_work_item); in amdgpu_virt_init_data_exchange()
667 schedule_delayed_work(&(adev->virt.vf2pf_work), adev->virt.vf2pf_update_interval_ms); in amdgpu_virt_init_data_exchange()
695 adev->virt.caps |= AMDGPU_SRIOV_CAPS_IS_VF; in amdgpu_detect_virtualization()
698 adev->virt.caps |= AMDGPU_SRIOV_CAPS_ENABLE_IOV; in amdgpu_detect_virtualization()
702 adev->virt.caps |= AMDGPU_PASSTHROUGH_MODE; in amdgpu_detect_virtualization()
749 adev->virt.caps &= ~AMDGPU_SRIOV_CAPS_RUNTIME; in amdgpu_virt_enable_access_debugfs()
759 adev->virt.caps |= AMDGPU_SRIOV_CAPS_RUNTIME; in amdgpu_virt_disable_access_debugfs()
784 if (!adev->virt.is_mm_bw_enabled) in amdgpu_virt_update_sriov_video_codec()
789 encode[i].max_width = adev->virt.encode_max_dimension_pixels; in amdgpu_virt_update_sriov_video_codec()
790 encode[i].max_pixels_per_frame = adev->virt.encode_max_frame_pixels; in amdgpu_virt_update_sriov_video_codec()
800 decode[i].max_width = adev->virt.decode_max_dimension_pixels; in amdgpu_virt_update_sriov_video_codec()
801 decode[i].max_pixels_per_frame = adev->virt.decode_max_frame_pixels; in amdgpu_virt_update_sriov_video_codec()