PointCloudApplication::PointCloudApplication(int viewport_width, int viewport_height, int video_width, int video_height, pointcloud_video_format video_format, const char* _resource_path, const char* documents_path, const char* device, double ui_scale_factor_) { ui_scale_factor = ui_scale_factor_; video_texture = 0; last_frame_clock = current_time(); stop_opengl = false; pointcloud_create(viewport_width, viewport_height, video_width, video_height, video_format, device, "8dfe1a76-8898-442d-a56b-2ea74bc0cb84"); context = pointcloud_get_context(); resource_path = _resource_path; setup_graphics(); init_lighting(); current_picture_flag = false; mesh_flag = false; demo_flag = false; snapshot_number = 0; }
void main(void) { struct mem_timings *mem; void *entry; int is_resume = (get_wakeup_state() != IS_NOT_WAKEUP); /* Clock must be initialized before console_init, otherwise you may need * to re-initialize serial console drivers again. */ mem = setup_clock(); console_init(); setup_power(is_resume); setup_memory(mem, is_resume); if (is_resume) { wakeup(); } setup_storage(); setup_gpio(); setup_graphics(); /* Set SPI (primary CBFS media) clock to 50MHz and configure pinmux. */ exynos_pinmux_spi1(); clock_set_rate(PERIPH_ID_SPI1, 50000000); cbmem_initialize_empty(); entry = cbfs_load_stage(CBFS_DEFAULT_MEDIA, "fallback/ramstage"); stage_exit(entry); }
int main (int argc, char **argv) { (void) argc; (void) argv; // network int sock; int client; //GRAPHICS VARS Display screen; screen = setup_graphics(); sock = setup_socket(); // ---------------------- // Network update vars and setup struct sockaddr_storage remote_addr; socklen_t addr_size = sizeof(remote_addr); while ( (client = accept(sock, (struct sockaddr *)&remote_addr, &addr_size)) > 0){ on_connect(client, remote_addr, screen); //@todo: method to break here, or catch signals //and end up in code below, closing socket and cleaning up GPU //would need to close threads and clients } close(sock); vc_dispmanx_display_close(screen.display); return 0; }
static void engine_init_draw_frame(struct engine *engine) { if (!engine->init) { if (setup_graphics(engine) < 0) { exit(1); } engine->init = 1; } return; }
void main(void) { struct mem_timings *mem; int is_resume = (get_wakeup_state() != IS_NOT_WAKEUP); timestamp_init(timestamp_get()); timestamp_add_now(TS_START_ROMSTAGE); /* Clock must be initialized before console_init, otherwise you may need * to re-initialize serial console drivers again. */ mem = setup_clock(); console_init(); exception_init(); setup_power(is_resume); timestamp_add_now(TS_BEFORE_INITRAM); setup_memory(mem, is_resume); timestamp_add_now(TS_AFTER_INITRAM); /* This needs to happen on normal boots and on resume. */ trustzone_init(); if (is_resume) { wakeup(); } setup_gpio(); setup_graphics(); /* Set SPI (primary CBFS media) clock to 50MHz and configure pinmux. */ exynos_pinmux_spi1(); clock_set_rate(PERIPH_ID_SPI1, 50000000); cbmem_initialize_empty(); timestamp_add_now(TS_END_ROMSTAGE); run_ramstage(); }
/* * EFI entry point for the arm/arm64 EFI stubs. This is the entrypoint * that is described in the PE/COFF header. Most of the code is the same * for both archictectures, with the arch-specific code provided in the * handle_kernel_image() function. */ unsigned long efi_entry(void *handle, efi_system_table_t *sys_table, unsigned long *image_addr) { efi_loaded_image_t *image; efi_status_t status; unsigned long image_size = 0; unsigned long dram_base; /* addr/point and size pairs for memory management*/ unsigned long initrd_addr; u64 initrd_size = 0; unsigned long fdt_addr = 0; /* Original DTB */ unsigned long fdt_size = 0; char *cmdline_ptr = NULL; int cmdline_size = 0; unsigned long new_fdt_addr; efi_guid_t loaded_image_proto = LOADED_IMAGE_PROTOCOL_GUID; unsigned long reserve_addr = 0; unsigned long reserve_size = 0; int secure_boot = 0; struct screen_info *si; /* Check if we were booted by the EFI firmware */ if (sys_table->hdr.signature != EFI_SYSTEM_TABLE_SIGNATURE) goto fail; pr_efi(sys_table, "Booting Linux Kernel...\n"); status = check_platform_features(sys_table); if (status != EFI_SUCCESS) goto fail; /* * Get a handle to the loaded image protocol. This is used to get * information about the running image, such as size and the command * line. */ status = sys_table->boottime->handle_protocol(handle, &loaded_image_proto, (void *)&image); if (status != EFI_SUCCESS) { pr_efi_err(sys_table, "Failed to get loaded image protocol\n"); goto fail; } dram_base = get_dram_base(sys_table); if (dram_base == EFI_ERROR) { pr_efi_err(sys_table, "Failed to find DRAM base\n"); goto fail; } /* * Get the command line from EFI, using the LOADED_IMAGE * protocol. We are going to copy the command line into the * device tree, so this can be allocated anywhere. */ cmdline_ptr = efi_convert_cmdline(sys_table, image, &cmdline_size); if (!cmdline_ptr) { pr_efi_err(sys_table, "getting command line via LOADED_IMAGE_PROTOCOL\n"); goto fail; } /* check whether 'nokaslr' was passed on the command line */ if (IS_ENABLED(CONFIG_RANDOMIZE_BASE)) { static const u8 default_cmdline[] = CONFIG_CMDLINE; const u8 *str, *cmdline = cmdline_ptr; if (IS_ENABLED(CONFIG_CMDLINE_FORCE)) cmdline = default_cmdline; str = strstr(cmdline, "nokaslr"); if (str == cmdline || (str > cmdline && *(str - 1) == ' ')) __nokaslr = true; } si = setup_graphics(sys_table); status = handle_kernel_image(sys_table, image_addr, &image_size, &reserve_addr, &reserve_size, dram_base, image); if (status != EFI_SUCCESS) { pr_efi_err(sys_table, "Failed to relocate kernel\n"); goto fail_free_cmdline; } status = efi_parse_options(cmdline_ptr); if (status != EFI_SUCCESS) pr_efi_err(sys_table, "Failed to parse EFI cmdline options\n"); secure_boot = efi_get_secureboot(sys_table); if (secure_boot > 0) pr_efi(sys_table, "UEFI Secure Boot is enabled.\n"); if (secure_boot < 0) { pr_efi_err(sys_table, "could not determine UEFI Secure Boot status.\n"); } /* * Unauthenticated device tree data is a security hazard, so * ignore 'dtb=' unless UEFI Secure Boot is disabled. */ if (secure_boot != 0 && strstr(cmdline_ptr, "dtb=")) { pr_efi(sys_table, "Ignoring DTB from command line.\n"); } else { status = handle_cmdline_files(sys_table, image, cmdline_ptr, "dtb=", ~0UL, &fdt_addr, &fdt_size); if (status != EFI_SUCCESS) { pr_efi_err(sys_table, "Failed to load device tree!\n"); goto fail_free_image; } } if (fdt_addr) { pr_efi(sys_table, "Using DTB from command line\n"); } else { /* Look for a device tree configuration table entry. */ fdt_addr = (uintptr_t)get_fdt(sys_table, &fdt_size); if (fdt_addr) pr_efi(sys_table, "Using DTB from configuration table\n"); } if (!fdt_addr) pr_efi(sys_table, "Generating empty DTB\n"); status = handle_cmdline_files(sys_table, image, cmdline_ptr, "initrd=", dram_base + SZ_512M, (unsigned long *)&initrd_addr, (unsigned long *)&initrd_size); if (status != EFI_SUCCESS) pr_efi_err(sys_table, "Failed initrd from command line!\n"); efi_random_get_seed(sys_table); new_fdt_addr = fdt_addr; status = allocate_new_fdt_and_exit_boot(sys_table, handle, &new_fdt_addr, dram_base + MAX_FDT_OFFSET, initrd_addr, initrd_size, cmdline_ptr, fdt_addr, fdt_size); /* * If all went well, we need to return the FDT address to the * calling function so it can be passed to kernel as part of * the kernel boot protocol. */ if (status == EFI_SUCCESS) return new_fdt_addr; pr_efi_err(sys_table, "Failed to update FDT and exit boot services\n"); efi_free(sys_table, initrd_size, initrd_addr); efi_free(sys_table, fdt_size, fdt_addr); fail_free_image: efi_free(sys_table, image_size, *image_addr); efi_free(sys_table, reserve_size, reserve_addr); fail_free_cmdline: free_screen_info(sys_table, si); efi_free(sys_table, cmdline_size, (unsigned long)cmdline_ptr); fail: return EFI_ERROR; }