Lines Matching refs:section

410 					struct panthor_fw_section *section)  in panthor_fw_init_section_mem()  argument
412 bool was_mapped = !!section->mem->kmap; in panthor_fw_init_section_mem()
415 if (!section->data.size && in panthor_fw_init_section_mem()
416 !(section->flags & CSF_FW_BINARY_IFACE_ENTRY_RD_ZERO)) in panthor_fw_init_section_mem()
419 ret = panthor_kernel_bo_vmap(section->mem); in panthor_fw_init_section_mem()
423 memcpy(section->mem->kmap, section->data.buf, section->data.size); in panthor_fw_init_section_mem()
424 if (section->flags & CSF_FW_BINARY_IFACE_ENTRY_RD_ZERO) { in panthor_fw_init_section_mem()
425 memset(section->mem->kmap + section->data.size, 0, in panthor_fw_init_section_mem()
426 panthor_kernel_bo_size(section->mem) - section->data.size); in panthor_fw_init_section_mem()
430 panthor_kernel_bo_vunmap(section->mem); in panthor_fw_init_section_mem()
505 struct panthor_fw_section *section; in panthor_fw_load_section_entry() local
559 section = drmm_kzalloc(&ptdev->base, sizeof(*section), GFP_KERNEL); in panthor_fw_load_section_entry()
560 if (!section) in panthor_fw_load_section_entry()
563 list_add_tail(&section->node, &ptdev->fw->sections); in panthor_fw_load_section_entry()
564 section->flags = hdr.flags; in panthor_fw_load_section_entry()
565 section->data.size = hdr.data.end - hdr.data.start; in panthor_fw_load_section_entry()
567 if (section->data.size > 0) { in panthor_fw_load_section_entry()
568 void *data = drmm_kmalloc(&ptdev->base, section->data.size, GFP_KERNEL); in panthor_fw_load_section_entry()
573 memcpy(data, fw->data + hdr.data.start, section->data.size); in panthor_fw_load_section_entry()
574 section->data.buf = data; in panthor_fw_load_section_entry()
585 section->name = name; in panthor_fw_load_section_entry()
612 section->mem = panthor_kernel_bo_create(ptdev, panthor_fw_vm(ptdev), in panthor_fw_load_section_entry()
616 if (IS_ERR(section->mem)) in panthor_fw_load_section_entry()
617 return PTR_ERR(section->mem); in panthor_fw_load_section_entry()
619 if (drm_WARN_ON(&ptdev->base, section->mem->va_node.start != hdr.va.start)) in panthor_fw_load_section_entry()
622 if (section->flags & CSF_FW_BINARY_IFACE_ENTRY_RD_SHARED) { in panthor_fw_load_section_entry()
623 ret = panthor_kernel_bo_vmap(section->mem); in panthor_fw_load_section_entry()
628 panthor_fw_init_section_mem(ptdev, section); in panthor_fw_load_section_entry()
630 bo = to_panthor_bo(section->mem->obj); in panthor_fw_load_section_entry()
639 ptdev->fw->shared_section = section; in panthor_fw_load_section_entry()
687 struct panthor_fw_section *section; in panthor_reload_fw_sections() local
689 list_for_each_entry(section, &ptdev->fw->sections, node) { in panthor_reload_fw_sections()
692 if (!full_reload && !(section->flags & CSF_FW_BINARY_IFACE_ENTRY_RD_WR)) in panthor_reload_fw_sections()
695 panthor_fw_init_section_mem(ptdev, section); in panthor_reload_fw_sections()
696 sgt = drm_gem_shmem_get_pages_sgt(&to_panthor_bo(section->mem->obj)->base); in panthor_reload_fw_sections()
1187 struct panthor_fw_section *section; in panthor_fw_unplug() local
1197 list_for_each_entry(section, &ptdev->fw->sections, node) in panthor_fw_unplug()
1198 panthor_kernel_bo_destroy(section->mem); in panthor_fw_unplug()