Lines Matching refs:device

57 static VkResult pvr_ctx_reset_cmd_init(struct pvr_device *device,
60 const struct pvr_device_info *dev_info = &device->pdevice->dev_info;
74 static void pvr_ctx_reset_cmd_fini(struct pvr_device *device,
82 struct pvr_device *device,
88 const struct pvr_device_info *dev_info = &device->pdevice->dev_info;
111 staging_buffer = vk_zalloc(&device->vk.alloc,
116 return vk_error(device, VK_ERROR_OUT_OF_HOST_MEMORY);
135 pvr_gpu_upload_pds(device,
145 vk_free(&device->vk.alloc, staging_buffer);
151 struct pvr_device *device,
157 const struct pvr_device_info *dev_info = &device->pdevice->dev_info;
182 staging_buffer = vk_zalloc(&device->vk.alloc,
187 return vk_error(device, VK_ERROR_OUT_OF_HOST_MEMORY);
208 pvr_gpu_upload_pds(device,
218 vk_free(&device->vk.alloc, staging_buffer);
224 pvr_render_job_pt_programs_setup(struct pvr_device *device,
229 result = pvr_bo_alloc(device,
230 device->heaps.pds_heap,
239 device,
247 device,
257 pvr_bo_free(device, pt_programs->pds_store_program.pvr_bo);
260 pvr_bo_free(device, pt_programs->store_resume_state_bo);
266 pvr_render_job_pt_programs_cleanup(struct pvr_device *device,
269 pvr_bo_free(device, pt_programs->pds_resume_program.pvr_bo);
270 pvr_bo_free(device, pt_programs->pds_store_program.pvr_bo);
271 pvr_bo_free(device, pt_programs->store_resume_state_bo);
307 struct pvr_device *device,
313 const struct pvr_device_info *dev_info = &device->pdevice->dev_info;
349 return pvr_gpu_upload_pds(device,
365 struct pvr_device *device,
372 const struct pvr_device_info *dev_info = &device->pdevice->dev_info;
434 device,
450 static VkResult pvr_ctx_sr_programs_setup(struct pvr_device *device,
457 const struct pvr_device_info *dev_info = &device->pdevice->dev_info;
472 result = pvr_bo_alloc(device,
473 device->heaps.pds_heap,
485 result = pvr_gpu_upload_usc(device,
495 device->heaps.usc_heap->base_addr.addr;
511 result = pvr_gpu_upload_usc(device,
521 device->heaps.usc_heap->base_addr.addr;
533 device,
543 device,
556 device,
567 device,
586 pvr_bo_free(device, sr_programs->pds.store_program.pvr_bo);
589 pvr_bo_free(device, sr_programs->usc.load_program_bo);
592 pvr_bo_free(device, sr_programs->usc.store_program_bo);
595 pvr_bo_free(device, sr_programs->store_load_state_bo);
600 static void pvr_ctx_sr_programs_cleanup(struct pvr_device *device,
603 pvr_bo_free(device, sr_programs->pds.load_program.pvr_bo);
604 pvr_bo_free(device, sr_programs->pds.store_program.pvr_bo);
605 pvr_bo_free(device, sr_programs->usc.load_program_bo);
606 pvr_bo_free(device, sr_programs->usc.store_program_bo);
607 pvr_bo_free(device, sr_programs->store_load_state_bo);
611 pvr_render_ctx_switch_programs_setup(struct pvr_device *device,
616 result = pvr_render_job_pt_programs_setup(device, &programs->pt);
620 result = pvr_ctx_sr_programs_setup(device,
629 pvr_render_job_pt_programs_cleanup(device, &programs->pt);
635 pvr_render_ctx_switch_programs_cleanup(struct pvr_device *device,
638 pvr_ctx_sr_programs_cleanup(device, &programs->sr);
639 pvr_render_job_pt_programs_cleanup(device, &programs->pt);
642 static VkResult pvr_render_ctx_switch_init(struct pvr_device *device,
652 result = pvr_bo_alloc(device,
653 device->heaps.general_heap,
661 result = pvr_bo_alloc(device,
662 device->heaps.general_heap,
672 pvr_render_ctx_switch_programs_setup(device, &ctx_switch->programs[i]);
681 pvr_render_ctx_switch_programs_cleanup(device, &ctx_switch->programs[i]);
684 pvr_bo_free(device, ctx_switch->geom_state_bo);
687 pvr_bo_free(device, ctx_switch->vdm_state_bo);
692 static void pvr_render_ctx_switch_fini(struct pvr_device *device,
698 pvr_render_ctx_switch_programs_cleanup(device, &ctx_switch->programs[i]);
701 pvr_bo_free(device, ctx_switch->geom_state_bo);
702 pvr_bo_free(device, ctx_switch->vdm_state_bo);
844 VkResult pvr_render_ctx_create(struct pvr_device *device,
854 ctx = vk_alloc(&device->vk.alloc,
859 return vk_error(device, VK_ERROR_OUT_OF_HOST_MEMORY);
861 ctx->device = device;
863 result = pvr_bo_alloc(device,
864 device->heaps.general_heap,
872 result = pvr_render_ctx_switch_init(device, ctx);
876 result = pvr_ctx_reset_cmd_init(device, &ctx->reset_cmd);
885 result = device->ws->ops->render_ctx_create(device->ws,
896 pvr_ctx_reset_cmd_fini(device, &ctx->reset_cmd);
899 pvr_render_ctx_switch_fini(device, ctx);
902 pvr_bo_free(device, ctx->vdm_callstack_bo);
905 vk_free(&device->vk.alloc, ctx);
912 struct pvr_device *device = ctx->device;
914 device->ws->ops->render_ctx_destroy(ctx->ws_ctx);
916 pvr_ctx_reset_cmd_fini(device, &ctx->reset_cmd);
917 pvr_render_ctx_switch_fini(device, ctx);
918 pvr_bo_free(device, ctx->vdm_callstack_bo);
919 vk_free(&device->vk.alloc, ctx);
923 struct pvr_device *device,
929 &device->pdevice->dev_runtime_info;
930 ASSERTED const struct pvr_device_info *dev_info = &device->pdevice->dev_info;
944 &device->pdevice->dev_info);
959 &device->pdevice->dev_info);
964 return pvr_gpu_upload_pds(device,
1089 pvr_compute_ctx_ws_static_state_init(&ctx->device->pdevice->dev_info,
1094 VkResult pvr_compute_ctx_create(struct pvr_device *const device,
1102 ctx = vk_alloc(&device->vk.alloc,
1107 return vk_error(device->instance, VK_ERROR_OUT_OF_HOST_MEMORY);
1109 ctx->device = device;
1112 device,
1113 device->heaps.general_heap,
1114 rogue_get_cdm_context_resume_buffer_size(&device->pdevice->dev_info),
1115 rogue_get_cdm_context_resume_buffer_alignment(&device->pdevice->dev_info),
1127 result = pvr_ctx_sr_programs_setup(device,
1132 pvr_ctx_sr_programs_cleanup(device, &ctx->ctx_switch.sr[j]);
1139 device,
1146 result = pvr_ctx_reset_cmd_init(device, &ctx->reset_cmd);
1150 result = device->ws->ops->compute_ctx_create(device->ws,
1161 pvr_ctx_reset_cmd_fini(device, &ctx->reset_cmd);
1164 pvr_bo_free(device, ctx->ctx_switch.sr_fence_terminate_program.pvr_bo);
1168 pvr_ctx_sr_programs_cleanup(device, &ctx->ctx_switch.sr[i]);
1171 pvr_bo_free(device, ctx->ctx_switch.compute_state_bo);
1174 vk_free(&device->vk.alloc, ctx);
1181 struct pvr_device *device = ctx->device;
1183 device->ws->ops->compute_ctx_destroy(ctx->ws_ctx);
1185 pvr_ctx_reset_cmd_fini(device, &ctx->reset_cmd);
1187 pvr_bo_free(device, ctx->ctx_switch.sr_fence_terminate_program.pvr_bo);
1189 pvr_ctx_sr_programs_cleanup(device, &ctx->ctx_switch.sr[i]);
1191 pvr_bo_free(device, ctx->ctx_switch.compute_state_bo);
1193 vk_free(&device->vk.alloc, ctx);
1203 static VkResult pvr_transfer_ctx_setup_shaders(struct pvr_device *device,
1207 rogue_get_slc_cache_line_size(&device->pdevice->dev_info);
1213 result = pvr_gpu_upload_usc(device,
1232 static void pvr_transfer_ctx_fini_shaders(struct pvr_device *device,
1235 pvr_bo_free(device, ctx->usc_eot_bo);
1238 VkResult pvr_transfer_ctx_create(struct pvr_device *const device,
1246 ctx = vk_zalloc(&device->vk.alloc,
1251 return vk_error(device->instance, VK_ERROR_OUT_OF_HOST_MEMORY);
1253 ctx->device = device;
1255 result = pvr_ctx_reset_cmd_init(device, &ctx->reset_cmd);
1261 result = device->ws->ops->transfer_ctx_create(device->ws,
1267 result = pvr_transfer_ctx_setup_shaders(device, ctx);
1278 device,
1299 pvr_bo_free(device, ctx->pds_unitex_code[i][j].pvr_bo);
1303 pvr_transfer_ctx_fini_shaders(device, ctx);
1306 device->ws->ops->transfer_ctx_destroy(ctx->ws_ctx);
1309 pvr_ctx_reset_cmd_fini(device, &ctx->reset_cmd);
1312 vk_free(&device->vk.alloc, ctx);
1319 struct pvr_device *device = ctx->device;
1326 pvr_bo_free(device, ctx->pds_unitex_code[i][j].pvr_bo);
1330 pvr_transfer_ctx_fini_shaders(device, ctx);
1331 device->ws->ops->transfer_ctx_destroy(ctx->ws_ctx);
1332 pvr_ctx_reset_cmd_fini(device, &ctx->reset_cmd);
1333 vk_free(&device->vk.alloc, ctx);