Lines Matching refs:fpriv

1217 	struct amdgpu_fpriv *fpriv;  in amdgpu_driver_open_kms()  local
1235 fpriv = kzalloc(sizeof(*fpriv), GFP_KERNEL); in amdgpu_driver_open_kms()
1236 if (unlikely(!fpriv)) { in amdgpu_driver_open_kms()
1247 r = amdgpu_xcp_open_device(adev, fpriv, file_priv); in amdgpu_driver_open_kms()
1251 r = amdgpu_vm_init(adev, &fpriv->vm, fpriv->xcp_id); in amdgpu_driver_open_kms()
1255 r = amdgpu_vm_set_pasid(adev, &fpriv->vm, pasid); in amdgpu_driver_open_kms()
1259 fpriv->prt_va = amdgpu_vm_bo_add(adev, &fpriv->vm, NULL); in amdgpu_driver_open_kms()
1260 if (!fpriv->prt_va) { in amdgpu_driver_open_kms()
1268 r = amdgpu_map_static_csa(adev, &fpriv->vm, adev->virt.csa_obj, in amdgpu_driver_open_kms()
1269 &fpriv->csa_va, csa_addr, AMDGPU_CSA_SIZE); in amdgpu_driver_open_kms()
1274 mutex_init(&fpriv->bo_list_lock); in amdgpu_driver_open_kms()
1275 idr_init_base(&fpriv->bo_list_handles, 1); in amdgpu_driver_open_kms()
1277 amdgpu_ctx_mgr_init(&fpriv->ctx_mgr, adev); in amdgpu_driver_open_kms()
1279 file_priv->driver_priv = fpriv; in amdgpu_driver_open_kms()
1283 amdgpu_vm_fini(adev, &fpriv->vm); in amdgpu_driver_open_kms()
1288 amdgpu_vm_set_pasid(adev, &fpriv->vm, 0); in amdgpu_driver_open_kms()
1291 kfree(fpriv); in amdgpu_driver_open_kms()
1313 struct amdgpu_fpriv *fpriv = file_priv->driver_priv; in amdgpu_driver_postclose_kms() local
1319 if (!fpriv) in amdgpu_driver_postclose_kms()
1329 if (fpriv->csa_va) { in amdgpu_driver_postclose_kms()
1332 WARN_ON(amdgpu_unmap_static_csa(adev, &fpriv->vm, adev->virt.csa_obj, in amdgpu_driver_postclose_kms()
1333 fpriv->csa_va, csa_addr)); in amdgpu_driver_postclose_kms()
1334 fpriv->csa_va = NULL; in amdgpu_driver_postclose_kms()
1337 pasid = fpriv->vm.pasid; in amdgpu_driver_postclose_kms()
1338 pd = amdgpu_bo_ref(fpriv->vm.root.bo); in amdgpu_driver_postclose_kms()
1340 amdgpu_vm_bo_del(adev, fpriv->prt_va); in amdgpu_driver_postclose_kms()
1344 amdgpu_ctx_mgr_fini(&fpriv->ctx_mgr); in amdgpu_driver_postclose_kms()
1345 amdgpu_vm_fini(adev, &fpriv->vm); in amdgpu_driver_postclose_kms()
1351 idr_for_each_entry(&fpriv->bo_list_handles, list, handle) in amdgpu_driver_postclose_kms()
1354 idr_destroy(&fpriv->bo_list_handles); in amdgpu_driver_postclose_kms()
1355 mutex_destroy(&fpriv->bo_list_lock); in amdgpu_driver_postclose_kms()
1357 kfree(fpriv); in amdgpu_driver_postclose_kms()