Lines Matching refs:section

397 					struct panthor_fw_section *section)  in panthor_fw_init_section_mem()  argument
399 bool was_mapped = !!section->mem->kmap; in panthor_fw_init_section_mem()
402 if (!section->data.size && in panthor_fw_init_section_mem()
403 !(section->flags & CSF_FW_BINARY_IFACE_ENTRY_RD_ZERO)) in panthor_fw_init_section_mem()
406 ret = panthor_kernel_bo_vmap(section->mem); in panthor_fw_init_section_mem()
410 memcpy(section->mem->kmap, section->data.buf, section->data.size); in panthor_fw_init_section_mem()
411 if (section->flags & CSF_FW_BINARY_IFACE_ENTRY_RD_ZERO) { in panthor_fw_init_section_mem()
412 memset(section->mem->kmap + section->data.size, 0, in panthor_fw_init_section_mem()
413 panthor_kernel_bo_size(section->mem) - section->data.size); in panthor_fw_init_section_mem()
417 panthor_kernel_bo_vunmap(section->mem); in panthor_fw_init_section_mem()
492 struct panthor_fw_section *section; in panthor_fw_load_section_entry() local
546 section = drmm_kzalloc(&ptdev->base, sizeof(*section), GFP_KERNEL); in panthor_fw_load_section_entry()
547 if (!section) in panthor_fw_load_section_entry()
550 list_add_tail(&section->node, &ptdev->fw->sections); in panthor_fw_load_section_entry()
551 section->flags = hdr.flags; in panthor_fw_load_section_entry()
552 section->data.size = hdr.data.end - hdr.data.start; in panthor_fw_load_section_entry()
554 if (section->data.size > 0) { in panthor_fw_load_section_entry()
555 void *data = drmm_kmalloc(&ptdev->base, section->data.size, GFP_KERNEL); in panthor_fw_load_section_entry()
560 memcpy(data, fw->data + hdr.data.start, section->data.size); in panthor_fw_load_section_entry()
561 section->data.buf = data; in panthor_fw_load_section_entry()
572 section->name = name; in panthor_fw_load_section_entry()
599 section->mem = panthor_kernel_bo_create(ptdev, panthor_fw_vm(ptdev), in panthor_fw_load_section_entry()
603 if (IS_ERR(section->mem)) in panthor_fw_load_section_entry()
604 return PTR_ERR(section->mem); in panthor_fw_load_section_entry()
606 if (drm_WARN_ON(&ptdev->base, section->mem->va_node.start != hdr.va.start)) in panthor_fw_load_section_entry()
609 if (section->flags & CSF_FW_BINARY_IFACE_ENTRY_RD_SHARED) { in panthor_fw_load_section_entry()
610 ret = panthor_kernel_bo_vmap(section->mem); in panthor_fw_load_section_entry()
615 panthor_fw_init_section_mem(ptdev, section); in panthor_fw_load_section_entry()
617 bo = to_panthor_bo(section->mem->obj); in panthor_fw_load_section_entry()
626 ptdev->fw->shared_section = section; in panthor_fw_load_section_entry()
634 struct panthor_fw_section *section; in panthor_reload_fw_sections() local
636 list_for_each_entry(section, &ptdev->fw->sections, node) { in panthor_reload_fw_sections()
639 if (!full_reload && !(section->flags & CSF_FW_BINARY_IFACE_ENTRY_RD_WR)) in panthor_reload_fw_sections()
642 panthor_fw_init_section_mem(ptdev, section); in panthor_reload_fw_sections()
643 sgt = drm_gem_shmem_get_pages_sgt(&to_panthor_bo(section->mem->obj)->base); in panthor_reload_fw_sections()
1132 struct panthor_fw_section *section; in panthor_fw_unplug() local
1142 list_for_each_entry(section, &ptdev->fw->sections, node) in panthor_fw_unplug()
1143 panthor_kernel_bo_destroy(section->mem); in panthor_fw_unplug()