Commit 53bdbf88 authored by Alyssa Rosenzweig's avatar Alyssa Rosenzweig 💜

...

parent 6fa5b6a0
......@@ -239,21 +239,19 @@ trans_setup_hardware(struct panfrost_context *ctx)
uint32_t *framebuffer;
posix_memalign((void **) &framebuffer, CACHE_LINE_SIZE, 4096*4096*4);
slowfb_init((uint8_t*) (framebuffer + 144), 400, 320);
slowfb_init((uint8_t*) (framebuffer + 144), ctx->width, ctx->height);
struct mali_mem_import_user_buffer framebuffer_handle = { .ptr = (uint64_t) (uintptr_t) framebuffer, .length = 4096*4096*4 };
struct mali_ioctl_mem_import mem_import_16 = {
struct mali_ioctl_mem_import framebuffer_import = {
.phandle = (uint64_t) (uintptr_t) &framebuffer_handle,
.type = MALI_MEM_IMPORT_TYPE_USER_BUFFER,
.flags = MALI_MEM_PROT_CPU_RD | MALI_MEM_PROT_CPU_WR | MALI_MEM_PROT_GPU_RD | MALI_MEM_PROT_GPU_WR,
};
rc = pandev_ioctl(fd, MALI_IOCTL_MEM_IMPORT, &mem_import_16);
rc = pandev_ioctl(fd, MALI_IOCTL_MEM_IMPORT, &framebuffer_import);
if (rc) printf("Error %d in MEM_IMPORT_16\n", rc);
uint64_t framebuffer_va = mem_import_16.gpu_va;
u64 alloc_gpu_va_18;
pandev_standard_allocate(fd, 126, MALI_MEM_PROT_CPU_RD | MALI_MEM_PROT_CPU_WR | MALI_MEM_PROT_GPU_RD | MALI_MEM_PROT_GPU_WR, &alloc_gpu_va_18);
......@@ -286,5 +284,5 @@ trans_setup_hardware(struct panfrost_context *ctx)
ctx->varyings.gpu = alloc_gpu_va_20;
ctx->framebuffer.cpu = framebuffer;
ctx->framebuffer.gpu = framebuffer_va;
ctx->framebuffer.gpu = framebuffer_import.gpu_va;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment