From a5fb67e76835ddc47d2689f77cc2c5d66093f1e0 Mon Sep 17 00:00:00 2001 From: Stanislav Vorobiov Date: Thu, 28 Nov 2013 14:49:48 +0400 Subject: [PATCH] YaGL/VIGS: Implemented multicore rendering and fences We now use multicore rendering, i.e. we offload all rendering to a separate thread and use fences to wait until certain parts of it are complete Change-Id: I9e3f31d07d0a7e575e73996d7762f3a0300ca83d --- hw/Makefile.objs | 1 + hw/vigs/Makefile.objs | 1 + hw/vigs/vigs_comm.c | 273 +++--- hw/vigs/vigs_comm.h | 41 +- hw/vigs/vigs_device.c | 94 +- hw/vigs/vigs_fenceman.c | 185 ++++ hw/vigs/vigs_fenceman.h | 68 ++ hw/vigs/vigs_protocol.h | 61 +- hw/vigs/vigs_regs.h | 5 +- hw/vigs/vigs_server.c | 450 ++++++---- hw/vigs/vigs_server.h | 32 +- hw/winsys.h | 3 + hw/work_queue.c | 107 +++ hw/work_queue.h | 45 + hw/yagl/yagl_apis/egl/yagl_egl_calls.c | 168 +--- hw/yagl/yagl_apis/egl/yagl_host_egl_calls.c | 44 +- hw/yagl/yagl_apis/egl/yagl_host_egl_calls.h | 10 +- hw/yagl/yagl_apis/gles/yagl_gles_calls.c | 964 ++++++--------------- .../egl_offscreen/yagl_egl_offscreen_surface.c | 12 +- .../egl_onscreen/yagl_egl_onscreen_surface.c | 8 +- hw/yagl/yagl_compiled_transfer.c | 86 +- hw/yagl/yagl_compiled_transfer.h | 12 +- hw/yagl/yagl_device.c | 21 +- hw/yagl/yagl_eglb_surface.h | 4 +- hw/yagl/yagl_mem.c | 98 +-- hw/yagl/yagl_mem.h | 24 +- hw/yagl/yagl_server.c | 36 +- hw/yagl/yagl_server.h | 16 +- hw/yagl/yagl_thread.c | 195 +++-- hw/yagl/yagl_thread.h | 8 +- hw/yagl/yagl_transport.c | 287 +++--- hw/yagl/yagl_transport.h | 87 +- hw/yagl/yagl_types.h | 2 +- hw/yagl/yagl_version.h | 2 +- tizen/src/hw/maru_board.c | 8 + 35 files changed, 1786 insertions(+), 1672 deletions(-) create mode 100644 hw/vigs/vigs_fenceman.c create mode 100644 hw/vigs/vigs_fenceman.h create mode 100644 hw/work_queue.c create mode 100644 hw/work_queue.h diff --git a/hw/Makefile.objs b/hw/Makefile.objs index d5735d7..d211da4 100644 --- a/hw/Makefile.objs +++ b/hw/Makefile.objs @@ -33,3 +33,4 @@ devices-dirs-$(CONFIG_BUILD_VIGS) += vigs/ devices-dirs-y += core/ common-obj-y += $(devices-dirs-y) obj-y += $(devices-dirs-y) +obj-y += work_queue.o diff --git a/hw/vigs/Makefile.objs b/hw/vigs/Makefile.objs index c434eed..b227b1c 100644 --- a/hw/vigs/Makefile.objs +++ b/hw/vigs/Makefile.objs @@ -10,6 +10,7 @@ obj-y += vigs_surface.o obj-y += vigs_utils.o obj-y += vigs_vector.o obj-y += vigs_ref.o +obj-y += vigs_fenceman.o obj-y += vigs_gl_backend.o obj-y += vigs_sw_backend.o # GL GLX backend diff --git a/hw/vigs/vigs_comm.c b/hw/vigs/vigs_comm.c index 06f1a70..54577fe 100644 --- a/hw/vigs/vigs_comm.c +++ b/hw/vigs/vigs_comm.c @@ -35,49 +35,57 @@ * @{ */ -static vigsp_status vigs_comm_dispatch_init(struct vigs_comm *comm, - struct vigsp_cmd_init_request *request, - struct vigsp_cmd_init_response *response) +static void vigs_comm_dispatch_init(struct vigs_comm_ops *ops, + void *user_data, + struct vigsp_cmd_init_request *request) { - response->server_version = VIGS_PROTOCOL_VERSION; + request->server_version = VIGS_PROTOCOL_VERSION; if (request->client_version != VIGS_PROTOCOL_VERSION) { VIGS_LOG_CRITICAL("protocol version mismatch, expected %u, actual %u", VIGS_PROTOCOL_VERSION, request->client_version); - return vigsp_status_success; + return; } VIGS_LOG_TRACE("client_version = %d", request->client_version); - if (comm->comm_ops->init(comm->user_data)) { - return vigsp_status_success; - } else { - return vigsp_status_exec_error; - } + ops->init(user_data); } -static vigsp_status vigs_comm_dispatch_reset(struct vigs_comm *comm, - void *response) +static void vigs_comm_dispatch_reset(struct vigs_comm_ops *ops, + void *user_data) { VIGS_LOG_TRACE("enter"); - comm->comm_ops->reset(comm->user_data); - - return vigsp_status_success; + ops->reset(user_data); } -static vigsp_status vigs_comm_dispatch_exit(struct vigs_comm *comm, - void *response) +static void vigs_comm_dispatch_exit(struct vigs_comm_ops *ops, + void *user_data) { VIGS_LOG_TRACE("enter"); - comm->comm_ops->exit(comm->user_data); + ops->exit(user_data); +} + +static void vigs_comm_dispatch_set_root_surface(struct vigs_comm_ops *ops, + void *user_data, + struct vigsp_cmd_set_root_surface_request *request, + vigsp_fence_seq fence_seq) +{ + VIGS_LOG_TRACE("id = %u, offset = %u", + request->id, + request->offset); - return vigsp_status_success; + ops->set_root_surface(user_data, + request->id, + request->offset, + fence_seq); } -static void vigs_comm_dispatch_create_surface(struct vigs_comm *comm, +static void vigs_comm_dispatch_create_surface(struct vigs_comm_batch_ops *ops, + void *user_data, struct vigsp_cmd_create_surface_request *request) { switch (request->format) { @@ -96,35 +104,25 @@ static void vigs_comm_dispatch_create_surface(struct vigs_comm *comm, request->format, request->id); - comm->comm_ops->create_surface(comm->user_data, - request->width, - request->height, - request->stride, - request->format, - request->id); + ops->create_surface(user_data, + request->width, + request->height, + request->stride, + request->format, + request->id); } -static void vigs_comm_dispatch_destroy_surface(struct vigs_comm *comm, +static void vigs_comm_dispatch_destroy_surface(struct vigs_comm_batch_ops *ops, + void *user_data, struct vigsp_cmd_destroy_surface_request *request) { VIGS_LOG_TRACE("id = %u", request->id); - comm->comm_ops->destroy_surface(comm->user_data, request->id); -} - -static void vigs_comm_dispatch_set_root_surface(struct vigs_comm *comm, - struct vigsp_cmd_set_root_surface_request *request) -{ - VIGS_LOG_TRACE("id = %u, offset = %u", - request->id, - request->offset); - - comm->comm_ops->set_root_surface(comm->user_data, - request->id, - request->offset); + ops->destroy_surface(user_data, request->id); } -static void vigs_comm_dispatch_update_vram(struct vigs_comm *comm, +static void vigs_comm_dispatch_update_vram(struct vigs_comm_batch_ops *ops, + void *user_data, struct vigsp_cmd_update_vram_request *request) { if (request->sfc_id == 0) { @@ -136,12 +134,13 @@ static void vigs_comm_dispatch_update_vram(struct vigs_comm *comm, request->offset); } - comm->comm_ops->update_vram(comm->user_data, - request->sfc_id, - request->offset); + ops->update_vram(user_data, + request->sfc_id, + request->offset); } -static void vigs_comm_dispatch_update_gpu(struct vigs_comm *comm, +static void vigs_comm_dispatch_update_gpu(struct vigs_comm_batch_ops *ops, + void *user_data, struct vigsp_cmd_update_gpu_request *request) { if (request->sfc_id == 0) { @@ -153,90 +152,77 @@ static void vigs_comm_dispatch_update_gpu(struct vigs_comm *comm, request->offset); } - comm->comm_ops->update_gpu(comm->user_data, - request->sfc_id, - request->offset, - &request->entries[0], - request->num_entries); + ops->update_gpu(user_data, + request->sfc_id, + request->offset, + &request->entries[0], + request->num_entries); } -static void vigs_comm_dispatch_copy(struct vigs_comm *comm, +static void vigs_comm_dispatch_copy(struct vigs_comm_batch_ops *ops, + void *user_data, struct vigsp_cmd_copy_request *request) { VIGS_LOG_TRACE("src = %u, dst = %u", request->src_id, request->dst_id); - comm->comm_ops->copy(comm->user_data, - request->src_id, - request->dst_id, - &request->entries[0], - request->num_entries); + ops->copy(user_data, + request->src_id, + request->dst_id, + &request->entries[0], + request->num_entries); } -static void vigs_comm_dispatch_solid_fill(struct vigs_comm *comm, +static void vigs_comm_dispatch_solid_fill(struct vigs_comm_batch_ops *ops, + void *user_data, struct vigsp_cmd_solid_fill_request *request) { VIGS_LOG_TRACE("sfc = %u, color = 0x%X", request->sfc_id, request->color); - comm->comm_ops->solid_fill(comm->user_data, - request->sfc_id, - request->color, - &request->entries[0], - request->num_entries); + ops->solid_fill(user_data, + request->sfc_id, + request->color, + &request->entries[0], + request->num_entries); } /* * @} */ -#define VIGS_DISPATCH_ENTRY(cmd, func, has_request, has_response) \ - [cmd] = { func, has_request, has_response } +#define VIGS_DISPATCH_ENTRY(cmd, func) [cmd] = (vigs_dispatch_func)func -struct vigs_dispatch_entry -{ - void *func; - bool has_request; - bool has_response; -}; +typedef void (*vigs_dispatch_func)(struct vigs_comm_batch_ops*, void*, void*); -static const struct vigs_dispatch_entry vigs_dispatch_table[] = +static const vigs_dispatch_func vigs_dispatch_table[] = { - VIGS_DISPATCH_ENTRY(vigsp_cmd_init, - vigs_comm_dispatch_init, true, true), - VIGS_DISPATCH_ENTRY(vigsp_cmd_reset, - vigs_comm_dispatch_reset, false, true), - VIGS_DISPATCH_ENTRY(vigsp_cmd_exit, - vigs_comm_dispatch_exit, false, true), VIGS_DISPATCH_ENTRY(vigsp_cmd_create_surface, - vigs_comm_dispatch_create_surface, true, false), + vigs_comm_dispatch_create_surface), VIGS_DISPATCH_ENTRY(vigsp_cmd_destroy_surface, - vigs_comm_dispatch_destroy_surface, true, false), - VIGS_DISPATCH_ENTRY(vigsp_cmd_set_root_surface, - vigs_comm_dispatch_set_root_surface, true, false), + vigs_comm_dispatch_destroy_surface), VIGS_DISPATCH_ENTRY(vigsp_cmd_update_vram, - vigs_comm_dispatch_update_vram, true, false), + vigs_comm_dispatch_update_vram), VIGS_DISPATCH_ENTRY(vigsp_cmd_update_gpu, - vigs_comm_dispatch_update_gpu, true, false), + vigs_comm_dispatch_update_gpu), VIGS_DISPATCH_ENTRY(vigsp_cmd_copy, - vigs_comm_dispatch_copy, true, false), + vigs_comm_dispatch_copy), VIGS_DISPATCH_ENTRY(vigsp_cmd_solid_fill, - vigs_comm_dispatch_solid_fill, true, false) + vigs_comm_dispatch_solid_fill) }; -struct vigs_comm *vigs_comm_create(uint8_t *ram_ptr, - struct vigs_comm_ops *comm_ops, - void *user_data) +#define VIGS_MIN_BATCH_CMD_ID vigsp_cmd_create_surface +#define VIGS_MAX_BATCH_CMD_ID vigsp_cmd_solid_fill + +struct vigs_comm *vigs_comm_create(uint8_t *ram_ptr) { struct vigs_comm *comm; comm = g_malloc0(sizeof(*comm)); comm->ram_ptr = ram_ptr; - comm->comm_ops = comm_ops; - comm->user_data = user_data; return comm; } @@ -247,67 +233,74 @@ void vigs_comm_destroy(struct vigs_comm *comm) } void vigs_comm_dispatch(struct vigs_comm *comm, - uint32_t ram_offset) + uint32_t ram_offset, + struct vigs_comm_ops *ops, + void *user_data) { struct vigsp_cmd_batch_header *batch_header = (struct vigsp_cmd_batch_header*)(comm->ram_ptr + ram_offset); struct vigsp_cmd_request_header *request_header = (struct vigsp_cmd_request_header*)(batch_header + 1); - struct vigsp_cmd_response_header *response_header; - vigsp_u32 i; - vigsp_status status = vigsp_status_success; + + if (batch_header->size > 0) { + switch (request_header->cmd) { + case vigsp_cmd_init: + vigs_comm_dispatch_init(ops, + user_data, + (struct vigsp_cmd_init_request*)(request_header + 1)); + return; + case vigsp_cmd_reset: + vigs_comm_dispatch_reset(ops, user_data); + return; + case vigsp_cmd_exit: + vigs_comm_dispatch_exit(ops, user_data); + return; + case vigsp_cmd_set_root_surface: + vigs_comm_dispatch_set_root_surface(ops, + user_data, + (struct vigsp_cmd_set_root_surface_request*)(request_header + 1), + batch_header->fence_seq); + return; + default: + break; + } + } + + ops->batch(user_data, + (uint8_t*)batch_header, + sizeof(*batch_header) + batch_header->size); +} + +void vigs_comm_dispatch_batch(struct vigs_comm *comm, + uint8_t *batch, + struct vigs_comm_batch_ops *ops, + void *user_data) +{ + struct vigsp_cmd_batch_header *batch_header = + (struct vigsp_cmd_batch_header*)batch; + struct vigsp_cmd_request_header *request_header = + (struct vigsp_cmd_request_header*)(batch_header + 1); VIGS_LOG_TRACE("batch_start"); - comm->comm_ops->batch_start(comm->user_data); - - for (i = 0; i < batch_header->num_requests; ++i) { - response_header = - (struct vigsp_cmd_response_header*)((uint8_t*)(request_header + 1) + - request_header->size); - - if (status == vigsp_status_success) { - if (request_header->cmd >= ARRAY_SIZE(vigs_dispatch_table)) { - VIGS_LOG_CRITICAL("bad command = %d", request_header->cmd); - status = vigsp_status_bad_call; - } else { - const struct vigs_dispatch_entry *dispatch_entry = - &vigs_dispatch_table[request_header->cmd]; - - if (dispatch_entry->has_response && (i != (batch_header->num_requests - 1))) { - VIGS_LOG_CRITICAL("only last request in a batch is allowed to have response, bad command = %d", - request_header->cmd); - status = vigsp_status_bad_call; - } else { - if (dispatch_entry->has_request && dispatch_entry->has_response) { - vigsp_status (*func)(struct vigs_comm*, void*, void*) = - dispatch_entry->func; - status = func(comm, request_header + 1, response_header + 1); - } else if (dispatch_entry->has_request) { - void (*func)(struct vigs_comm*, void*) = - dispatch_entry->func; - func(comm, request_header + 1); - } else if (dispatch_entry->has_response) { - vigsp_status (*func)(struct vigs_comm*, void*) = - dispatch_entry->func; - status = func(comm, response_header + 1); - } else { - void (*func)(struct vigs_comm*) = - dispatch_entry->func; - func(comm); - } - } - } + ops->start(user_data); + + while ((uint8_t*)request_header < + (uint8_t*)(batch_header + 1) + batch_header->size) { + if ((request_header->cmd < VIGS_MIN_BATCH_CMD_ID) || + (request_header->cmd > VIGS_MAX_BATCH_CMD_ID)) { + VIGS_LOG_CRITICAL("bad command = %d", request_header->cmd); + } else { + vigs_dispatch_table[request_header->cmd](ops, + user_data, + request_header + 1); } - request_header = (struct vigsp_cmd_request_header*)response_header; + request_header = (struct vigsp_cmd_request_header*)( + (uint8_t*)(request_header + 1) + request_header->size); } - response_header = (struct vigsp_cmd_response_header*)request_header; - - response_header->status = status; - - VIGS_LOG_TRACE("batch_end"); + VIGS_LOG_TRACE("batch_end(%d)", batch_header->fence_seq); - comm->comm_ops->batch_end(comm->user_data); + ops->end(user_data, batch_header->fence_seq); } diff --git a/hw/vigs/vigs_comm.h b/hw/vigs/vigs_comm.h index 4524740..40514e7 100644 --- a/hw/vigs/vigs_comm.h +++ b/hw/vigs/vigs_comm.h @@ -34,14 +34,26 @@ struct vigs_comm_ops { - void (*batch_start)(void */*user_data*/); - - bool (*init)(void */*user_data*/); + void (*init)(void */*user_data*/); void (*reset)(void */*user_data*/); void (*exit)(void */*user_data*/); + void (*set_root_surface)(void */*user_data*/, + vigsp_surface_id /*id*/, + vigsp_offset /*offset*/, + vigsp_fence_seq /*fence_seq*/); + + void (*batch)(void */*user_data*/, + const uint8_t */*data*/, + uint32_t /*size*/); +}; + +struct vigs_comm_batch_ops +{ + void (*start)(void */*user_data*/); + void (*create_surface)(void */*user_data*/, uint32_t /*width*/, uint32_t /*height*/, @@ -52,10 +64,6 @@ struct vigs_comm_ops void (*destroy_surface)(void */*user_data*/, vigsp_surface_id /*id*/); - void (*set_root_surface)(void */*user_data*/, - vigsp_surface_id /*id*/, - vigsp_offset /*offset*/); - void (*update_vram)(void */*user_data*/, vigsp_surface_id /*sfc_id*/, vigsp_offset /*offset*/); @@ -78,25 +86,26 @@ struct vigs_comm_ops const struct vigsp_rect */*entries*/, uint32_t /*num_entries*/); - void (*batch_end)(void */*user_data*/); + void (*end)(void */*user_data*/, vigsp_fence_seq /*fence_seq*/); }; struct vigs_comm { uint8_t *ram_ptr; - - struct vigs_comm_ops *comm_ops; - - void *user_data; }; -struct vigs_comm *vigs_comm_create(uint8_t *ram_ptr, - struct vigs_comm_ops *comm_ops, - void *user_data); +struct vigs_comm *vigs_comm_create(uint8_t *ram_ptr); void vigs_comm_destroy(struct vigs_comm *comm); void vigs_comm_dispatch(struct vigs_comm *comm, - uint32_t ram_offset); + uint32_t ram_offset, + struct vigs_comm_ops *ops, + void *user_data); + +void vigs_comm_dispatch_batch(struct vigs_comm *comm, + uint8_t *batch, + struct vigs_comm_batch_ops *ops, + void *user_data); #endif diff --git a/hw/vigs/vigs_device.c b/hw/vigs/vigs_device.c index 6cc986d..0f3944d 100644 --- a/hw/vigs/vigs_device.c +++ b/hw/vigs/vigs_device.c @@ -32,20 +32,26 @@ #include "vigs_server.h" #include "vigs_backend.h" #include "vigs_regs.h" +#include "vigs_fenceman.h" #include "hw/hw.h" #include "ui/console.h" +#include "qemu/main-loop.h" #define PCI_VENDOR_ID_VIGS 0x19B2 #define PCI_DEVICE_ID_VIGS 0x1011 #define VIGS_IO_SIZE 0x1000 +struct work_queue; + typedef struct VIGSState { VIGSDevice dev; void *display; + struct work_queue *render_queue; + MemoryRegion vram_bar; uint32_t vram_size; @@ -54,6 +60,10 @@ typedef struct VIGSState MemoryRegion io_bar; + struct vigs_fenceman *fenceman; + + QEMUBH *fence_ack_bh; + struct vigs_server *server; /* @@ -70,18 +80,35 @@ extern const char *vigs_backend; static void vigs_update_irq(VIGSState *s) { - if ((s->reg_int & VIGS_REG_INT_VBLANK_ENABLE) == 0) { - pci_set_irq(&s->dev.pci_dev, 0); - return; + bool raise = false; + + if ((s->reg_int & VIGS_REG_INT_VBLANK_ENABLE) && + (s->reg_int & VIGS_REG_INT_VBLANK_PENDING)) { + raise = true; } - if (s->reg_int & VIGS_REG_INT_VBLANK_PENDING) { + if (s->reg_int & VIGS_REG_INT_FENCE_ACK_PENDING) { + raise = true; + } + + if (raise) { pci_set_irq(&s->dev.pci_dev, 1); } else { pci_set_irq(&s->dev.pci_dev, 0); } } +static void vigs_fence_ack_bh(void *opaque) +{ + VIGSState *s = opaque; + + if (vigs_fenceman_pending(s->fenceman)) { + s->reg_int |= VIGS_REG_INT_FENCE_ACK_PENDING; + } + + vigs_update_irq(s); +} + static void vigs_hw_update(void *opaque) { VIGSState *s = opaque; @@ -143,6 +170,16 @@ static uint8_t *vigs_dpy_get_data(void *user_data) return surface_data(ds); } +static void vigs_fence_ack(void *user_data, + uint32_t fence_seq) +{ + VIGSState *s = user_data; + + vigs_fenceman_ack(s->fenceman, fence_seq); + + qemu_bh_schedule(s->fence_ack_bh); +} + static uint64_t vigs_io_read(void *opaque, hwaddr offset, unsigned size) { @@ -151,6 +188,10 @@ static uint64_t vigs_io_read(void *opaque, hwaddr offset, switch (offset) { case VIGS_REG_INT: return s->reg_int; + case VIGS_REG_FENCE_LOWER: + return vigs_fenceman_get_lower(s->fenceman); + case VIGS_REG_FENCE_UPPER: + return vigs_fenceman_get_upper(s->fenceman); default: VIGS_LOG_CRITICAL("Bad register 0x%X read", (uint32_t)offset); break; @@ -169,10 +210,16 @@ static void vigs_io_write(void *opaque, hwaddr offset, vigs_server_dispatch(s->server, value); break; case VIGS_REG_INT: - if (((s->reg_int & VIGS_REG_INT_VBLANK_PENDING) == 0) && - (value & VIGS_REG_INT_VBLANK_PENDING)) { - VIGS_LOG_CRITICAL("Attempt to set VBLANK_PENDING"); + if (value & VIGS_REG_INT_VBLANK_PENDING) { value &= ~VIGS_REG_INT_VBLANK_PENDING; + } else { + value |= (s->reg_int & VIGS_REG_INT_VBLANK_PENDING); + } + + if (value & VIGS_REG_INT_FENCE_ACK_PENDING) { + value &= ~VIGS_REG_INT_FENCE_ACK_PENDING; + } else { + value |= (s->reg_int & VIGS_REG_INT_FENCE_ACK_PENDING); } if (((s->reg_int & VIGS_REG_INT_VBLANK_ENABLE) == 0) && @@ -184,9 +231,7 @@ static void vigs_io_write(void *opaque, hwaddr offset, } s->reg_int = value & VIGS_REG_INT_MASK; - if ((value & VIGS_REG_INT_VBLANK_ENABLE) == 0) { - s->reg_int &= ~VIGS_REG_INT_VBLANK_PENDING; - } + vigs_update_irq(s); break; default: @@ -214,6 +259,7 @@ static struct vigs_display_ops vigs_dpy_ops = .get_stride = vigs_dpy_get_stride, .get_bpp = vigs_dpy_get_bpp, .get_data = vigs_dpy_get_data, + .fence_ack = vigs_fence_ack, }; static int vigs_device_init(PCIDevice *dev) @@ -263,6 +309,10 @@ static int vigs_device_init(PCIDevice *dev) goto fail; } + s->fenceman = vigs_fenceman_create(); + + s->fence_ack_bh = qemu_bh_new(vigs_fence_ack_bh, s); + s->con = graphic_console_init(DEVICE(dev), &vigs_hw_ops, s); if (!s->con) { @@ -273,7 +323,8 @@ static int vigs_device_init(PCIDevice *dev) memory_region_get_ram_ptr(&s->ram_bar), &vigs_dpy_ops, s, - backend); + backend, + s->render_queue); if (!s->server) { goto fail; @@ -293,6 +344,14 @@ fail: backend->destroy(backend); } + if (s->fence_ack_bh) { + qemu_bh_delete(s->fence_ack_bh); + } + + if (s->fenceman) { + vigs_fenceman_destroy(s->fenceman); + } + memory_region_destroy(&s->io_bar); memory_region_destroy(&s->ram_bar); memory_region_destroy(&s->vram_bar); @@ -308,6 +367,10 @@ static void vigs_device_reset(DeviceState *d) vigs_server_reset(s->server); + vigs_fenceman_reset(s->fenceman); + + pci_set_irq(&s->dev.pci_dev, 0); + s->reg_int = 0; VIGS_LOG_INFO("VIGS reset"); @@ -319,6 +382,10 @@ static void vigs_device_exit(PCIDevice *dev) vigs_server_destroy(s->server); + qemu_bh_delete(s->fence_ack_bh); + + vigs_fenceman_destroy(s->fenceman); + memory_region_destroy(&s->io_bar); memory_region_destroy(&s->ram_bar); memory_region_destroy(&s->vram_bar); @@ -334,6 +401,11 @@ static Property vigs_properties[] = { .info = &qdev_prop_ptr, .offset = offsetof(VIGSState, display), }, + { + .name = "render_queue", + .info = &qdev_prop_ptr, + .offset = offsetof(VIGSState, render_queue), + }, DEFINE_PROP_UINT32("vram_size", VIGSState, vram_size, 32 * 1024 * 1024), DEFINE_PROP_UINT32("ram_size", VIGSState, ram_size, diff --git a/hw/vigs/vigs_fenceman.c b/hw/vigs/vigs_fenceman.c new file mode 100644 index 0000000..634493f --- /dev/null +++ b/hw/vigs/vigs_fenceman.c @@ -0,0 +1,185 @@ +/* + * vigs + * + * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * Stanislav Vorobiov + * Jinhyung Jo + * YeongKyoon Lee + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +#include "vigs_fenceman.h" +#include "vigs_log.h" + +static __inline uint32_t vigs_fenceman_seq_next(uint32_t seq) +{ + if (++seq == 0) { + ++seq; + } + return seq; +} + +static __inline uint32_t vigs_fenceman_seq_prev(uint32_t seq) +{ + if (--seq == 0) { + --seq; + } + return seq; +} + +static __inline bool vigs_fenceman_seq_before(uint32_t a, uint32_t b) +{ + return ((int32_t)a - (int32_t)b) < 0; +} + +struct vigs_fenceman *vigs_fenceman_create(void) +{ + struct vigs_fenceman *fenceman; + + fenceman = g_malloc0(sizeof(*fenceman)); + + qemu_mutex_init(&fenceman->mutex); + QTAILQ_INIT(&fenceman->acks); + + return fenceman; +} + +void vigs_fenceman_destroy(struct vigs_fenceman *fenceman) +{ + vigs_fenceman_reset(fenceman); + qemu_mutex_destroy(&fenceman->mutex); + g_free(fenceman); +} + +void vigs_fenceman_reset(struct vigs_fenceman *fenceman) +{ + struct vigs_fence_ack *ack, *tmp; + + qemu_mutex_lock(&fenceman->mutex); + + QTAILQ_FOREACH_SAFE(ack, &fenceman->acks, entry, tmp) { + QTAILQ_REMOVE(&fenceman->acks, ack, entry); + g_free(ack); + } + + qemu_mutex_unlock(&fenceman->mutex); +} + +void vigs_fenceman_ack(struct vigs_fenceman *fenceman, uint32_t fence_seq) +{ + struct vigs_fence_ack *ack, *tmp; + + VIGS_LOG_TRACE("Fence ack %u", fence_seq); + + qemu_mutex_lock(&fenceman->mutex); + + QTAILQ_FOREACH(ack, &fenceman->acks, entry) { + uint32_t upper_p1 = vigs_fenceman_seq_next(ack->upper); + + if (upper_p1 == fence_seq) { + ack->upper = fence_seq; + + tmp = QTAILQ_NEXT(ack, entry); + + if (tmp && (tmp->lower == fence_seq)) { + ack->upper = tmp->upper; + QTAILQ_REMOVE(&fenceman->acks, tmp, entry); + g_free(tmp); + } + + goto out; + } else if (vigs_fenceman_seq_before(fence_seq, upper_p1)) { + uint32_t lower_m1 = vigs_fenceman_seq_prev(ack->lower); + + if (lower_m1 == fence_seq) { + ack->lower = fence_seq; + } else if (vigs_fenceman_seq_before(fence_seq, lower_m1)) { + tmp = g_malloc(sizeof(*tmp)); + + QTAILQ_INSERT_BEFORE(ack, tmp, entry); + + tmp->lower = tmp->upper = fence_seq; + } else { + VIGS_LOG_ERROR("Duplicate fence ack %u", fence_seq); + } + + goto out; + } + } + + tmp = g_malloc(sizeof(*tmp)); + + QTAILQ_INSERT_TAIL(&fenceman->acks, tmp, entry); + + tmp->lower = tmp->upper = fence_seq; + +out: + qemu_mutex_unlock(&fenceman->mutex); +} + +uint32_t vigs_fenceman_get_lower(struct vigs_fenceman *fenceman) +{ + struct vigs_fence_ack *ack; + uint32_t lower = 0; + + qemu_mutex_lock(&fenceman->mutex); + + ack = QTAILQ_FIRST(&fenceman->acks); + + if (ack) { + lower = ack->lower; + fenceman->last_upper = ack->upper; + + QTAILQ_REMOVE(&fenceman->acks, ack, entry); + g_free(ack); + } + + qemu_mutex_unlock(&fenceman->mutex); + + return lower; +} + +uint32_t vigs_fenceman_get_upper(struct vigs_fenceman *fenceman) +{ + uint32_t upper = 0; + + qemu_mutex_lock(&fenceman->mutex); + + upper = fenceman->last_upper; + + qemu_mutex_unlock(&fenceman->mutex); + + return upper; +} + +bool vigs_fenceman_pending(struct vigs_fenceman *fenceman) +{ + bool empty; + + qemu_mutex_lock(&fenceman->mutex); + + empty = QTAILQ_EMPTY(&fenceman->acks); + + qemu_mutex_unlock(&fenceman->mutex); + + return !empty; +} diff --git a/hw/vigs/vigs_fenceman.h b/hw/vigs/vigs_fenceman.h new file mode 100644 index 0000000..8a1e238 --- /dev/null +++ b/hw/vigs/vigs_fenceman.h @@ -0,0 +1,68 @@ +/* + * vigs + * + * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * Stanislav Vorobiov + * Jinhyung Jo + * YeongKyoon Lee + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +#ifndef _QEMU_VIGS_FENCEMAN_H +#define _QEMU_VIGS_FENCEMAN_H + +#include "vigs_types.h" +#include "qemu/queue.h" +#include "qemu/thread.h" + +struct vigs_fence_ack +{ + QTAILQ_ENTRY(vigs_fence_ack) entry; + + uint32_t lower; + uint32_t upper; +}; + +struct vigs_fenceman +{ + QemuMutex mutex; + + QTAILQ_HEAD(, vigs_fence_ack) acks; + + uint32_t last_upper; +}; + +struct vigs_fenceman *vigs_fenceman_create(void); + +void vigs_fenceman_destroy(struct vigs_fenceman *fenceman); + +void vigs_fenceman_reset(struct vigs_fenceman *fenceman); + +void vigs_fenceman_ack(struct vigs_fenceman *fenceman, uint32_t fence_seq); + +uint32_t vigs_fenceman_get_lower(struct vigs_fenceman *fenceman); + +uint32_t vigs_fenceman_get_upper(struct vigs_fenceman *fenceman); + +bool vigs_fenceman_pending(struct vigs_fenceman *fenceman); + +#endif diff --git a/hw/vigs/vigs_protocol.h b/hw/vigs/vigs_protocol.h index c24257e..ba853e4 100644 --- a/hw/vigs/vigs_protocol.h +++ b/hw/vigs/vigs_protocol.h @@ -31,19 +31,13 @@ #define _VIGS_PROTOCOL_H_ /* - * VIGS protocol is a multiple request-single response protocol. - * - * + Requests come batched. - * + The response is written after the request batch. - * - * Not all commands can be batched, only commands that don't have response - * data can be batched. + * VIGS protocol is a multiple request-no response protocol. */ /* * Bump this whenever protocol changes. */ -#define VIGS_PROTOCOL_VERSION 14 +#define VIGS_PROTOCOL_VERSION 15 typedef signed char vigsp_s8; typedef signed short vigsp_s16; @@ -58,30 +52,36 @@ typedef vigsp_u32 vigsp_bool; typedef vigsp_u32 vigsp_surface_id; typedef vigsp_u32 vigsp_offset; typedef vigsp_u32 vigsp_color; +typedef vigsp_u32 vigsp_fence_seq; typedef enum { + /* + * These command are guaranteed to sync on host, i.e. + * no fence is required. + * @{ + */ vigsp_cmd_init = 0x0, vigsp_cmd_reset = 0x1, vigsp_cmd_exit = 0x2, - vigsp_cmd_create_surface = 0x3, - vigsp_cmd_destroy_surface = 0x4, - vigsp_cmd_set_root_surface = 0x5, + vigsp_cmd_set_root_surface = 0x3, + /* + * @} + */ + /* + * These commands are executed asynchronously. + * @{ + */ + vigsp_cmd_create_surface = 0x4, + vigsp_cmd_destroy_surface = 0x5, vigsp_cmd_update_vram = 0x6, vigsp_cmd_update_gpu = 0x7, vigsp_cmd_copy = 0x8, vigsp_cmd_solid_fill = 0x9, -} vigsp_cmd; - -typedef enum -{ /* - * Start from 0x1 to detect host failures on target. + * @} */ - vigsp_status_success = 0x1, - vigsp_status_bad_call = 0x2, - vigsp_status_exec_error = 0x3, -} vigsp_status; +} vigsp_cmd; typedef enum { @@ -118,7 +118,17 @@ struct vigsp_copy struct vigsp_cmd_batch_header { - vigsp_u32 num_requests; + /* + * Fence sequence requested by this batch. + * 0 for none. + */ + vigsp_fence_seq fence_seq; + + /* + * Batch size starting from batch header. + * Can be 0. + */ + vigsp_u32 size; }; struct vigsp_cmd_request_header @@ -131,11 +141,6 @@ struct vigsp_cmd_request_header vigsp_u32 size; }; -struct vigsp_cmd_response_header -{ - vigsp_status status; -}; - /* * cmd_init * @@ -150,10 +155,6 @@ struct vigsp_cmd_response_header struct vigsp_cmd_init_request { vigsp_u32 client_version; -}; - -struct vigsp_cmd_init_response -{ vigsp_u32 server_version; }; diff --git a/hw/vigs/vigs_regs.h b/hw/vigs/vigs_regs.h index 35a6066..dd069b3 100644 --- a/hw/vigs/vigs_regs.h +++ b/hw/vigs/vigs_regs.h @@ -32,9 +32,12 @@ #define VIGS_REG_EXEC 0 #define VIGS_REG_INT 8 +#define VIGS_REG_FENCE_LOWER 16 +#define VIGS_REG_FENCE_UPPER 24 -#define VIGS_REG_INT_MASK 3 +#define VIGS_REG_INT_MASK 7 #define VIGS_REG_INT_VBLANK_ENABLE 1 #define VIGS_REG_INT_VBLANK_PENDING 2 +#define VIGS_REG_INT_FENCE_ACK_PENDING 4 #endif diff --git a/hw/vigs/vigs_server.c b/hw/vigs/vigs_server.c index ca38d8d..983f30c 100644 --- a/hw/vigs/vigs_server.c +++ b/hw/vigs/vigs_server.c @@ -33,6 +33,24 @@ #include "vigs_backend.h" #include "vigs_surface.h" #include "vigs_utils.h" +#include "work_queue.h" + +struct vigs_server_work_item +{ + struct work_queue_item base; + + struct vigs_server *server; +}; + +struct vigs_server_set_root_surface_work_item +{ + struct work_queue_item base; + + struct vigs_server *server; + + vigsp_surface_id id; + vigsp_offset offset; +}; static void vigs_server_surface_destroy_func(gpointer data) { @@ -50,7 +68,7 @@ static void vigs_server_unuse_surface(struct vigs_server *server, if (server->root_sfc == sfc) { server->root_sfc = NULL; - server->root_sfc_data = NULL; + server->root_sfc_ptr = NULL; } } @@ -73,12 +91,14 @@ static struct winsys_surface return res->ws_sfc; } -static void vigs_server_end_batch(struct vigs_server *server) +static void vigs_server_fence_ack(struct winsys_interface *wsi, + uint32_t fence_seq) { - if (server->in_batch) { - server->backend->batch_end(server->backend); + struct vigs_server *server = + container_of(wsi, struct vigs_server, wsi); - server->in_batch = false; + if (fence_seq) { + server->display_ops->fence_ack(server->display_user_data, fence_seq); } } @@ -86,63 +106,7 @@ static void vigs_server_dispatch_batch_start(void *user_data) { struct vigs_server *server = user_data; - server->in_batch = false; - - if (server->initialized) { - server->backend->batch_start(server->backend); - - server->in_batch = true; - } -} - -static bool vigs_server_dispatch_init(void *user_data) -{ - struct vigs_server *server = user_data; - - if (server->initialized) { - VIGS_LOG_ERROR("already initialized"); - return false; - } - - server->initialized = true; - - return true; -} - -static void vigs_server_dispatch_reset(void *user_data) -{ - struct vigs_server *server = user_data; - GHashTableIter iter; - gpointer key, value; - - if (!server->initialized) { - VIGS_LOG_ERROR("not initialized"); - return; - } - - g_hash_table_iter_init(&iter, server->surfaces); - while (g_hash_table_iter_next(&iter, &key, &value)) { - struct vigs_surface *sfc = value; - - if (sfc != server->root_sfc) { - vigs_server_unuse_surface(server, sfc); - g_hash_table_iter_remove(&iter); - } - } -} - -static void vigs_server_dispatch_exit(void *user_data) -{ - struct vigs_server *server = user_data; - - if (!server->initialized) { - VIGS_LOG_ERROR("not initialized"); - return; - } - - vigs_server_end_batch(server); - - vigs_server_reset(server); + server->backend->batch_start(server->backend); } static void vigs_server_dispatch_create_surface(void *user_data, @@ -208,38 +172,6 @@ static void vigs_server_dispatch_destroy_surface(void *user_data, VIGS_LOG_TRACE("num_surfaces = %u", g_hash_table_size(server->surfaces)); } -static void vigs_server_dispatch_set_root_surface(void *user_data, - vigsp_surface_id id, - vigsp_offset offset) -{ - struct vigs_server *server = user_data; - struct vigs_surface *sfc; - - if (!server->initialized) { - VIGS_LOG_ERROR("not initialized"); - return; - } - - if (id == 0) { - server->root_sfc = NULL; - server->root_sfc_data = NULL; - - VIGS_LOG_TRACE("root surface reset"); - - return; - } - - sfc = g_hash_table_lookup(server->surfaces, GUINT_TO_POINTER(id)); - - if (!sfc) { - VIGS_LOG_ERROR("surface %u not found", id); - return; - } - - server->root_sfc = sfc; - server->root_sfc_data = server->vram_ptr + offset; -} - static void vigs_server_dispatch_update_vram(void *user_data, vigsp_surface_id sfc_id, vigsp_offset offset) @@ -362,34 +294,254 @@ static void vigs_server_dispatch_solid_fill(void *user_data, sfc->is_dirty = true; } -static void vigs_server_dispatch_batch_end(void *user_data) +static void vigs_server_dispatch_batch_end(void *user_data, + vigsp_fence_seq fence_seq) { struct vigs_server *server = user_data; - vigs_server_end_batch(server); + server->backend->batch_end(server->backend); + + if (fence_seq) { + server->display_ops->fence_ack(server->display_user_data, fence_seq); + } } -static struct vigs_comm_ops vigs_server_dispatch_ops = +static struct vigs_comm_batch_ops vigs_server_dispatch_batch_ops = { - .batch_start = &vigs_server_dispatch_batch_start, - .init = &vigs_server_dispatch_init, - .reset = &vigs_server_dispatch_reset, - .exit = &vigs_server_dispatch_exit, + .start = &vigs_server_dispatch_batch_start, .create_surface = &vigs_server_dispatch_create_surface, .destroy_surface = &vigs_server_dispatch_destroy_surface, - .set_root_surface = &vigs_server_dispatch_set_root_surface, .update_vram = &vigs_server_dispatch_update_vram, .update_gpu = &vigs_server_dispatch_update_gpu, .copy = &vigs_server_dispatch_copy, .solid_fill = &vigs_server_dispatch_solid_fill, - .batch_end = &vigs_server_dispatch_batch_end + .end = &vigs_server_dispatch_batch_end +}; + +static void vigs_server_work(struct work_queue_item *wq_item) +{ + struct vigs_server_work_item *item = (struct vigs_server_work_item*)wq_item; + + vigs_comm_dispatch_batch(item->server->comm, + (uint8_t*)(item + 1), + &vigs_server_dispatch_batch_ops, + item->server); + + g_free(item); +} + +static void vigs_server_set_root_surface_work(struct work_queue_item *wq_item) +{ + struct vigs_server_set_root_surface_work_item *item = + (struct vigs_server_set_root_surface_work_item*)wq_item; + struct vigs_server *server = item->server; + struct vigs_surface *sfc; + + if (!server->initialized) { + VIGS_LOG_ERROR("not initialized"); + goto out; + } + + if (item->id == 0) { + server->root_sfc = NULL; + server->root_sfc_ptr = NULL; + + VIGS_LOG_TRACE("root surface reset"); + + goto out; + } + + sfc = g_hash_table_lookup(server->surfaces, GUINT_TO_POINTER(item->id)); + + if (!sfc) { + VIGS_LOG_ERROR("surface %u not found", item->id); + goto out; + } + + server->root_sfc = sfc; + server->root_sfc_ptr = server->vram_ptr + item->offset; + +out: + g_free(item); +} + +static void vigs_server_update_display_work(struct work_queue_item *wq_item) +{ + struct vigs_server_work_item *item = (struct vigs_server_work_item*)wq_item; + struct vigs_server *server = item->server; + struct vigs_surface *root_sfc = server->root_sfc; + uint32_t capture_fence_seq; + + if (!root_sfc) { + qemu_mutex_lock(&server->capture_mutex); + goto out; + } + + if (root_sfc->is_dirty) { + server->backend->batch_start(server->backend); + root_sfc->read_pixels(root_sfc, + 0, + 0, + root_sfc->ws_sfc->width, + root_sfc->ws_sfc->height, + server->root_sfc_ptr); + server->backend->batch_end(server->backend); + root_sfc->is_dirty = false; + } + + qemu_mutex_lock(&server->capture_mutex); + + if ((server->captured.stride != root_sfc->stride) || + (server->captured.height != root_sfc->ws_sfc->height)) { + g_free(server->captured.data); + server->captured.data = g_malloc(root_sfc->stride * + root_sfc->ws_sfc->height); + } + + memcpy(server->captured.data, + server->root_sfc_ptr, + root_sfc->stride * root_sfc->ws_sfc->height); + + server->captured.width = root_sfc->ws_sfc->width; + server->captured.height = root_sfc->ws_sfc->height; + server->captured.stride = root_sfc->stride; + server->captured.format = root_sfc->format; + +out: + server->is_capturing = false; + capture_fence_seq = server->capture_fence_seq; + server->capture_fence_seq = 0; + + qemu_mutex_unlock(&server->capture_mutex); + + if (capture_fence_seq) { + server->display_ops->fence_ack(server->display_user_data, + capture_fence_seq); + } + + g_free(item); +} + +static void vigs_server_dispatch_init(void *user_data) +{ + struct vigs_server *server = user_data; + + work_queue_wait(server->render_queue); + + if (server->initialized) { + VIGS_LOG_ERROR("already initialized"); + return; + } + + server->initialized = true; +} + +static void vigs_server_dispatch_reset(void *user_data) +{ + struct vigs_server *server = user_data; + GHashTableIter iter; + gpointer key, value; + + work_queue_wait(server->render_queue); + + if (!server->initialized) { + VIGS_LOG_ERROR("not initialized"); + return; + } + + g_hash_table_iter_init(&iter, server->surfaces); + while (g_hash_table_iter_next(&iter, &key, &value)) { + struct vigs_surface *sfc = value; + + if (sfc != server->root_sfc) { + vigs_server_unuse_surface(server, sfc); + g_hash_table_iter_remove(&iter); + } + } +} + +static void vigs_server_dispatch_exit(void *user_data) +{ + struct vigs_server *server = user_data; + + work_queue_wait(server->render_queue); + + if (!server->initialized) { + VIGS_LOG_ERROR("not initialized"); + return; + } + + vigs_server_reset(server); +} + +static void vigs_server_dispatch_set_root_surface(void *user_data, + vigsp_surface_id id, + vigsp_offset offset, + vigsp_fence_seq fence_seq) +{ + struct vigs_server *server = user_data; + struct vigs_server_set_root_surface_work_item *item; + uint32_t capture_fence_seq = 0; + + item = g_malloc(sizeof(*item)); + + work_queue_item_init(&item->base, &vigs_server_set_root_surface_work); + + item->server = server; + item->id = id; + item->offset = offset; + + work_queue_add_item(server->render_queue, &item->base); + + qemu_mutex_lock(&server->capture_mutex); + + if (server->is_capturing) { + capture_fence_seq = server->capture_fence_seq; + server->capture_fence_seq = fence_seq; + } else { + capture_fence_seq = fence_seq; + } + + qemu_mutex_unlock(&server->capture_mutex); + + if (capture_fence_seq) { + server->display_ops->fence_ack(server->display_user_data, + capture_fence_seq); + } +} + +static void vigs_server_dispatch_batch(void *user_data, + const uint8_t *data, + uint32_t size) +{ + struct vigs_server *server = user_data; + struct vigs_server_work_item *item; + + item = g_malloc(sizeof(*item) + size); + + work_queue_item_init(&item->base, &vigs_server_work); + + item->server = server; + memcpy((item + 1), data, size); + + work_queue_add_item(server->render_queue, &item->base); +} + +static struct vigs_comm_ops vigs_server_dispatch_ops = +{ + .init = &vigs_server_dispatch_init, + .reset = &vigs_server_dispatch_reset, + .exit = &vigs_server_dispatch_exit, + .set_root_surface = &vigs_server_dispatch_set_root_surface, + .batch = &vigs_server_dispatch_batch }; struct vigs_server *vigs_server_create(uint8_t *vram_ptr, uint8_t *ram_ptr, struct vigs_display_ops *display_ops, void *display_user_data, - struct vigs_backend *backend) + struct vigs_backend *backend, + struct work_queue *render_queue) { struct vigs_server *server = NULL; @@ -397,15 +549,15 @@ struct vigs_server *vigs_server_create(uint8_t *vram_ptr, server->wsi.ws_info = backend->ws_info; server->wsi.acquire_surface = &vigs_server_acquire_surface; + server->wsi.fence_ack = &vigs_server_fence_ack; server->vram_ptr = vram_ptr; server->display_ops = display_ops; server->display_user_data = display_user_data; server->backend = backend; + server->render_queue = render_queue; - server->comm = vigs_comm_create(ram_ptr, - &vigs_server_dispatch_ops, - server); + server->comm = vigs_comm_create(ram_ptr); if (!server->comm) { goto fail; @@ -416,7 +568,7 @@ struct vigs_server *vigs_server_create(uint8_t *vram_ptr, NULL, vigs_server_surface_destroy_func); - vigs_vector_init(&server->v1, 0); + qemu_mutex_init(&server->capture_mutex); return server; @@ -432,8 +584,9 @@ void vigs_server_destroy(struct vigs_server *server) g_hash_table_destroy(server->surfaces); vigs_comm_destroy(server->comm); - vigs_vector_cleanup(&server->v1); server->backend->destroy(server->backend); + qemu_mutex_destroy(&server->capture_mutex); + g_free(server->captured.data); g_free(server); } @@ -442,6 +595,8 @@ void vigs_server_reset(struct vigs_server *server) GHashTableIter iter; gpointer key, value; + work_queue_wait(server->render_queue); + server->backend->batch_start(server->backend); g_hash_table_iter_init(&iter, server->surfaces); @@ -455,48 +610,35 @@ void vigs_server_reset(struct vigs_server *server) server->backend->batch_end(server->backend); - server->root_sfc = NULL; - server->root_sfc_data = NULL; - server->initialized = false; } void vigs_server_dispatch(struct vigs_server *server, uint32_t ram_offset) { - vigs_comm_dispatch(server->comm, ram_offset); + vigs_comm_dispatch(server->comm, + ram_offset, + &vigs_server_dispatch_ops, + server); } void vigs_server_update_display(struct vigs_server *server) { - struct vigs_surface *root_sfc = server->root_sfc; uint32_t sfc_bpp; uint32_t display_stride, display_bpp; uint8_t *display_data; - uint8_t *sfc_data = server->root_sfc_data; - uint32_t i; - if (!root_sfc) { - return; - } + qemu_mutex_lock(&server->capture_mutex); - if (root_sfc->is_dirty) { - server->backend->batch_start(server->backend); - root_sfc->read_pixels(root_sfc, - 0, - 0, - root_sfc->ws_sfc->width, - root_sfc->ws_sfc->height, - sfc_data); - server->backend->batch_end(server->backend); - root_sfc->is_dirty = false; + if (!server->captured.data) { + goto out; } - sfc_bpp = vigs_format_bpp(root_sfc->format); + sfc_bpp = vigs_format_bpp(server->captured.format); server->display_ops->resize(server->display_user_data, - root_sfc->ws_sfc->width, - root_sfc->ws_sfc->height); + server->captured.width, + server->captured.height); display_stride = server->display_ops->get_stride(server->display_user_data); display_bpp = server->display_ops->get_bpp(server->display_user_data); @@ -508,36 +650,54 @@ void vigs_server_update_display(struct vigs_server *server) exit(1); } - if (display_stride == root_sfc->stride) { - switch (root_sfc->format) { + if (display_stride == server->captured.stride) { + switch (server->captured.format) { case vigsp_surface_bgrx8888: case vigsp_surface_bgra8888: memcpy(display_data, - sfc_data, - root_sfc->ws_sfc->height * display_stride); + server->captured.data, + server->captured.height * display_stride); break; default: assert(false); - VIGS_LOG_CRITICAL("unknown format: %d", root_sfc->format); + VIGS_LOG_CRITICAL("unknown format: %d", server->captured.format); exit(1); } } else { - for (i = 0; i < root_sfc->ws_sfc->height; ++i) { - uint8_t *src = sfc_data; - uint8_t *dst = display_data; + uint32_t i; + uint8_t *src = server->captured.data; + uint8_t *dst = display_data; - switch (root_sfc->format) { + for (i = 0; i < server->captured.height; ++i) { + switch (server->captured.format) { case vigsp_surface_bgrx8888: case vigsp_surface_bgra8888: - memcpy(dst, src, root_sfc->ws_sfc->width * 4); + memcpy(dst, src, server->captured.width * sfc_bpp); break; default: assert(false); - VIGS_LOG_CRITICAL("unknown format: %d", root_sfc->format); + VIGS_LOG_CRITICAL("unknown format: %d", server->captured.format); exit(1); } - sfc_data += root_sfc->stride; - display_data += display_stride; + src += server->captured.stride; + dst += display_stride; } } + +out: + qemu_mutex_unlock(&server->capture_mutex); + + if (!server->is_capturing) { + struct vigs_server_work_item *item; + + item = g_malloc(sizeof(*item)); + + work_queue_item_init(&item->base, &vigs_server_update_display_work); + + item->server = server; + + server->is_capturing = true; + + work_queue_add_item(server->render_queue, &item->base); + } } diff --git a/hw/vigs/vigs_server.h b/hw/vigs/vigs_server.h index 29c8b32..fa56e42 100644 --- a/hw/vigs/vigs_server.h +++ b/hw/vigs/vigs_server.h @@ -31,12 +31,12 @@ #define _QEMU_VIGS_SERVER_H #include "vigs_types.h" -#include "vigs_vector.h" #include "winsys.h" #include struct vigs_comm; struct vigs_backend; +struct work_queue; struct vigs_display_ops { @@ -61,6 +61,9 @@ struct vigs_display_ops /* * @} */ + + void (*fence_ack)(void */*user_data*/, + uint32_t /*fence_seq*/); }; struct vigs_server @@ -74,6 +77,8 @@ struct vigs_server struct vigs_backend *backend; + struct work_queue *render_queue; + struct vigs_comm *comm; /* @@ -87,20 +92,22 @@ struct vigs_server GHashTable *surfaces; struct vigs_surface *root_sfc; - uint8_t *root_sfc_data; + uint8_t *root_sfc_ptr; - bool in_batch; + QemuMutex capture_mutex; - /* - * General purpose vectors. - * @{ - */ + bool is_capturing; - struct vigs_vector v1; + uint32_t capture_fence_seq; - /* - * @} - */ + struct + { + uint8_t *data; + uint32_t width; + uint32_t height; + uint32_t stride; + vigsp_surface_format format; + } captured; /* * @} @@ -111,7 +118,8 @@ struct vigs_server *vigs_server_create(uint8_t *vram_ptr, uint8_t *ram_ptr, struct vigs_display_ops *display_ops, void *display_user_data, - struct vigs_backend *backend); + struct vigs_backend *backend, + struct work_queue *render_queue); void vigs_server_destroy(struct vigs_server *server); diff --git a/hw/winsys.h b/hw/winsys.h index 0f9f555..7656dfc 100644 --- a/hw/winsys.h +++ b/hw/winsys.h @@ -29,6 +29,9 @@ struct winsys_interface */ struct winsys_surface *(*acquire_surface)(struct winsys_interface */*wsi*/, winsys_id /*id*/); + + void (*fence_ack)(struct winsys_interface */*wsi*/, + uint32_t /*fence_seq*/); }; #endif diff --git a/hw/work_queue.c b/hw/work_queue.c new file mode 100644 index 0000000..af5b8a5 --- /dev/null +++ b/hw/work_queue.c @@ -0,0 +1,107 @@ +#include "work_queue.h" + +static void *work_queue_run(void *arg) +{ + struct work_queue *wq = arg; + + qemu_mutex_lock(&wq->mutex); + + while (true) { + struct work_queue_item *wq_item; + + while (wq->num_items == 0) { + if (wq->destroying) { + goto out; + } + + qemu_cond_signal(&wq->wait_cond); + qemu_cond_wait(&wq->add_cond, &wq->mutex); + } + + wq_item = QTAILQ_FIRST(&wq->items); + QTAILQ_REMOVE(&wq->items, wq_item, entry); + + qemu_mutex_unlock(&wq->mutex); + + wq_item->func(wq_item); + + qemu_mutex_lock(&wq->mutex); + + --wq->num_items; + } + +out: + qemu_mutex_unlock(&wq->mutex); + + return NULL; +} + +void work_queue_item_init(struct work_queue_item *wq_item, + work_queue_func func) +{ + memset(wq_item, 0, sizeof(*wq_item)); + + wq_item->func = func; +} + +struct work_queue *work_queue_create(void) +{ + struct work_queue *wq; + + wq = g_malloc0(sizeof(*wq)); + + qemu_mutex_init(&wq->mutex); + qemu_cond_init(&wq->add_cond); + qemu_cond_init(&wq->wait_cond); + + QTAILQ_INIT(&wq->items); + + qemu_thread_create(&wq->thread, + work_queue_run, + wq, + QEMU_THREAD_JOINABLE); + + return wq; +} + +void work_queue_add_item(struct work_queue *wq, + struct work_queue_item *wq_item) +{ + qemu_mutex_lock(&wq->mutex); + + QTAILQ_INSERT_TAIL(&wq->items, wq_item, entry); + ++wq->num_items; + + qemu_mutex_unlock(&wq->mutex); + + qemu_cond_signal(&wq->add_cond); +} + +void work_queue_wait(struct work_queue *wq) +{ + if (wq->num_items == 0) { + return; + } + + qemu_mutex_lock(&wq->mutex); + + while (wq->num_items > 0) { + qemu_cond_wait(&wq->wait_cond, &wq->mutex); + } + + qemu_mutex_unlock(&wq->mutex); +} + +void work_queue_destroy(struct work_queue *wq) +{ + wq->destroying = true; + qemu_cond_signal(&wq->add_cond); + + qemu_thread_join(&wq->thread); + + qemu_cond_destroy(&wq->wait_cond); + qemu_cond_destroy(&wq->add_cond); + qemu_mutex_destroy(&wq->mutex); + + g_free(wq); +} diff --git a/hw/work_queue.h b/hw/work_queue.h new file mode 100644 index 0000000..a08efca --- /dev/null +++ b/hw/work_queue.h @@ -0,0 +1,45 @@ +#ifndef _QEMU_WORK_QUEUE_H +#define _QEMU_WORK_QUEUE_H + +#include "qemu-common.h" +#include "qemu/queue.h" +#include "qemu/thread.h" + +struct work_queue_item; + +typedef void (*work_queue_func)(struct work_queue_item */*wq_item*/); + +struct work_queue_item +{ + QTAILQ_ENTRY(work_queue_item) entry; + + work_queue_func func; +}; + +struct work_queue +{ + QemuThread thread; + QemuMutex mutex; + QemuCond add_cond; + QemuCond wait_cond; + + QTAILQ_HEAD(, work_queue_item) items; + + int num_items; + + bool destroying; +}; + +void work_queue_item_init(struct work_queue_item *wq_item, + work_queue_func func); + +struct work_queue *work_queue_create(void); + +void work_queue_add_item(struct work_queue *wq, + struct work_queue_item *wq_item); + +void work_queue_wait(struct work_queue *wq); + +void work_queue_destroy(struct work_queue *wq); + +#endif diff --git a/hw/yagl/yagl_apis/egl/yagl_egl_calls.c b/hw/yagl/yagl_apis/egl/yagl_egl_calls.c index 66c1957..8f114da 100644 --- a/hw/yagl/yagl_apis/egl/yagl_egl_calls.c +++ b/hw/yagl/yagl_apis/egl/yagl_egl_calls.c @@ -40,7 +40,7 @@ /* * eglGetDisplay dispatcher. id = 1 */ -static bool yagl_func_eglGetDisplay(struct yagl_transport *t) +static void yagl_func_eglGetDisplay(struct yagl_transport *t) { uint32_t display_id; EGLint *error; @@ -51,14 +51,12 @@ static bool yagl_func_eglGetDisplay(struct yagl_transport *t) YAGL_LOG_FUNC_ENTER_SPLIT2(eglGetDisplay, uint32_t, void*, display_id, error); *retval = yagl_host_eglGetDisplay(display_id, error); YAGL_LOG_FUNC_EXIT_SPLIT(yagl_host_handle, *retval); - - return true; } /* * eglInitialize dispatcher. id = 2 */ -static bool yagl_func_eglInitialize(struct yagl_transport *t) +static void yagl_func_eglInitialize(struct yagl_transport *t) { yagl_host_handle dpy; EGLint *major; @@ -73,14 +71,12 @@ static bool yagl_func_eglInitialize(struct yagl_transport *t) YAGL_LOG_FUNC_ENTER_SPLIT4(eglInitialize, yagl_host_handle, void*, void*, void*, dpy, major, minor, error); *retval = yagl_host_eglInitialize(dpy, major, minor, error); YAGL_LOG_FUNC_EXIT_SPLIT(EGLBoolean, *retval); - - return true; } /* * eglTerminate dispatcher. id = 3 */ -static bool yagl_func_eglTerminate(struct yagl_transport *t) +static void yagl_func_eglTerminate(struct yagl_transport *t) { yagl_host_handle dpy; EGLint *error; @@ -91,14 +87,12 @@ static bool yagl_func_eglTerminate(struct yagl_transport *t) YAGL_LOG_FUNC_ENTER_SPLIT2(eglTerminate, yagl_host_handle, void*, dpy, error); *retval = yagl_host_eglTerminate(dpy, error); YAGL_LOG_FUNC_EXIT_SPLIT(EGLBoolean, *retval); - - return true; } /* * eglGetConfigs dispatcher. id = 4 */ -static bool yagl_func_eglGetConfigs(struct yagl_transport *t) +static void yagl_func_eglGetConfigs(struct yagl_transport *t) { yagl_host_handle dpy; yagl_host_handle *configs; @@ -107,23 +101,19 @@ static bool yagl_func_eglGetConfigs(struct yagl_transport *t) EGLint *error; EGLBoolean *retval; dpy = yagl_transport_get_out_yagl_host_handle(t); - if (!yagl_transport_get_in_array(t, sizeof(yagl_host_handle), (void**)&configs, &configs_maxcount, &configs_count)) { - return false; - } + yagl_transport_get_in_array(t, sizeof(yagl_host_handle), (void**)&configs, &configs_maxcount, &configs_count); yagl_transport_get_in_arg(t, (void**)&error); yagl_transport_get_in_arg(t, (void**)&retval); YAGL_LOG_FUNC_ENTER_SPLIT3(eglGetConfigs, yagl_host_handle, void*, void*, dpy, configs, error); *configs_count = 0; *retval = yagl_host_eglGetConfigs(dpy, configs, configs_maxcount, configs_count, error); YAGL_LOG_FUNC_EXIT_SPLIT(EGLBoolean, *retval); - - return true; } /* * eglChooseConfig dispatcher. id = 5 */ -static bool yagl_func_eglChooseConfig(struct yagl_transport *t) +static void yagl_func_eglChooseConfig(struct yagl_transport *t) { yagl_host_handle dpy; const EGLint *attrib_list; @@ -134,26 +124,20 @@ static bool yagl_func_eglChooseConfig(struct yagl_transport *t) EGLint *error; EGLBoolean *retval; dpy = yagl_transport_get_out_yagl_host_handle(t); - if (!yagl_transport_get_out_array(t, sizeof(EGLint), (const void**)&attrib_list, &attrib_list_count)) { - return false; - } - if (!yagl_transport_get_in_array(t, sizeof(yagl_host_handle), (void**)&configs, &configs_maxcount, &configs_count)) { - return false; - } + yagl_transport_get_out_array(t, sizeof(EGLint), (const void**)&attrib_list, &attrib_list_count); + yagl_transport_get_in_array(t, sizeof(yagl_host_handle), (void**)&configs, &configs_maxcount, &configs_count); yagl_transport_get_in_arg(t, (void**)&error); yagl_transport_get_in_arg(t, (void**)&retval); YAGL_LOG_FUNC_ENTER_SPLIT4(eglChooseConfig, yagl_host_handle, void*, void*, void*, dpy, attrib_list, configs, error); *configs_count = 0; *retval = yagl_host_eglChooseConfig(dpy, attrib_list, attrib_list_count, configs, configs_maxcount, configs_count, error); YAGL_LOG_FUNC_EXIT_SPLIT(EGLBoolean, *retval); - - return true; } /* * eglGetConfigAttrib dispatcher. id = 6 */ -static bool yagl_func_eglGetConfigAttrib(struct yagl_transport *t) +static void yagl_func_eglGetConfigAttrib(struct yagl_transport *t) { yagl_host_handle dpy; yagl_host_handle config; @@ -170,14 +154,12 @@ static bool yagl_func_eglGetConfigAttrib(struct yagl_transport *t) YAGL_LOG_FUNC_ENTER_SPLIT5(eglGetConfigAttrib, yagl_host_handle, yagl_host_handle, EGLint, void*, void*, dpy, config, attribute, value, error); *retval = yagl_host_eglGetConfigAttrib(dpy, config, attribute, value, error); YAGL_LOG_FUNC_EXIT_SPLIT(EGLBoolean, *retval); - - return true; } /* * eglDestroySurface dispatcher. id = 7 */ -static bool yagl_func_eglDestroySurface(struct yagl_transport *t) +static void yagl_func_eglDestroySurface(struct yagl_transport *t) { yagl_host_handle dpy; yagl_host_handle surface; @@ -190,14 +172,12 @@ static bool yagl_func_eglDestroySurface(struct yagl_transport *t) YAGL_LOG_FUNC_ENTER_SPLIT3(eglDestroySurface, yagl_host_handle, yagl_host_handle, void*, dpy, surface, error); *retval = yagl_host_eglDestroySurface(dpy, surface, error); YAGL_LOG_FUNC_EXIT_SPLIT(EGLBoolean, *retval); - - return true; } /* * eglQuerySurface dispatcher. id = 8 */ -static bool yagl_func_eglQuerySurface(struct yagl_transport *t) +static void yagl_func_eglQuerySurface(struct yagl_transport *t) { yagl_host_handle dpy; yagl_host_handle surface; @@ -214,40 +194,34 @@ static bool yagl_func_eglQuerySurface(struct yagl_transport *t) YAGL_LOG_FUNC_ENTER_SPLIT5(eglQuerySurface, yagl_host_handle, yagl_host_handle, EGLint, void*, void*, dpy, surface, attribute, value, error); *retval = yagl_host_eglQuerySurface(dpy, surface, attribute, value, error); YAGL_LOG_FUNC_EXIT_SPLIT(EGLBoolean, *retval); - - return true; } /* * eglBindAPI dispatcher. id = 9 */ -static bool yagl_func_eglBindAPI(struct yagl_transport *t) +static void yagl_func_eglBindAPI(struct yagl_transport *t) { EGLenum api; api = yagl_transport_get_out_EGLenum(t); YAGL_LOG_FUNC_ENTER_SPLIT1(eglBindAPI, EGLenum, api); (void)yagl_host_eglBindAPI(api); YAGL_LOG_FUNC_EXIT(NULL); - - return true; } /* * eglWaitClient dispatcher. id = 10 */ -static bool yagl_func_eglWaitClient(struct yagl_transport *t) +static void yagl_func_eglWaitClient(struct yagl_transport *t) { YAGL_LOG_FUNC_ENTER_SPLIT0(eglWaitClient); (void)yagl_host_eglWaitClient(); YAGL_LOG_FUNC_EXIT(NULL); - - return true; } /* * eglReleaseThread dispatcher. id = 11 */ -static bool yagl_func_eglReleaseThread(struct yagl_transport *t) +static void yagl_func_eglReleaseThread(struct yagl_transport *t) { EGLint *error; EGLBoolean *retval; @@ -256,14 +230,12 @@ static bool yagl_func_eglReleaseThread(struct yagl_transport *t) YAGL_LOG_FUNC_ENTER_SPLIT1(eglReleaseThread, void*, error); *retval = yagl_host_eglReleaseThread(error); YAGL_LOG_FUNC_EXIT_SPLIT(EGLBoolean, *retval); - - return true; } /* * eglSurfaceAttrib dispatcher. id = 12 */ -static bool yagl_func_eglSurfaceAttrib(struct yagl_transport *t) +static void yagl_func_eglSurfaceAttrib(struct yagl_transport *t) { yagl_host_handle dpy; yagl_host_handle surface; @@ -280,14 +252,12 @@ static bool yagl_func_eglSurfaceAttrib(struct yagl_transport *t) YAGL_LOG_FUNC_ENTER_SPLIT5(eglSurfaceAttrib, yagl_host_handle, yagl_host_handle, EGLint, EGLint, void*, dpy, surface, attribute, value, error); *retval = yagl_host_eglSurfaceAttrib(dpy, surface, attribute, value, error); YAGL_LOG_FUNC_EXIT_SPLIT(EGLBoolean, *retval); - - return true; } /* * eglCreateContext dispatcher. id = 13 */ -static bool yagl_func_eglCreateContext(struct yagl_transport *t) +static void yagl_func_eglCreateContext(struct yagl_transport *t) { yagl_host_handle dpy; yagl_host_handle config; @@ -299,22 +269,18 @@ static bool yagl_func_eglCreateContext(struct yagl_transport *t) dpy = yagl_transport_get_out_yagl_host_handle(t); config = yagl_transport_get_out_yagl_host_handle(t); share_context = yagl_transport_get_out_yagl_host_handle(t); - if (!yagl_transport_get_out_array(t, sizeof(EGLint), (const void**)&attrib_list, &attrib_list_count)) { - return false; - } + yagl_transport_get_out_array(t, sizeof(EGLint), (const void**)&attrib_list, &attrib_list_count); yagl_transport_get_in_arg(t, (void**)&error); yagl_transport_get_in_arg(t, (void**)&retval); YAGL_LOG_FUNC_ENTER_SPLIT5(eglCreateContext, yagl_host_handle, yagl_host_handle, yagl_host_handle, void*, void*, dpy, config, share_context, attrib_list, error); *retval = yagl_host_eglCreateContext(dpy, config, share_context, attrib_list, attrib_list_count, error); YAGL_LOG_FUNC_EXIT_SPLIT(yagl_host_handle, *retval); - - return true; } /* * eglDestroyContext dispatcher. id = 14 */ -static bool yagl_func_eglDestroyContext(struct yagl_transport *t) +static void yagl_func_eglDestroyContext(struct yagl_transport *t) { yagl_host_handle dpy; yagl_host_handle ctx; @@ -327,14 +293,12 @@ static bool yagl_func_eglDestroyContext(struct yagl_transport *t) YAGL_LOG_FUNC_ENTER_SPLIT3(eglDestroyContext, yagl_host_handle, yagl_host_handle, void*, dpy, ctx, error); *retval = yagl_host_eglDestroyContext(dpy, ctx, error); YAGL_LOG_FUNC_EXIT_SPLIT(EGLBoolean, *retval); - - return true; } /* * eglMakeCurrent dispatcher. id = 15 */ -static bool yagl_func_eglMakeCurrent(struct yagl_transport *t) +static void yagl_func_eglMakeCurrent(struct yagl_transport *t) { yagl_host_handle dpy; yagl_host_handle draw; @@ -347,14 +311,12 @@ static bool yagl_func_eglMakeCurrent(struct yagl_transport *t) YAGL_LOG_FUNC_ENTER_SPLIT4(eglMakeCurrent, yagl_host_handle, yagl_host_handle, yagl_host_handle, yagl_host_handle, dpy, draw, read, ctx); (void)yagl_host_eglMakeCurrent(dpy, draw, read, ctx); YAGL_LOG_FUNC_EXIT(NULL); - - return true; } /* * eglQueryContext dispatcher. id = 16 */ -static bool yagl_func_eglQueryContext(struct yagl_transport *t) +static void yagl_func_eglQueryContext(struct yagl_transport *t) { yagl_host_handle dpy; yagl_host_handle ctx; @@ -371,54 +333,40 @@ static bool yagl_func_eglQueryContext(struct yagl_transport *t) YAGL_LOG_FUNC_ENTER_SPLIT5(eglQueryContext, yagl_host_handle, yagl_host_handle, EGLint, void*, void*, dpy, ctx, attribute, value, error); *retval = yagl_host_eglQueryContext(dpy, ctx, attribute, value, error); YAGL_LOG_FUNC_EXIT_SPLIT(EGLBoolean, *retval); - - return true; } /* * eglSwapBuffers dispatcher. id = 17 */ -static bool yagl_func_eglSwapBuffers(struct yagl_transport *t) +static void yagl_func_eglSwapBuffers(struct yagl_transport *t) { yagl_host_handle dpy; yagl_host_handle surface; - EGLint *error; - EGLBoolean *retval; dpy = yagl_transport_get_out_yagl_host_handle(t); surface = yagl_transport_get_out_yagl_host_handle(t); - yagl_transport_get_in_arg(t, (void**)&error); - yagl_transport_get_in_arg(t, (void**)&retval); - YAGL_LOG_FUNC_ENTER_SPLIT3(eglSwapBuffers, yagl_host_handle, yagl_host_handle, void*, dpy, surface, error); - *retval = yagl_host_eglSwapBuffers(dpy, surface, error); - YAGL_LOG_FUNC_EXIT_SPLIT(EGLBoolean, *retval); - - return true; + YAGL_LOG_FUNC_ENTER_SPLIT2(eglSwapBuffers, yagl_host_handle, yagl_host_handle, dpy, surface); + (void)yagl_host_eglSwapBuffers(dpy, surface); + YAGL_LOG_FUNC_EXIT(NULL); } /* * eglCopyBuffers dispatcher. id = 18 */ -static bool yagl_func_eglCopyBuffers(struct yagl_transport *t) +static void yagl_func_eglCopyBuffers(struct yagl_transport *t) { yagl_host_handle dpy; yagl_host_handle surface; - EGLint *error; - EGLBoolean *retval; dpy = yagl_transport_get_out_yagl_host_handle(t); surface = yagl_transport_get_out_yagl_host_handle(t); - yagl_transport_get_in_arg(t, (void**)&error); - yagl_transport_get_in_arg(t, (void**)&retval); - YAGL_LOG_FUNC_ENTER_SPLIT3(eglCopyBuffers, yagl_host_handle, yagl_host_handle, void*, dpy, surface, error); - *retval = yagl_host_eglCopyBuffers(dpy, surface, error); - YAGL_LOG_FUNC_EXIT_SPLIT(EGLBoolean, *retval); - - return true; + YAGL_LOG_FUNC_ENTER_SPLIT2(eglCopyBuffers, yagl_host_handle, yagl_host_handle, dpy, surface); + (void)yagl_host_eglCopyBuffers(dpy, surface); + YAGL_LOG_FUNC_EXIT(NULL); } /* * eglCreateWindowSurfaceOffscreenYAGL dispatcher. id = 19 */ -static bool yagl_func_eglCreateWindowSurfaceOffscreenYAGL(struct yagl_transport *t) +static void yagl_func_eglCreateWindowSurfaceOffscreenYAGL(struct yagl_transport *t) { yagl_host_handle dpy; yagl_host_handle config; @@ -436,22 +384,18 @@ static bool yagl_func_eglCreateWindowSurfaceOffscreenYAGL(struct yagl_transport height = yagl_transport_get_out_uint32_t(t); bpp = yagl_transport_get_out_uint32_t(t); pixels = yagl_transport_get_out_va(t); - if (!yagl_transport_get_out_array(t, sizeof(EGLint), (const void**)&attrib_list, &attrib_list_count)) { - return false; - } + yagl_transport_get_out_array(t, sizeof(EGLint), (const void**)&attrib_list, &attrib_list_count); yagl_transport_get_in_arg(t, (void**)&error); yagl_transport_get_in_arg(t, (void**)&retval); YAGL_LOG_FUNC_ENTER_SPLIT8(eglCreateWindowSurfaceOffscreenYAGL, yagl_host_handle, yagl_host_handle, uint32_t, uint32_t, uint32_t, target_ulong, void*, void*, dpy, config, width, height, bpp, pixels, attrib_list, error); *retval = yagl_host_eglCreateWindowSurfaceOffscreenYAGL(dpy, config, width, height, bpp, pixels, attrib_list, attrib_list_count, error); YAGL_LOG_FUNC_EXIT_SPLIT(yagl_host_handle, *retval); - - return true; } /* * eglCreatePbufferSurfaceOffscreenYAGL dispatcher. id = 20 */ -static bool yagl_func_eglCreatePbufferSurfaceOffscreenYAGL(struct yagl_transport *t) +static void yagl_func_eglCreatePbufferSurfaceOffscreenYAGL(struct yagl_transport *t) { yagl_host_handle dpy; yagl_host_handle config; @@ -469,22 +413,18 @@ static bool yagl_func_eglCreatePbufferSurfaceOffscreenYAGL(struct yagl_transport height = yagl_transport_get_out_uint32_t(t); bpp = yagl_transport_get_out_uint32_t(t); pixels = yagl_transport_get_out_va(t); - if (!yagl_transport_get_out_array(t, sizeof(EGLint), (const void**)&attrib_list, &attrib_list_count)) { - return false; - } + yagl_transport_get_out_array(t, sizeof(EGLint), (const void**)&attrib_list, &attrib_list_count); yagl_transport_get_in_arg(t, (void**)&error); yagl_transport_get_in_arg(t, (void**)&retval); YAGL_LOG_FUNC_ENTER_SPLIT8(eglCreatePbufferSurfaceOffscreenYAGL, yagl_host_handle, yagl_host_handle, uint32_t, uint32_t, uint32_t, target_ulong, void*, void*, dpy, config, width, height, bpp, pixels, attrib_list, error); *retval = yagl_host_eglCreatePbufferSurfaceOffscreenYAGL(dpy, config, width, height, bpp, pixels, attrib_list, attrib_list_count, error); YAGL_LOG_FUNC_EXIT_SPLIT(yagl_host_handle, *retval); - - return true; } /* * eglCreatePixmapSurfaceOffscreenYAGL dispatcher. id = 21 */ -static bool yagl_func_eglCreatePixmapSurfaceOffscreenYAGL(struct yagl_transport *t) +static void yagl_func_eglCreatePixmapSurfaceOffscreenYAGL(struct yagl_transport *t) { yagl_host_handle dpy; yagl_host_handle config; @@ -502,22 +442,18 @@ static bool yagl_func_eglCreatePixmapSurfaceOffscreenYAGL(struct yagl_transport height = yagl_transport_get_out_uint32_t(t); bpp = yagl_transport_get_out_uint32_t(t); pixels = yagl_transport_get_out_va(t); - if (!yagl_transport_get_out_array(t, sizeof(EGLint), (const void**)&attrib_list, &attrib_list_count)) { - return false; - } + yagl_transport_get_out_array(t, sizeof(EGLint), (const void**)&attrib_list, &attrib_list_count); yagl_transport_get_in_arg(t, (void**)&error); yagl_transport_get_in_arg(t, (void**)&retval); YAGL_LOG_FUNC_ENTER_SPLIT8(eglCreatePixmapSurfaceOffscreenYAGL, yagl_host_handle, yagl_host_handle, uint32_t, uint32_t, uint32_t, target_ulong, void*, void*, dpy, config, width, height, bpp, pixels, attrib_list, error); *retval = yagl_host_eglCreatePixmapSurfaceOffscreenYAGL(dpy, config, width, height, bpp, pixels, attrib_list, attrib_list_count, error); YAGL_LOG_FUNC_EXIT_SPLIT(yagl_host_handle, *retval); - - return true; } /* * eglResizeOffscreenSurfaceYAGL dispatcher. id = 22 */ -static bool yagl_func_eglResizeOffscreenSurfaceYAGL(struct yagl_transport *t) +static void yagl_func_eglResizeOffscreenSurfaceYAGL(struct yagl_transport *t) { yagl_host_handle dpy; yagl_host_handle surface; @@ -538,14 +474,12 @@ static bool yagl_func_eglResizeOffscreenSurfaceYAGL(struct yagl_transport *t) YAGL_LOG_FUNC_ENTER_SPLIT7(eglResizeOffscreenSurfaceYAGL, yagl_host_handle, yagl_host_handle, uint32_t, uint32_t, uint32_t, target_ulong, void*, dpy, surface, width, height, bpp, pixels, error); *retval = yagl_host_eglResizeOffscreenSurfaceYAGL(dpy, surface, width, height, bpp, pixels, error); YAGL_LOG_FUNC_EXIT_SPLIT(EGLBoolean, *retval); - - return true; } /* * eglCreateWindowSurfaceOnscreenYAGL dispatcher. id = 23 */ -static bool yagl_func_eglCreateWindowSurfaceOnscreenYAGL(struct yagl_transport *t) +static void yagl_func_eglCreateWindowSurfaceOnscreenYAGL(struct yagl_transport *t) { yagl_host_handle dpy; yagl_host_handle config; @@ -557,22 +491,18 @@ static bool yagl_func_eglCreateWindowSurfaceOnscreenYAGL(struct yagl_transport * dpy = yagl_transport_get_out_yagl_host_handle(t); config = yagl_transport_get_out_yagl_host_handle(t); win = yagl_transport_get_out_yagl_winsys_id(t); - if (!yagl_transport_get_out_array(t, sizeof(EGLint), (const void**)&attrib_list, &attrib_list_count)) { - return false; - } + yagl_transport_get_out_array(t, sizeof(EGLint), (const void**)&attrib_list, &attrib_list_count); yagl_transport_get_in_arg(t, (void**)&error); yagl_transport_get_in_arg(t, (void**)&retval); YAGL_LOG_FUNC_ENTER_SPLIT5(eglCreateWindowSurfaceOnscreenYAGL, yagl_host_handle, yagl_host_handle, yagl_winsys_id, void*, void*, dpy, config, win, attrib_list, error); *retval = yagl_host_eglCreateWindowSurfaceOnscreenYAGL(dpy, config, win, attrib_list, attrib_list_count, error); YAGL_LOG_FUNC_EXIT_SPLIT(yagl_host_handle, *retval); - - return true; } /* * eglCreatePbufferSurfaceOnscreenYAGL dispatcher. id = 24 */ -static bool yagl_func_eglCreatePbufferSurfaceOnscreenYAGL(struct yagl_transport *t) +static void yagl_func_eglCreatePbufferSurfaceOnscreenYAGL(struct yagl_transport *t) { yagl_host_handle dpy; yagl_host_handle config; @@ -584,22 +514,18 @@ static bool yagl_func_eglCreatePbufferSurfaceOnscreenYAGL(struct yagl_transport dpy = yagl_transport_get_out_yagl_host_handle(t); config = yagl_transport_get_out_yagl_host_handle(t); buffer = yagl_transport_get_out_yagl_winsys_id(t); - if (!yagl_transport_get_out_array(t, sizeof(EGLint), (const void**)&attrib_list, &attrib_list_count)) { - return false; - } + yagl_transport_get_out_array(t, sizeof(EGLint), (const void**)&attrib_list, &attrib_list_count); yagl_transport_get_in_arg(t, (void**)&error); yagl_transport_get_in_arg(t, (void**)&retval); YAGL_LOG_FUNC_ENTER_SPLIT5(eglCreatePbufferSurfaceOnscreenYAGL, yagl_host_handle, yagl_host_handle, yagl_winsys_id, void*, void*, dpy, config, buffer, attrib_list, error); *retval = yagl_host_eglCreatePbufferSurfaceOnscreenYAGL(dpy, config, buffer, attrib_list, attrib_list_count, error); YAGL_LOG_FUNC_EXIT_SPLIT(yagl_host_handle, *retval); - - return true; } /* * eglCreatePixmapSurfaceOnscreenYAGL dispatcher. id = 25 */ -static bool yagl_func_eglCreatePixmapSurfaceOnscreenYAGL(struct yagl_transport *t) +static void yagl_func_eglCreatePixmapSurfaceOnscreenYAGL(struct yagl_transport *t) { yagl_host_handle dpy; yagl_host_handle config; @@ -611,22 +537,18 @@ static bool yagl_func_eglCreatePixmapSurfaceOnscreenYAGL(struct yagl_transport * dpy = yagl_transport_get_out_yagl_host_handle(t); config = yagl_transport_get_out_yagl_host_handle(t); pixmap = yagl_transport_get_out_yagl_winsys_id(t); - if (!yagl_transport_get_out_array(t, sizeof(EGLint), (const void**)&attrib_list, &attrib_list_count)) { - return false; - } + yagl_transport_get_out_array(t, sizeof(EGLint), (const void**)&attrib_list, &attrib_list_count); yagl_transport_get_in_arg(t, (void**)&error); yagl_transport_get_in_arg(t, (void**)&retval); YAGL_LOG_FUNC_ENTER_SPLIT5(eglCreatePixmapSurfaceOnscreenYAGL, yagl_host_handle, yagl_host_handle, yagl_winsys_id, void*, void*, dpy, config, pixmap, attrib_list, error); *retval = yagl_host_eglCreatePixmapSurfaceOnscreenYAGL(dpy, config, pixmap, attrib_list, attrib_list_count, error); YAGL_LOG_FUNC_EXIT_SPLIT(yagl_host_handle, *retval); - - return true; } /* * eglInvalidateOnscreenSurfaceYAGL dispatcher. id = 26 */ -static bool yagl_func_eglInvalidateOnscreenSurfaceYAGL(struct yagl_transport *t) +static void yagl_func_eglInvalidateOnscreenSurfaceYAGL(struct yagl_transport *t) { yagl_host_handle dpy; yagl_host_handle surface; @@ -637,14 +559,12 @@ static bool yagl_func_eglInvalidateOnscreenSurfaceYAGL(struct yagl_transport *t) YAGL_LOG_FUNC_ENTER_SPLIT3(eglInvalidateOnscreenSurfaceYAGL, yagl_host_handle, yagl_host_handle, yagl_winsys_id, dpy, surface, buffer); (void)yagl_host_eglInvalidateOnscreenSurfaceYAGL(dpy, surface, buffer); YAGL_LOG_FUNC_EXIT(NULL); - - return true; } /* * eglCreateImageYAGL dispatcher. id = 27 */ -static bool yagl_func_eglCreateImageYAGL(struct yagl_transport *t) +static void yagl_func_eglCreateImageYAGL(struct yagl_transport *t) { uint32_t texture; yagl_host_handle dpy; @@ -659,8 +579,6 @@ static bool yagl_func_eglCreateImageYAGL(struct yagl_transport *t) YAGL_LOG_FUNC_ENTER_SPLIT4(eglCreateImageYAGL, uint32_t, yagl_host_handle, yagl_winsys_id, void*, texture, dpy, buffer, error); *retval = yagl_host_eglCreateImageYAGL(texture, dpy, buffer, error); YAGL_LOG_FUNC_EXIT_SPLIT(EGLBoolean, *retval); - - return true; } const uint32_t yagl_egl_api_num_funcs = 27; diff --git a/hw/yagl/yagl_apis/egl/yagl_host_egl_calls.c b/hw/yagl/yagl_apis/egl/yagl_host_egl_calls.c index 23c18b5..7a883b0 100644 --- a/hw/yagl/yagl_apis/egl/yagl_host_egl_calls.c +++ b/hw/yagl/yagl_apis/egl/yagl_host_egl_calls.c @@ -1088,66 +1088,46 @@ out: return res; } -EGLBoolean yagl_host_eglSwapBuffers(yagl_host_handle dpy_, - yagl_host_handle surface_, - EGLint *error) +void yagl_host_eglSwapBuffers(yagl_host_handle dpy_, + yagl_host_handle surface_) { - EGLBoolean res = EGL_FALSE; + EGLint error = 0; struct yagl_egl_display *dpy = NULL; struct yagl_egl_surface *surface = NULL; - YAGL_LOG_FUNC_SET(eglSwapBuffers); - - if (!yagl_validate_display(dpy_, &dpy, error)) { - goto out; - } - - if (!yagl_validate_surface(dpy, surface_, &surface, error)) { + if (!yagl_validate_display(dpy_, &dpy, &error)) { goto out; } - if (!surface->backend_sfc->swap_buffers(surface->backend_sfc)) { - YAGL_SET_ERR(EGL_BAD_ALLOC); + if (!yagl_validate_surface(dpy, surface_, &surface, &error)) { goto out; } - res = EGL_TRUE; + surface->backend_sfc->swap_buffers(surface->backend_sfc); out: yagl_egl_surface_release(surface); - - return res; } -EGLBoolean yagl_host_eglCopyBuffers(yagl_host_handle dpy_, - yagl_host_handle surface_, - EGLint *error) +void yagl_host_eglCopyBuffers(yagl_host_handle dpy_, + yagl_host_handle surface_) { - EGLBoolean res = EGL_FALSE; + EGLint error = 0; struct yagl_egl_display *dpy = NULL; struct yagl_egl_surface *surface = NULL; - YAGL_LOG_FUNC_SET(eglCopyBuffers); - - if (!yagl_validate_display(dpy_, &dpy, error)) { - goto out; - } - - if (!yagl_validate_surface(dpy, surface_, &surface, error)) { + if (!yagl_validate_display(dpy_, &dpy, &error)) { goto out; } - if (!surface->backend_sfc->copy_buffers(surface->backend_sfc)) { - YAGL_SET_ERR(EGL_BAD_NATIVE_PIXMAP); + if (!yagl_validate_surface(dpy, surface_, &surface, &error)) { goto out; } - res = EGL_TRUE; + surface->backend_sfc->copy_buffers(surface->backend_sfc); out: yagl_egl_surface_release(surface); - - return res; } yagl_host_handle yagl_host_eglCreateWindowSurfaceOffscreenYAGL(yagl_host_handle dpy_, diff --git a/hw/yagl/yagl_apis/egl/yagl_host_egl_calls.h b/hw/yagl/yagl_apis/egl/yagl_host_egl_calls.h index 306c117..e110a91 100644 --- a/hw/yagl/yagl_apis/egl/yagl_host_egl_calls.h +++ b/hw/yagl/yagl_apis/egl/yagl_host_egl_calls.h @@ -88,12 +88,10 @@ EGLBoolean yagl_host_eglQueryContext(yagl_host_handle dpy, EGLint attribute, EGLint *value, EGLint *error); -EGLBoolean yagl_host_eglSwapBuffers(yagl_host_handle dpy, - yagl_host_handle surface, - EGLint *error); -EGLBoolean yagl_host_eglCopyBuffers(yagl_host_handle dpy, - yagl_host_handle surface, - EGLint *error); +void yagl_host_eglSwapBuffers(yagl_host_handle dpy, + yagl_host_handle surface); +void yagl_host_eglCopyBuffers(yagl_host_handle dpy, + yagl_host_handle surface); yagl_host_handle yagl_host_eglCreateWindowSurfaceOffscreenYAGL(yagl_host_handle dpy, yagl_host_handle config, uint32_t width, diff --git a/hw/yagl/yagl_apis/gles/yagl_gles_calls.c b/hw/yagl/yagl_apis/gles/yagl_gles_calls.c index b9ad656..d0139a8 100644 --- a/hw/yagl/yagl_apis/gles/yagl_gles_calls.c +++ b/hw/yagl/yagl_apis/gles/yagl_gles_calls.c @@ -40,7 +40,7 @@ /* * glDrawArrays dispatcher. id = 1 */ -static bool yagl_func_glDrawArrays(struct yagl_transport *t) +static void yagl_func_glDrawArrays(struct yagl_transport *t) { GLenum mode; GLint first; @@ -51,14 +51,12 @@ static bool yagl_func_glDrawArrays(struct yagl_transport *t) YAGL_LOG_FUNC_ENTER_SPLIT3(glDrawArrays, GLenum, GLint, GLsizei, mode, first, count); (void)yagl_host_glDrawArrays(mode, first, count); YAGL_LOG_FUNC_EXIT(NULL); - - return true; } /* * glDrawElements dispatcher. id = 2 */ -static bool yagl_func_glDrawElements(struct yagl_transport *t) +static void yagl_func_glDrawElements(struct yagl_transport *t) { GLenum mode; GLsizei count; @@ -68,20 +66,16 @@ static bool yagl_func_glDrawElements(struct yagl_transport *t) mode = yagl_transport_get_out_GLenum(t); count = yagl_transport_get_out_GLsizei(t); type = yagl_transport_get_out_GLenum(t); - if (!yagl_transport_get_out_array(t, 1, (const void**)&indices, &indices_count)) { - return false; - } + yagl_transport_get_out_array(t, 1, (const void**)&indices, &indices_count); YAGL_LOG_FUNC_ENTER_SPLIT4(glDrawElements, GLenum, GLsizei, GLenum, void*, mode, count, type, indices); (void)yagl_host_glDrawElements(mode, count, type, indices, indices_count); YAGL_LOG_FUNC_EXIT(NULL); - - return true; } /* * glReadPixels dispatcher. id = 3 */ -static bool yagl_func_glReadPixels(struct yagl_transport *t) +static void yagl_func_glReadPixels(struct yagl_transport *t) { GLint x; GLint y; @@ -98,49 +92,41 @@ static bool yagl_func_glReadPixels(struct yagl_transport *t) height = yagl_transport_get_out_GLsizei(t); format = yagl_transport_get_out_GLenum(t); type = yagl_transport_get_out_GLenum(t); - if (!yagl_transport_get_in_array(t, 1, (void**)&pixels, &pixels_maxcount, &pixels_count)) { - return false; - } + yagl_transport_get_in_array(t, 1, (void**)&pixels, &pixels_maxcount, &pixels_count); YAGL_LOG_FUNC_ENTER_SPLIT7(glReadPixels, GLint, GLint, GLsizei, GLsizei, GLenum, GLenum, void*, x, y, width, height, format, type, pixels); *pixels_count = 0; (void)yagl_host_glReadPixels(x, y, width, height, format, type, pixels, pixels_maxcount, pixels_count); YAGL_LOG_FUNC_EXIT(NULL); - - return true; } /* * glDisableVertexAttribArray dispatcher. id = 4 */ -static bool yagl_func_glDisableVertexAttribArray(struct yagl_transport *t) +static void yagl_func_glDisableVertexAttribArray(struct yagl_transport *t) { GLuint index; index = yagl_transport_get_out_GLuint(t); YAGL_LOG_FUNC_ENTER_SPLIT1(glDisableVertexAttribArray, GLuint, index); (void)yagl_host_glDisableVertexAttribArray(index); YAGL_LOG_FUNC_EXIT(NULL); - - return true; } /* * glEnableVertexAttribArray dispatcher. id = 5 */ -static bool yagl_func_glEnableVertexAttribArray(struct yagl_transport *t) +static void yagl_func_glEnableVertexAttribArray(struct yagl_transport *t) { GLuint index; index = yagl_transport_get_out_GLuint(t); YAGL_LOG_FUNC_ENTER_SPLIT1(glEnableVertexAttribArray, GLuint, index); (void)yagl_host_glEnableVertexAttribArray(index); YAGL_LOG_FUNC_EXIT(NULL); - - return true; } /* * glVertexAttribPointerData dispatcher. id = 6 */ -static bool yagl_func_glVertexAttribPointerData(struct yagl_transport *t) +static void yagl_func_glVertexAttribPointerData(struct yagl_transport *t) { GLuint indx; GLint size; @@ -156,20 +142,16 @@ static bool yagl_func_glVertexAttribPointerData(struct yagl_transport *t) normalized = yagl_transport_get_out_GLboolean(t); stride = yagl_transport_get_out_GLsizei(t); first = yagl_transport_get_out_GLint(t); - if (!yagl_transport_get_out_array(t, 1, (const void**)&data, &data_count)) { - return false; - } + yagl_transport_get_out_array(t, 1, (const void**)&data, &data_count); YAGL_LOG_FUNC_ENTER_SPLIT7(glVertexAttribPointerData, GLuint, GLint, GLenum, GLboolean, GLsizei, GLint, void*, indx, size, type, normalized, stride, first, data); (void)yagl_host_glVertexAttribPointerData(indx, size, type, normalized, stride, first, data, data_count); YAGL_LOG_FUNC_EXIT(NULL); - - return true; } /* * glVertexAttribPointerOffset dispatcher. id = 7 */ -static bool yagl_func_glVertexAttribPointerOffset(struct yagl_transport *t) +static void yagl_func_glVertexAttribPointerOffset(struct yagl_transport *t) { GLuint indx; GLint size; @@ -186,14 +168,12 @@ static bool yagl_func_glVertexAttribPointerOffset(struct yagl_transport *t) YAGL_LOG_FUNC_ENTER_SPLIT6(glVertexAttribPointerOffset, GLuint, GLint, GLenum, GLboolean, GLsizei, GLsizei, indx, size, type, normalized, stride, offset); (void)yagl_host_glVertexAttribPointerOffset(indx, size, type, normalized, stride, offset); YAGL_LOG_FUNC_EXIT(NULL); - - return true; } /* * glVertexPointerData dispatcher. id = 8 */ -static bool yagl_func_glVertexPointerData(struct yagl_transport *t) +static void yagl_func_glVertexPointerData(struct yagl_transport *t) { GLint size; GLenum type; @@ -205,20 +185,16 @@ static bool yagl_func_glVertexPointerData(struct yagl_transport *t) type = yagl_transport_get_out_GLenum(t); stride = yagl_transport_get_out_GLsizei(t); first = yagl_transport_get_out_GLint(t); - if (!yagl_transport_get_out_array(t, 1, (const void**)&data, &data_count)) { - return false; - } + yagl_transport_get_out_array(t, 1, (const void**)&data, &data_count); YAGL_LOG_FUNC_ENTER_SPLIT5(glVertexPointerData, GLint, GLenum, GLsizei, GLint, void*, size, type, stride, first, data); (void)yagl_host_glVertexPointerData(size, type, stride, first, data, data_count); YAGL_LOG_FUNC_EXIT(NULL); - - return true; } /* * glVertexPointerOffset dispatcher. id = 9 */ -static bool yagl_func_glVertexPointerOffset(struct yagl_transport *t) +static void yagl_func_glVertexPointerOffset(struct yagl_transport *t) { GLint size; GLenum type; @@ -231,14 +207,12 @@ static bool yagl_func_glVertexPointerOffset(struct yagl_transport *t) YAGL_LOG_FUNC_ENTER_SPLIT4(glVertexPointerOffset, GLint, GLenum, GLsizei, GLsizei, size, type, stride, offset); (void)yagl_host_glVertexPointerOffset(size, type, stride, offset); YAGL_LOG_FUNC_EXIT(NULL); - - return true; } /* * glNormalPointerData dispatcher. id = 10 */ -static bool yagl_func_glNormalPointerData(struct yagl_transport *t) +static void yagl_func_glNormalPointerData(struct yagl_transport *t) { GLenum type; GLsizei stride; @@ -248,20 +222,16 @@ static bool yagl_func_glNormalPointerData(struct yagl_transport *t) type = yagl_transport_get_out_GLenum(t); stride = yagl_transport_get_out_GLsizei(t); first = yagl_transport_get_out_GLint(t); - if (!yagl_transport_get_out_array(t, 1, (const void**)&data, &data_count)) { - return false; - } + yagl_transport_get_out_array(t, 1, (const void**)&data, &data_count); YAGL_LOG_FUNC_ENTER_SPLIT4(glNormalPointerData, GLenum, GLsizei, GLint, void*, type, stride, first, data); (void)yagl_host_glNormalPointerData(type, stride, first, data, data_count); YAGL_LOG_FUNC_EXIT(NULL); - - return true; } /* * glNormalPointerOffset dispatcher. id = 11 */ -static bool yagl_func_glNormalPointerOffset(struct yagl_transport *t) +static void yagl_func_glNormalPointerOffset(struct yagl_transport *t) { GLenum type; GLsizei stride; @@ -272,14 +242,12 @@ static bool yagl_func_glNormalPointerOffset(struct yagl_transport *t) YAGL_LOG_FUNC_ENTER_SPLIT3(glNormalPointerOffset, GLenum, GLsizei, GLsizei, type, stride, offset); (void)yagl_host_glNormalPointerOffset(type, stride, offset); YAGL_LOG_FUNC_EXIT(NULL); - - return true; } /* * glColorPointerData dispatcher. id = 12 */ -static bool yagl_func_glColorPointerData(struct yagl_transport *t) +static void yagl_func_glColorPointerData(struct yagl_transport *t) { GLint size; GLenum type; @@ -291,20 +259,16 @@ static bool yagl_func_glColorPointerData(struct yagl_transport *t) type = yagl_transport_get_out_GLenum(t); stride = yagl_transport_get_out_GLsizei(t); first = yagl_transport_get_out_GLint(t); - if (!yagl_transport_get_out_array(t, 1, (const void**)&data, &data_count)) { - return false; - } + yagl_transport_get_out_array(t, 1, (const void**)&data, &data_count); YAGL_LOG_FUNC_ENTER_SPLIT5(glColorPointerData, GLint, GLenum, GLsizei, GLint, void*, size, type, stride, first, data); (void)yagl_host_glColorPointerData(size, type, stride, first, data, data_count); YAGL_LOG_FUNC_EXIT(NULL); - - return true; } /* * glColorPointerOffset dispatcher. id = 13 */ -static bool yagl_func_glColorPointerOffset(struct yagl_transport *t) +static void yagl_func_glColorPointerOffset(struct yagl_transport *t) { GLint size; GLenum type; @@ -317,14 +281,12 @@ static bool yagl_func_glColorPointerOffset(struct yagl_transport *t) YAGL_LOG_FUNC_ENTER_SPLIT4(glColorPointerOffset, GLint, GLenum, GLsizei, GLsizei, size, type, stride, offset); (void)yagl_host_glColorPointerOffset(size, type, stride, offset); YAGL_LOG_FUNC_EXIT(NULL); - - return true; } /* * glTexCoordPointerData dispatcher. id = 14 */ -static bool yagl_func_glTexCoordPointerData(struct yagl_transport *t) +static void yagl_func_glTexCoordPointerData(struct yagl_transport *t) { GLint tex_id; GLint size; @@ -338,20 +300,16 @@ static bool yagl_func_glTexCoordPointerData(struct yagl_transport *t) type = yagl_transport_get_out_GLenum(t); stride = yagl_transport_get_out_GLsizei(t); first = yagl_transport_get_out_GLint(t); - if (!yagl_transport_get_out_array(t, 1, (const void**)&data, &data_count)) { - return false; - } + yagl_transport_get_out_array(t, 1, (const void**)&data, &data_count); YAGL_LOG_FUNC_ENTER_SPLIT6(glTexCoordPointerData, GLint, GLint, GLenum, GLsizei, GLint, void*, tex_id, size, type, stride, first, data); (void)yagl_host_glTexCoordPointerData(tex_id, size, type, stride, first, data, data_count); YAGL_LOG_FUNC_EXIT(NULL); - - return true; } /* * glTexCoordPointerOffset dispatcher. id = 15 */ -static bool yagl_func_glTexCoordPointerOffset(struct yagl_transport *t) +static void yagl_func_glTexCoordPointerOffset(struct yagl_transport *t) { GLint size; GLenum type; @@ -364,59 +322,49 @@ static bool yagl_func_glTexCoordPointerOffset(struct yagl_transport *t) YAGL_LOG_FUNC_ENTER_SPLIT4(glTexCoordPointerOffset, GLint, GLenum, GLsizei, GLsizei, size, type, stride, offset); (void)yagl_host_glTexCoordPointerOffset(size, type, stride, offset); YAGL_LOG_FUNC_EXIT(NULL); - - return true; } /* * glDisableClientState dispatcher. id = 16 */ -static bool yagl_func_glDisableClientState(struct yagl_transport *t) +static void yagl_func_glDisableClientState(struct yagl_transport *t) { GLenum array; array = yagl_transport_get_out_GLenum(t); YAGL_LOG_FUNC_ENTER_SPLIT1(glDisableClientState, GLenum, array); (void)yagl_host_glDisableClientState(array); YAGL_LOG_FUNC_EXIT(NULL); - - return true; } /* * glEnableClientState dispatcher. id = 17 */ -static bool yagl_func_glEnableClientState(struct yagl_transport *t) +static void yagl_func_glEnableClientState(struct yagl_transport *t) { GLenum array; array = yagl_transport_get_out_GLenum(t); YAGL_LOG_FUNC_ENTER_SPLIT1(glEnableClientState, GLenum, array); (void)yagl_host_glEnableClientState(array); YAGL_LOG_FUNC_EXIT(NULL); - - return true; } /* * glGenBuffers dispatcher. id = 18 */ -static bool yagl_func_glGenBuffers(struct yagl_transport *t) +static void yagl_func_glGenBuffers(struct yagl_transport *t) { const GLuint *buffers; int32_t buffers_count; - if (!yagl_transport_get_out_array(t, sizeof(GLuint), (const void**)&buffers, &buffers_count)) { - return false; - } + yagl_transport_get_out_array(t, sizeof(GLuint), (const void**)&buffers, &buffers_count); YAGL_LOG_FUNC_ENTER_SPLIT1(glGenBuffers, void*, buffers); (void)yagl_host_glGenBuffers(buffers, buffers_count); YAGL_LOG_FUNC_EXIT(NULL); - - return true; } /* * glBindBuffer dispatcher. id = 19 */ -static bool yagl_func_glBindBuffer(struct yagl_transport *t) +static void yagl_func_glBindBuffer(struct yagl_transport *t) { GLenum target; GLuint buffer; @@ -425,35 +373,29 @@ static bool yagl_func_glBindBuffer(struct yagl_transport *t) YAGL_LOG_FUNC_ENTER_SPLIT2(glBindBuffer, GLenum, GLuint, target, buffer); (void)yagl_host_glBindBuffer(target, buffer); YAGL_LOG_FUNC_EXIT(NULL); - - return true; } /* * glBufferData dispatcher. id = 20 */ -static bool yagl_func_glBufferData(struct yagl_transport *t) +static void yagl_func_glBufferData(struct yagl_transport *t) { GLenum target; const GLvoid *data; int32_t data_count; GLenum usage; target = yagl_transport_get_out_GLenum(t); - if (!yagl_transport_get_out_array(t, 1, (const void**)&data, &data_count)) { - return false; - } + yagl_transport_get_out_array(t, 1, (const void**)&data, &data_count); usage = yagl_transport_get_out_GLenum(t); YAGL_LOG_FUNC_ENTER_SPLIT3(glBufferData, GLenum, void*, GLenum, target, data, usage); (void)yagl_host_glBufferData(target, data, data_count, usage); YAGL_LOG_FUNC_EXIT(NULL); - - return true; } /* * glBufferSubData dispatcher. id = 21 */ -static bool yagl_func_glBufferSubData(struct yagl_transport *t) +static void yagl_func_glBufferSubData(struct yagl_transport *t) { GLenum target; GLsizei offset; @@ -461,37 +403,29 @@ static bool yagl_func_glBufferSubData(struct yagl_transport *t) int32_t data_count; target = yagl_transport_get_out_GLenum(t); offset = yagl_transport_get_out_GLsizei(t); - if (!yagl_transport_get_out_array(t, 1, (const void**)&data, &data_count)) { - return false; - } + yagl_transport_get_out_array(t, 1, (const void**)&data, &data_count); YAGL_LOG_FUNC_ENTER_SPLIT3(glBufferSubData, GLenum, GLsizei, void*, target, offset, data); (void)yagl_host_glBufferSubData(target, offset, data, data_count); YAGL_LOG_FUNC_EXIT(NULL); - - return true; } /* * glGenTextures dispatcher. id = 22 */ -static bool yagl_func_glGenTextures(struct yagl_transport *t) +static void yagl_func_glGenTextures(struct yagl_transport *t) { const GLuint *textures; int32_t textures_count; - if (!yagl_transport_get_out_array(t, sizeof(GLuint), (const void**)&textures, &textures_count)) { - return false; - } + yagl_transport_get_out_array(t, sizeof(GLuint), (const void**)&textures, &textures_count); YAGL_LOG_FUNC_ENTER_SPLIT1(glGenTextures, void*, textures); (void)yagl_host_glGenTextures(textures, textures_count); YAGL_LOG_FUNC_EXIT(NULL); - - return true; } /* * glBindTexture dispatcher. id = 23 */ -static bool yagl_func_glBindTexture(struct yagl_transport *t) +static void yagl_func_glBindTexture(struct yagl_transport *t) { GLenum target; GLuint texture; @@ -500,28 +434,24 @@ static bool yagl_func_glBindTexture(struct yagl_transport *t) YAGL_LOG_FUNC_ENTER_SPLIT2(glBindTexture, GLenum, GLuint, target, texture); (void)yagl_host_glBindTexture(target, texture); YAGL_LOG_FUNC_EXIT(NULL); - - return true; } /* * glActiveTexture dispatcher. id = 24 */ -static bool yagl_func_glActiveTexture(struct yagl_transport *t) +static void yagl_func_glActiveTexture(struct yagl_transport *t) { GLenum texture; texture = yagl_transport_get_out_GLenum(t); YAGL_LOG_FUNC_ENTER_SPLIT1(glActiveTexture, GLenum, texture); (void)yagl_host_glActiveTexture(texture); YAGL_LOG_FUNC_EXIT(NULL); - - return true; } /* * glCompressedTexImage2D dispatcher. id = 25 */ -static bool yagl_func_glCompressedTexImage2D(struct yagl_transport *t) +static void yagl_func_glCompressedTexImage2D(struct yagl_transport *t) { GLenum target; GLint level; @@ -537,20 +467,16 @@ static bool yagl_func_glCompressedTexImage2D(struct yagl_transport *t) width = yagl_transport_get_out_GLsizei(t); height = yagl_transport_get_out_GLsizei(t); border = yagl_transport_get_out_GLint(t); - if (!yagl_transport_get_out_array(t, 1, (const void**)&data, &data_count)) { - return false; - } + yagl_transport_get_out_array(t, 1, (const void**)&data, &data_count); YAGL_LOG_FUNC_ENTER_SPLIT7(glCompressedTexImage2D, GLenum, GLint, GLenum, GLsizei, GLsizei, GLint, void*, target, level, internalformat, width, height, border, data); (void)yagl_host_glCompressedTexImage2D(target, level, internalformat, width, height, border, data, data_count); YAGL_LOG_FUNC_EXIT(NULL); - - return true; } /* * glCompressedTexSubImage2D dispatcher. id = 26 */ -static bool yagl_func_glCompressedTexSubImage2D(struct yagl_transport *t) +static void yagl_func_glCompressedTexSubImage2D(struct yagl_transport *t) { GLenum target; GLint level; @@ -568,20 +494,16 @@ static bool yagl_func_glCompressedTexSubImage2D(struct yagl_transport *t) width = yagl_transport_get_out_GLsizei(t); height = yagl_transport_get_out_GLsizei(t); format = yagl_transport_get_out_GLenum(t); - if (!yagl_transport_get_out_array(t, 1, (const void**)&data, &data_count)) { - return false; - } + yagl_transport_get_out_array(t, 1, (const void**)&data, &data_count); YAGL_LOG_FUNC_ENTER_SPLIT8(glCompressedTexSubImage2D, GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, void*, target, level, xoffset, yoffset, width, height, format, data); (void)yagl_host_glCompressedTexSubImage2D(target, level, xoffset, yoffset, width, height, format, data, data_count); YAGL_LOG_FUNC_EXIT(NULL); - - return true; } /* * glCopyTexImage2D dispatcher. id = 27 */ -static bool yagl_func_glCopyTexImage2D(struct yagl_transport *t) +static void yagl_func_glCopyTexImage2D(struct yagl_transport *t) { GLenum target; GLint level; @@ -602,14 +524,12 @@ static bool yagl_func_glCopyTexImage2D(struct yagl_transport *t) YAGL_LOG_FUNC_ENTER_SPLIT8(glCopyTexImage2D, GLenum, GLint, GLenum, GLint, GLint, GLsizei, GLsizei, GLint, target, level, internalformat, x, y, width, height, border); (void)yagl_host_glCopyTexImage2D(target, level, internalformat, x, y, width, height, border); YAGL_LOG_FUNC_EXIT(NULL); - - return true; } /* * glCopyTexSubImage2D dispatcher. id = 28 */ -static bool yagl_func_glCopyTexSubImage2D(struct yagl_transport *t) +static void yagl_func_glCopyTexSubImage2D(struct yagl_transport *t) { GLenum target; GLint level; @@ -630,14 +550,12 @@ static bool yagl_func_glCopyTexSubImage2D(struct yagl_transport *t) YAGL_LOG_FUNC_ENTER_SPLIT8(glCopyTexSubImage2D, GLenum, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei, target, level, xoffset, yoffset, x, y, width, height); (void)yagl_host_glCopyTexSubImage2D(target, level, xoffset, yoffset, x, y, width, height); YAGL_LOG_FUNC_EXIT(NULL); - - return true; } /* * glGetTexParameterfv dispatcher. id = 29 */ -static bool yagl_func_glGetTexParameterfv(struct yagl_transport *t) +static void yagl_func_glGetTexParameterfv(struct yagl_transport *t) { GLenum target; GLenum pname; @@ -648,14 +566,12 @@ static bool yagl_func_glGetTexParameterfv(struct yagl_transport *t) YAGL_LOG_FUNC_ENTER_SPLIT3(glGetTexParameterfv, GLenum, GLenum, void*, target, pname, param); (void)yagl_host_glGetTexParameterfv(target, pname, param); YAGL_LOG_FUNC_EXIT(NULL); - - return true; } /* * glGetTexParameteriv dispatcher. id = 30 */ -static bool yagl_func_glGetTexParameteriv(struct yagl_transport *t) +static void yagl_func_glGetTexParameteriv(struct yagl_transport *t) { GLenum target; GLenum pname; @@ -666,14 +582,12 @@ static bool yagl_func_glGetTexParameteriv(struct yagl_transport *t) YAGL_LOG_FUNC_ENTER_SPLIT3(glGetTexParameteriv, GLenum, GLenum, void*, target, pname, param); (void)yagl_host_glGetTexParameteriv(target, pname, param); YAGL_LOG_FUNC_EXIT(NULL); - - return true; } /* * glTexImage2D dispatcher. id = 31 */ -static bool yagl_func_glTexImage2D(struct yagl_transport *t) +static void yagl_func_glTexImage2D(struct yagl_transport *t) { GLenum target; GLint level; @@ -693,20 +607,16 @@ static bool yagl_func_glTexImage2D(struct yagl_transport *t) border = yagl_transport_get_out_GLint(t); format = yagl_transport_get_out_GLenum(t); type = yagl_transport_get_out_GLenum(t); - if (!yagl_transport_get_out_array(t, 1, (const void**)&pixels, &pixels_count)) { - return false; - } + yagl_transport_get_out_array(t, 1, (const void**)&pixels, &pixels_count); YAGL_LOG_FUNC_ENTER_SPLIT9(glTexImage2D, GLenum, GLint, GLint, GLsizei, GLsizei, GLint, GLenum, GLenum, void*, target, level, internalformat, width, height, border, format, type, pixels); (void)yagl_host_glTexImage2D(target, level, internalformat, width, height, border, format, type, pixels, pixels_count); YAGL_LOG_FUNC_EXIT(NULL); - - return true; } /* * glTexParameterf dispatcher. id = 32 */ -static bool yagl_func_glTexParameterf(struct yagl_transport *t) +static void yagl_func_glTexParameterf(struct yagl_transport *t) { GLenum target; GLenum pname; @@ -717,14 +627,12 @@ static bool yagl_func_glTexParameterf(struct yagl_transport *t) YAGL_LOG_FUNC_ENTER_SPLIT3(glTexParameterf, GLenum, GLenum, GLfloat, target, pname, param); (void)yagl_host_glTexParameterf(target, pname, param); YAGL_LOG_FUNC_EXIT(NULL); - - return true; } /* * glTexParameterfv dispatcher. id = 33 */ -static bool yagl_func_glTexParameterfv(struct yagl_transport *t) +static void yagl_func_glTexParameterfv(struct yagl_transport *t) { GLenum target; GLenum pname; @@ -732,20 +640,16 @@ static bool yagl_func_glTexParameterfv(struct yagl_transport *t) int32_t params_count; target = yagl_transport_get_out_GLenum(t); pname = yagl_transport_get_out_GLenum(t); - if (!yagl_transport_get_out_array(t, sizeof(GLfloat), (const void**)¶ms, ¶ms_count)) { - return false; - } + yagl_transport_get_out_array(t, sizeof(GLfloat), (const void**)¶ms, ¶ms_count); YAGL_LOG_FUNC_ENTER_SPLIT3(glTexParameterfv, GLenum, GLenum, void*, target, pname, params); (void)yagl_host_glTexParameterfv(target, pname, params, params_count); YAGL_LOG_FUNC_EXIT(NULL); - - return true; } /* * glTexParameteri dispatcher. id = 34 */ -static bool yagl_func_glTexParameteri(struct yagl_transport *t) +static void yagl_func_glTexParameteri(struct yagl_transport *t) { GLenum target; GLenum pname; @@ -756,14 +660,12 @@ static bool yagl_func_glTexParameteri(struct yagl_transport *t) YAGL_LOG_FUNC_ENTER_SPLIT3(glTexParameteri, GLenum, GLenum, GLint, target, pname, param); (void)yagl_host_glTexParameteri(target, pname, param); YAGL_LOG_FUNC_EXIT(NULL); - - return true; } /* * glTexParameteriv dispatcher. id = 35 */ -static bool yagl_func_glTexParameteriv(struct yagl_transport *t) +static void yagl_func_glTexParameteriv(struct yagl_transport *t) { GLenum target; GLenum pname; @@ -771,20 +673,16 @@ static bool yagl_func_glTexParameteriv(struct yagl_transport *t) int32_t params_count; target = yagl_transport_get_out_GLenum(t); pname = yagl_transport_get_out_GLenum(t); - if (!yagl_transport_get_out_array(t, sizeof(GLint), (const void**)¶ms, ¶ms_count)) { - return false; - } + yagl_transport_get_out_array(t, sizeof(GLint), (const void**)¶ms, ¶ms_count); YAGL_LOG_FUNC_ENTER_SPLIT3(glTexParameteriv, GLenum, GLenum, void*, target, pname, params); (void)yagl_host_glTexParameteriv(target, pname, params, params_count); YAGL_LOG_FUNC_EXIT(NULL); - - return true; } /* * glTexSubImage2D dispatcher. id = 36 */ -static bool yagl_func_glTexSubImage2D(struct yagl_transport *t) +static void yagl_func_glTexSubImage2D(struct yagl_transport *t) { GLenum target; GLint level; @@ -804,34 +702,28 @@ static bool yagl_func_glTexSubImage2D(struct yagl_transport *t) height = yagl_transport_get_out_GLsizei(t); format = yagl_transport_get_out_GLenum(t); type = yagl_transport_get_out_GLenum(t); - if (!yagl_transport_get_out_array(t, 1, (const void**)&pixels, &pixels_count)) { - return false; - } + yagl_transport_get_out_array(t, 1, (const void**)&pixels, &pixels_count); YAGL_LOG_FUNC_ENTER_SPLIT9(glTexSubImage2D, GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLenum, void*, target, level, xoffset, yoffset, width, height, format, type, pixels); (void)yagl_host_glTexSubImage2D(target, level, xoffset, yoffset, width, height, format, type, pixels, pixels_count); YAGL_LOG_FUNC_EXIT(NULL); - - return true; } /* * glClientActiveTexture dispatcher. id = 37 */ -static bool yagl_func_glClientActiveTexture(struct yagl_transport *t) +static void yagl_func_glClientActiveTexture(struct yagl_transport *t) { GLenum texture; texture = yagl_transport_get_out_GLenum(t); YAGL_LOG_FUNC_ENTER_SPLIT1(glClientActiveTexture, GLenum, texture); (void)yagl_host_glClientActiveTexture(texture); YAGL_LOG_FUNC_EXIT(NULL); - - return true; } /* * glTexEnvi dispatcher. id = 38 */ -static bool yagl_func_glTexEnvi(struct yagl_transport *t) +static void yagl_func_glTexEnvi(struct yagl_transport *t) { GLenum target; GLenum pname; @@ -842,14 +734,12 @@ static bool yagl_func_glTexEnvi(struct yagl_transport *t) YAGL_LOG_FUNC_ENTER_SPLIT3(glTexEnvi, GLenum, GLenum, GLint, target, pname, param); (void)yagl_host_glTexEnvi(target, pname, param); YAGL_LOG_FUNC_EXIT(NULL); - - return true; } /* * glTexEnvf dispatcher. id = 39 */ -static bool yagl_func_glTexEnvf(struct yagl_transport *t) +static void yagl_func_glTexEnvf(struct yagl_transport *t) { GLenum target; GLenum pname; @@ -860,14 +750,12 @@ static bool yagl_func_glTexEnvf(struct yagl_transport *t) YAGL_LOG_FUNC_ENTER_SPLIT3(glTexEnvf, GLenum, GLenum, GLfloat, target, pname, param); (void)yagl_host_glTexEnvf(target, pname, param); YAGL_LOG_FUNC_EXIT(NULL); - - return true; } /* * glMultiTexCoord4f dispatcher. id = 40 */ -static bool yagl_func_glMultiTexCoord4f(struct yagl_transport *t) +static void yagl_func_glMultiTexCoord4f(struct yagl_transport *t) { GLenum target; GLfloat s; @@ -882,14 +770,12 @@ static bool yagl_func_glMultiTexCoord4f(struct yagl_transport *t) YAGL_LOG_FUNC_ENTER_SPLIT5(glMultiTexCoord4f, GLenum, GLfloat, GLfloat, GLfloat, GLfloat, target, s, tt, r, q); (void)yagl_host_glMultiTexCoord4f(target, s, tt, r, q); YAGL_LOG_FUNC_EXIT(NULL); - - return true; } /* * glTexEnviv dispatcher. id = 41 */ -static bool yagl_func_glTexEnviv(struct yagl_transport *t) +static void yagl_func_glTexEnviv(struct yagl_transport *t) { GLenum target; GLenum pname; @@ -897,20 +783,16 @@ static bool yagl_func_glTexEnviv(struct yagl_transport *t) int32_t params_count; target = yagl_transport_get_out_GLenum(t); pname = yagl_transport_get_out_GLenum(t); - if (!yagl_transport_get_out_array(t, sizeof(GLint), (const void**)¶ms, ¶ms_count)) { - return false; - } + yagl_transport_get_out_array(t, sizeof(GLint), (const void**)¶ms, ¶ms_count); YAGL_LOG_FUNC_ENTER_SPLIT3(glTexEnviv, GLenum, GLenum, void*, target, pname, params); (void)yagl_host_glTexEnviv(target, pname, params, params_count); YAGL_LOG_FUNC_EXIT(NULL); - - return true; } /* * glTexEnvfv dispatcher. id = 42 */ -static bool yagl_func_glTexEnvfv(struct yagl_transport *t) +static void yagl_func_glTexEnvfv(struct yagl_transport *t) { GLenum target; GLenum pname; @@ -918,20 +800,16 @@ static bool yagl_func_glTexEnvfv(struct yagl_transport *t) int32_t params_count; target = yagl_transport_get_out_GLenum(t); pname = yagl_transport_get_out_GLenum(t); - if (!yagl_transport_get_out_array(t, sizeof(GLfloat), (const void**)¶ms, ¶ms_count)) { - return false; - } + yagl_transport_get_out_array(t, sizeof(GLfloat), (const void**)¶ms, ¶ms_count); YAGL_LOG_FUNC_ENTER_SPLIT3(glTexEnvfv, GLenum, GLenum, void*, target, pname, params); (void)yagl_host_glTexEnvfv(target, pname, params, params_count); YAGL_LOG_FUNC_EXIT(NULL); - - return true; } /* * glGetTexEnviv dispatcher. id = 43 */ -static bool yagl_func_glGetTexEnviv(struct yagl_transport *t) +static void yagl_func_glGetTexEnviv(struct yagl_transport *t) { GLenum env; GLenum pname; @@ -940,21 +818,17 @@ static bool yagl_func_glGetTexEnviv(struct yagl_transport *t) int32_t *params_count; env = yagl_transport_get_out_GLenum(t); pname = yagl_transport_get_out_GLenum(t); - if (!yagl_transport_get_in_array(t, sizeof(GLint), (void**)¶ms, ¶ms_maxcount, ¶ms_count)) { - return false; - } + yagl_transport_get_in_array(t, sizeof(GLint), (void**)¶ms, ¶ms_maxcount, ¶ms_count); YAGL_LOG_FUNC_ENTER_SPLIT3(glGetTexEnviv, GLenum, GLenum, void*, env, pname, params); *params_count = 0; (void)yagl_host_glGetTexEnviv(env, pname, params, params_maxcount, params_count); YAGL_LOG_FUNC_EXIT(NULL); - - return true; } /* * glGetTexEnvfv dispatcher. id = 44 */ -static bool yagl_func_glGetTexEnvfv(struct yagl_transport *t) +static void yagl_func_glGetTexEnvfv(struct yagl_transport *t) { GLenum env; GLenum pname; @@ -963,38 +837,30 @@ static bool yagl_func_glGetTexEnvfv(struct yagl_transport *t) int32_t *params_count; env = yagl_transport_get_out_GLenum(t); pname = yagl_transport_get_out_GLenum(t); - if (!yagl_transport_get_in_array(t, sizeof(GLfloat), (void**)¶ms, ¶ms_maxcount, ¶ms_count)) { - return false; - } + yagl_transport_get_in_array(t, sizeof(GLfloat), (void**)¶ms, ¶ms_maxcount, ¶ms_count); YAGL_LOG_FUNC_ENTER_SPLIT3(glGetTexEnvfv, GLenum, GLenum, void*, env, pname, params); *params_count = 0; (void)yagl_host_glGetTexEnvfv(env, pname, params, params_maxcount, params_count); YAGL_LOG_FUNC_EXIT(NULL); - - return true; } /* * glGenFramebuffers dispatcher. id = 45 */ -static bool yagl_func_glGenFramebuffers(struct yagl_transport *t) +static void yagl_func_glGenFramebuffers(struct yagl_transport *t) { const GLuint *framebuffers; int32_t framebuffers_count; - if (!yagl_transport_get_out_array(t, sizeof(GLuint), (const void**)&framebuffers, &framebuffers_count)) { - return false; - } + yagl_transport_get_out_array(t, sizeof(GLuint), (const void**)&framebuffers, &framebuffers_count); YAGL_LOG_FUNC_ENTER_SPLIT1(glGenFramebuffers, void*, framebuffers); (void)yagl_host_glGenFramebuffers(framebuffers, framebuffers_count); YAGL_LOG_FUNC_EXIT(NULL); - - return true; } /* * glBindFramebuffer dispatcher. id = 46 */ -static bool yagl_func_glBindFramebuffer(struct yagl_transport *t) +static void yagl_func_glBindFramebuffer(struct yagl_transport *t) { GLenum target; GLuint framebuffer; @@ -1003,14 +869,12 @@ static bool yagl_func_glBindFramebuffer(struct yagl_transport *t) YAGL_LOG_FUNC_ENTER_SPLIT2(glBindFramebuffer, GLenum, GLuint, target, framebuffer); (void)yagl_host_glBindFramebuffer(target, framebuffer); YAGL_LOG_FUNC_EXIT(NULL); - - return true; } /* * glFramebufferTexture2D dispatcher. id = 47 */ -static bool yagl_func_glFramebufferTexture2D(struct yagl_transport *t) +static void yagl_func_glFramebufferTexture2D(struct yagl_transport *t) { GLenum target; GLenum attachment; @@ -1025,14 +889,12 @@ static bool yagl_func_glFramebufferTexture2D(struct yagl_transport *t) YAGL_LOG_FUNC_ENTER_SPLIT5(glFramebufferTexture2D, GLenum, GLenum, GLenum, GLuint, GLint, target, attachment, textarget, texture, level); (void)yagl_host_glFramebufferTexture2D(target, attachment, textarget, texture, level); YAGL_LOG_FUNC_EXIT(NULL); - - return true; } /* * glFramebufferRenderbuffer dispatcher. id = 48 */ -static bool yagl_func_glFramebufferRenderbuffer(struct yagl_transport *t) +static void yagl_func_glFramebufferRenderbuffer(struct yagl_transport *t) { GLenum target; GLenum attachment; @@ -1045,31 +907,25 @@ static bool yagl_func_glFramebufferRenderbuffer(struct yagl_transport *t) YAGL_LOG_FUNC_ENTER_SPLIT4(glFramebufferRenderbuffer, GLenum, GLenum, GLenum, GLuint, target, attachment, renderbuffertarget, renderbuffer); (void)yagl_host_glFramebufferRenderbuffer(target, attachment, renderbuffertarget, renderbuffer); YAGL_LOG_FUNC_EXIT(NULL); - - return true; } /* * glGenRenderbuffers dispatcher. id = 49 */ -static bool yagl_func_glGenRenderbuffers(struct yagl_transport *t) +static void yagl_func_glGenRenderbuffers(struct yagl_transport *t) { const GLuint *renderbuffers; int32_t renderbuffers_count; - if (!yagl_transport_get_out_array(t, sizeof(GLuint), (const void**)&renderbuffers, &renderbuffers_count)) { - return false; - } + yagl_transport_get_out_array(t, sizeof(GLuint), (const void**)&renderbuffers, &renderbuffers_count); YAGL_LOG_FUNC_ENTER_SPLIT1(glGenRenderbuffers, void*, renderbuffers); (void)yagl_host_glGenRenderbuffers(renderbuffers, renderbuffers_count); YAGL_LOG_FUNC_EXIT(NULL); - - return true; } /* * glBindRenderbuffer dispatcher. id = 50 */ -static bool yagl_func_glBindRenderbuffer(struct yagl_transport *t) +static void yagl_func_glBindRenderbuffer(struct yagl_transport *t) { GLenum target; GLuint renderbuffer; @@ -1078,14 +934,12 @@ static bool yagl_func_glBindRenderbuffer(struct yagl_transport *t) YAGL_LOG_FUNC_ENTER_SPLIT2(glBindRenderbuffer, GLenum, GLuint, target, renderbuffer); (void)yagl_host_glBindRenderbuffer(target, renderbuffer); YAGL_LOG_FUNC_EXIT(NULL); - - return true; } /* * glRenderbufferStorage dispatcher. id = 51 */ -static bool yagl_func_glRenderbufferStorage(struct yagl_transport *t) +static void yagl_func_glRenderbufferStorage(struct yagl_transport *t) { GLenum target; GLenum internalformat; @@ -1098,14 +952,12 @@ static bool yagl_func_glRenderbufferStorage(struct yagl_transport *t) YAGL_LOG_FUNC_ENTER_SPLIT4(glRenderbufferStorage, GLenum, GLenum, GLsizei, GLsizei, target, internalformat, width, height); (void)yagl_host_glRenderbufferStorage(target, internalformat, width, height); YAGL_LOG_FUNC_EXIT(NULL); - - return true; } /* * glGetRenderbufferParameteriv dispatcher. id = 52 */ -static bool yagl_func_glGetRenderbufferParameteriv(struct yagl_transport *t) +static void yagl_func_glGetRenderbufferParameteriv(struct yagl_transport *t) { GLenum target; GLenum pname; @@ -1116,28 +968,24 @@ static bool yagl_func_glGetRenderbufferParameteriv(struct yagl_transport *t) YAGL_LOG_FUNC_ENTER_SPLIT3(glGetRenderbufferParameteriv, GLenum, GLenum, void*, target, pname, param); (void)yagl_host_glGetRenderbufferParameteriv(target, pname, param); YAGL_LOG_FUNC_EXIT(NULL); - - return true; } /* * glCreateProgram dispatcher. id = 53 */ -static bool yagl_func_glCreateProgram(struct yagl_transport *t) +static void yagl_func_glCreateProgram(struct yagl_transport *t) { GLuint program; program = yagl_transport_get_out_GLuint(t); YAGL_LOG_FUNC_ENTER_SPLIT1(glCreateProgram, GLuint, program); (void)yagl_host_glCreateProgram(program); YAGL_LOG_FUNC_EXIT(NULL); - - return true; } /* * glCreateShader dispatcher. id = 54 */ -static bool yagl_func_glCreateShader(struct yagl_transport *t) +static void yagl_func_glCreateShader(struct yagl_transport *t) { GLuint shader; GLenum type; @@ -1146,33 +994,27 @@ static bool yagl_func_glCreateShader(struct yagl_transport *t) YAGL_LOG_FUNC_ENTER_SPLIT2(glCreateShader, GLuint, GLenum, shader, type); (void)yagl_host_glCreateShader(shader, type); YAGL_LOG_FUNC_EXIT(NULL); - - return true; } /* * glShaderSource dispatcher. id = 55 */ -static bool yagl_func_glShaderSource(struct yagl_transport *t) +static void yagl_func_glShaderSource(struct yagl_transport *t) { GLuint shader; const GLchar *string; int32_t string_count; shader = yagl_transport_get_out_GLuint(t); - if (!yagl_transport_get_out_array(t, sizeof(GLchar), (const void**)&string, &string_count)) { - return false; - } + yagl_transport_get_out_array(t, sizeof(GLchar), (const void**)&string, &string_count); YAGL_LOG_FUNC_ENTER_SPLIT2(glShaderSource, GLuint, void*, shader, string); (void)yagl_host_glShaderSource(shader, string, string_count); YAGL_LOG_FUNC_EXIT(NULL); - - return true; } /* * glAttachShader dispatcher. id = 56 */ -static bool yagl_func_glAttachShader(struct yagl_transport *t) +static void yagl_func_glAttachShader(struct yagl_transport *t) { GLuint program; GLuint shader; @@ -1181,14 +1023,12 @@ static bool yagl_func_glAttachShader(struct yagl_transport *t) YAGL_LOG_FUNC_ENTER_SPLIT2(glAttachShader, GLuint, GLuint, program, shader); (void)yagl_host_glAttachShader(program, shader); YAGL_LOG_FUNC_EXIT(NULL); - - return true; } /* * glDetachShader dispatcher. id = 57 */ -static bool yagl_func_glDetachShader(struct yagl_transport *t) +static void yagl_func_glDetachShader(struct yagl_transport *t) { GLuint program; GLuint shader; @@ -1197,28 +1037,24 @@ static bool yagl_func_glDetachShader(struct yagl_transport *t) YAGL_LOG_FUNC_ENTER_SPLIT2(glDetachShader, GLuint, GLuint, program, shader); (void)yagl_host_glDetachShader(program, shader); YAGL_LOG_FUNC_EXIT(NULL); - - return true; } /* * glCompileShader dispatcher. id = 58 */ -static bool yagl_func_glCompileShader(struct yagl_transport *t) +static void yagl_func_glCompileShader(struct yagl_transport *t) { GLuint shader; shader = yagl_transport_get_out_GLuint(t); YAGL_LOG_FUNC_ENTER_SPLIT1(glCompileShader, GLuint, shader); (void)yagl_host_glCompileShader(shader); YAGL_LOG_FUNC_EXIT(NULL); - - return true; } /* * glBindAttribLocation dispatcher. id = 59 */ -static bool yagl_func_glBindAttribLocation(struct yagl_transport *t) +static void yagl_func_glBindAttribLocation(struct yagl_transport *t) { GLuint program; GLuint index; @@ -1226,20 +1062,16 @@ static bool yagl_func_glBindAttribLocation(struct yagl_transport *t) int32_t name_count; program = yagl_transport_get_out_GLuint(t); index = yagl_transport_get_out_GLuint(t); - if (!yagl_transport_get_out_array(t, sizeof(GLchar), (const void**)&name, &name_count)) { - return false; - } + yagl_transport_get_out_array(t, sizeof(GLchar), (const void**)&name, &name_count); YAGL_LOG_FUNC_ENTER_SPLIT3(glBindAttribLocation, GLuint, GLuint, void*, program, index, name); (void)yagl_host_glBindAttribLocation(program, index, name, name_count); YAGL_LOG_FUNC_EXIT(NULL); - - return true; } /* * glGetActiveAttrib dispatcher. id = 60 */ -static bool yagl_func_glGetActiveAttrib(struct yagl_transport *t) +static void yagl_func_glGetActiveAttrib(struct yagl_transport *t) { GLuint program; GLuint index; @@ -1253,22 +1085,18 @@ static bool yagl_func_glGetActiveAttrib(struct yagl_transport *t) index = yagl_transport_get_out_GLuint(t); yagl_transport_get_in_arg(t, (void**)&size); yagl_transport_get_in_arg(t, (void**)&type); - if (!yagl_transport_get_in_array(t, sizeof(GLchar), (void**)&name, &name_maxcount, &name_count)) { - return false; - } + yagl_transport_get_in_array(t, sizeof(GLchar), (void**)&name, &name_maxcount, &name_count); yagl_transport_get_in_arg(t, (void**)&retval); YAGL_LOG_FUNC_ENTER_SPLIT5(glGetActiveAttrib, GLuint, GLuint, void*, void*, void*, program, index, size, type, name); *name_count = 0; *retval = yagl_host_glGetActiveAttrib(program, index, size, type, name, name_maxcount, name_count); YAGL_LOG_FUNC_EXIT_SPLIT(GLboolean, *retval); - - return true; } /* * glGetActiveUniform dispatcher. id = 61 */ -static bool yagl_func_glGetActiveUniform(struct yagl_transport *t) +static void yagl_func_glGetActiveUniform(struct yagl_transport *t) { GLuint program; GLuint index; @@ -1282,43 +1110,35 @@ static bool yagl_func_glGetActiveUniform(struct yagl_transport *t) index = yagl_transport_get_out_GLuint(t); yagl_transport_get_in_arg(t, (void**)&size); yagl_transport_get_in_arg(t, (void**)&type); - if (!yagl_transport_get_in_array(t, sizeof(GLchar), (void**)&name, &name_maxcount, &name_count)) { - return false; - } + yagl_transport_get_in_array(t, sizeof(GLchar), (void**)&name, &name_maxcount, &name_count); yagl_transport_get_in_arg(t, (void**)&retval); YAGL_LOG_FUNC_ENTER_SPLIT5(glGetActiveUniform, GLuint, GLuint, void*, void*, void*, program, index, size, type, name); *name_count = 0; *retval = yagl_host_glGetActiveUniform(program, index, size, type, name, name_maxcount, name_count); YAGL_LOG_FUNC_EXIT_SPLIT(GLboolean, *retval); - - return true; } /* * glGetAttribLocation dispatcher. id = 62 */ -static bool yagl_func_glGetAttribLocation(struct yagl_transport *t) +static void yagl_func_glGetAttribLocation(struct yagl_transport *t) { GLuint program; const GLchar *name; int32_t name_count; int *retval; program = yagl_transport_get_out_GLuint(t); - if (!yagl_transport_get_out_array(t, sizeof(GLchar), (const void**)&name, &name_count)) { - return false; - } + yagl_transport_get_out_array(t, sizeof(GLchar), (const void**)&name, &name_count); yagl_transport_get_in_arg(t, (void**)&retval); YAGL_LOG_FUNC_ENTER_SPLIT2(glGetAttribLocation, GLuint, void*, program, name); *retval = yagl_host_glGetAttribLocation(program, name, name_count); YAGL_LOG_FUNC_EXIT_SPLIT(int, *retval); - - return true; } /* * glGetProgramiv dispatcher. id = 63 */ -static bool yagl_func_glGetProgramiv(struct yagl_transport *t) +static void yagl_func_glGetProgramiv(struct yagl_transport *t) { GLuint program; GLenum pname; @@ -1329,14 +1149,12 @@ static bool yagl_func_glGetProgramiv(struct yagl_transport *t) YAGL_LOG_FUNC_ENTER_SPLIT3(glGetProgramiv, GLuint, GLenum, void*, program, pname, param); (void)yagl_host_glGetProgramiv(program, pname, param); YAGL_LOG_FUNC_EXIT(NULL); - - return true; } /* * glGetProgramInfoLog dispatcher. id = 64 */ -static bool yagl_func_glGetProgramInfoLog(struct yagl_transport *t) +static void yagl_func_glGetProgramInfoLog(struct yagl_transport *t) { GLuint program; GLchar *infolog; @@ -1344,22 +1162,18 @@ static bool yagl_func_glGetProgramInfoLog(struct yagl_transport *t) int32_t *infolog_count; GLboolean *retval; program = yagl_transport_get_out_GLuint(t); - if (!yagl_transport_get_in_array(t, sizeof(GLchar), (void**)&infolog, &infolog_maxcount, &infolog_count)) { - return false; - } + yagl_transport_get_in_array(t, sizeof(GLchar), (void**)&infolog, &infolog_maxcount, &infolog_count); yagl_transport_get_in_arg(t, (void**)&retval); YAGL_LOG_FUNC_ENTER_SPLIT2(glGetProgramInfoLog, GLuint, void*, program, infolog); *infolog_count = 0; *retval = yagl_host_glGetProgramInfoLog(program, infolog, infolog_maxcount, infolog_count); YAGL_LOG_FUNC_EXIT_SPLIT(GLboolean, *retval); - - return true; } /* * glGetShaderiv dispatcher. id = 65 */ -static bool yagl_func_glGetShaderiv(struct yagl_transport *t) +static void yagl_func_glGetShaderiv(struct yagl_transport *t) { GLuint shader; GLenum pname; @@ -1370,14 +1184,12 @@ static bool yagl_func_glGetShaderiv(struct yagl_transport *t) YAGL_LOG_FUNC_ENTER_SPLIT3(glGetShaderiv, GLuint, GLenum, void*, shader, pname, param); (void)yagl_host_glGetShaderiv(shader, pname, param); YAGL_LOG_FUNC_EXIT(NULL); - - return true; } /* * glGetShaderInfoLog dispatcher. id = 66 */ -static bool yagl_func_glGetShaderInfoLog(struct yagl_transport *t) +static void yagl_func_glGetShaderInfoLog(struct yagl_transport *t) { GLuint shader; GLchar *infolog; @@ -1385,22 +1197,18 @@ static bool yagl_func_glGetShaderInfoLog(struct yagl_transport *t) int32_t *infolog_count; GLboolean *retval; shader = yagl_transport_get_out_GLuint(t); - if (!yagl_transport_get_in_array(t, sizeof(GLchar), (void**)&infolog, &infolog_maxcount, &infolog_count)) { - return false; - } + yagl_transport_get_in_array(t, sizeof(GLchar), (void**)&infolog, &infolog_maxcount, &infolog_count); yagl_transport_get_in_arg(t, (void**)&retval); YAGL_LOG_FUNC_ENTER_SPLIT2(glGetShaderInfoLog, GLuint, void*, shader, infolog); *infolog_count = 0; *retval = yagl_host_glGetShaderInfoLog(shader, infolog, infolog_maxcount, infolog_count); YAGL_LOG_FUNC_EXIT_SPLIT(GLboolean, *retval); - - return true; } /* * glGetUniformfv dispatcher. id = 67 */ -static bool yagl_func_glGetUniformfv(struct yagl_transport *t) +static void yagl_func_glGetUniformfv(struct yagl_transport *t) { GLboolean tl; GLuint program; @@ -1411,21 +1219,17 @@ static bool yagl_func_glGetUniformfv(struct yagl_transport *t) tl = yagl_transport_get_out_GLboolean(t); program = yagl_transport_get_out_GLuint(t); location = yagl_transport_get_out_uint32_t(t); - if (!yagl_transport_get_in_array(t, sizeof(GLfloat), (void**)¶ms, ¶ms_maxcount, ¶ms_count)) { - return false; - } + yagl_transport_get_in_array(t, sizeof(GLfloat), (void**)¶ms, ¶ms_maxcount, ¶ms_count); YAGL_LOG_FUNC_ENTER_SPLIT4(glGetUniformfv, GLboolean, GLuint, uint32_t, void*, tl, program, location, params); *params_count = 0; (void)yagl_host_glGetUniformfv(tl, program, location, params, params_maxcount, params_count); YAGL_LOG_FUNC_EXIT(NULL); - - return true; } /* * glGetUniformiv dispatcher. id = 68 */ -static bool yagl_func_glGetUniformiv(struct yagl_transport *t) +static void yagl_func_glGetUniformiv(struct yagl_transport *t) { GLboolean tl; GLuint program; @@ -1436,42 +1240,34 @@ static bool yagl_func_glGetUniformiv(struct yagl_transport *t) tl = yagl_transport_get_out_GLboolean(t); program = yagl_transport_get_out_GLuint(t); location = yagl_transport_get_out_uint32_t(t); - if (!yagl_transport_get_in_array(t, sizeof(GLint), (void**)¶ms, ¶ms_maxcount, ¶ms_count)) { - return false; - } + yagl_transport_get_in_array(t, sizeof(GLint), (void**)¶ms, ¶ms_maxcount, ¶ms_count); YAGL_LOG_FUNC_ENTER_SPLIT4(glGetUniformiv, GLboolean, GLuint, uint32_t, void*, tl, program, location, params); *params_count = 0; (void)yagl_host_glGetUniformiv(tl, program, location, params, params_maxcount, params_count); YAGL_LOG_FUNC_EXIT(NULL); - - return true; } /* * glGetUniformLocation dispatcher. id = 69 */ -static bool yagl_func_glGetUniformLocation(struct yagl_transport *t) +static void yagl_func_glGetUniformLocation(struct yagl_transport *t) { GLuint program; const GLchar *name; int32_t name_count; int *retval; program = yagl_transport_get_out_GLuint(t); - if (!yagl_transport_get_out_array(t, sizeof(GLchar), (const void**)&name, &name_count)) { - return false; - } + yagl_transport_get_out_array(t, sizeof(GLchar), (const void**)&name, &name_count); yagl_transport_get_in_arg(t, (void**)&retval); YAGL_LOG_FUNC_ENTER_SPLIT2(glGetUniformLocation, GLuint, void*, program, name); *retval = yagl_host_glGetUniformLocation(program, name, name_count); YAGL_LOG_FUNC_EXIT_SPLIT(int, *retval); - - return true; } /* * glGetVertexAttribfv dispatcher. id = 70 */ -static bool yagl_func_glGetVertexAttribfv(struct yagl_transport *t) +static void yagl_func_glGetVertexAttribfv(struct yagl_transport *t) { GLuint index; GLenum pname; @@ -1480,21 +1276,17 @@ static bool yagl_func_glGetVertexAttribfv(struct yagl_transport *t) int32_t *params_count; index = yagl_transport_get_out_GLuint(t); pname = yagl_transport_get_out_GLenum(t); - if (!yagl_transport_get_in_array(t, sizeof(GLfloat), (void**)¶ms, ¶ms_maxcount, ¶ms_count)) { - return false; - } + yagl_transport_get_in_array(t, sizeof(GLfloat), (void**)¶ms, ¶ms_maxcount, ¶ms_count); YAGL_LOG_FUNC_ENTER_SPLIT3(glGetVertexAttribfv, GLuint, GLenum, void*, index, pname, params); *params_count = 0; (void)yagl_host_glGetVertexAttribfv(index, pname, params, params_maxcount, params_count); YAGL_LOG_FUNC_EXIT(NULL); - - return true; } /* * glGetVertexAttribiv dispatcher. id = 71 */ -static bool yagl_func_glGetVertexAttribiv(struct yagl_transport *t) +static void yagl_func_glGetVertexAttribiv(struct yagl_transport *t) { GLuint index; GLenum pname; @@ -1503,35 +1295,29 @@ static bool yagl_func_glGetVertexAttribiv(struct yagl_transport *t) int32_t *params_count; index = yagl_transport_get_out_GLuint(t); pname = yagl_transport_get_out_GLenum(t); - if (!yagl_transport_get_in_array(t, sizeof(GLint), (void**)¶ms, ¶ms_maxcount, ¶ms_count)) { - return false; - } + yagl_transport_get_in_array(t, sizeof(GLint), (void**)¶ms, ¶ms_maxcount, ¶ms_count); YAGL_LOG_FUNC_ENTER_SPLIT3(glGetVertexAttribiv, GLuint, GLenum, void*, index, pname, params); *params_count = 0; (void)yagl_host_glGetVertexAttribiv(index, pname, params, params_maxcount, params_count); YAGL_LOG_FUNC_EXIT(NULL); - - return true; } /* * glLinkProgram dispatcher. id = 72 */ -static bool yagl_func_glLinkProgram(struct yagl_transport *t) +static void yagl_func_glLinkProgram(struct yagl_transport *t) { GLuint program; program = yagl_transport_get_out_GLuint(t); YAGL_LOG_FUNC_ENTER_SPLIT1(glLinkProgram, GLuint, program); (void)yagl_host_glLinkProgram(program); YAGL_LOG_FUNC_EXIT(NULL); - - return true; } /* * glUniform1f dispatcher. id = 73 */ -static bool yagl_func_glUniform1f(struct yagl_transport *t) +static void yagl_func_glUniform1f(struct yagl_transport *t) { GLboolean tl; uint32_t location; @@ -1542,14 +1328,12 @@ static bool yagl_func_glUniform1f(struct yagl_transport *t) YAGL_LOG_FUNC_ENTER_SPLIT3(glUniform1f, GLboolean, uint32_t, GLfloat, tl, location, x); (void)yagl_host_glUniform1f(tl, location, x); YAGL_LOG_FUNC_EXIT(NULL); - - return true; } /* * glUniform1fv dispatcher. id = 74 */ -static bool yagl_func_glUniform1fv(struct yagl_transport *t) +static void yagl_func_glUniform1fv(struct yagl_transport *t) { GLboolean tl; uint32_t location; @@ -1557,20 +1341,16 @@ static bool yagl_func_glUniform1fv(struct yagl_transport *t) int32_t v_count; tl = yagl_transport_get_out_GLboolean(t); location = yagl_transport_get_out_uint32_t(t); - if (!yagl_transport_get_out_array(t, sizeof(GLfloat), (const void**)&v, &v_count)) { - return false; - } + yagl_transport_get_out_array(t, sizeof(GLfloat), (const void**)&v, &v_count); YAGL_LOG_FUNC_ENTER_SPLIT3(glUniform1fv, GLboolean, uint32_t, void*, tl, location, v); (void)yagl_host_glUniform1fv(tl, location, v, v_count); YAGL_LOG_FUNC_EXIT(NULL); - - return true; } /* * glUniform1i dispatcher. id = 75 */ -static bool yagl_func_glUniform1i(struct yagl_transport *t) +static void yagl_func_glUniform1i(struct yagl_transport *t) { GLboolean tl; uint32_t location; @@ -1581,14 +1361,12 @@ static bool yagl_func_glUniform1i(struct yagl_transport *t) YAGL_LOG_FUNC_ENTER_SPLIT3(glUniform1i, GLboolean, uint32_t, GLint, tl, location, x); (void)yagl_host_glUniform1i(tl, location, x); YAGL_LOG_FUNC_EXIT(NULL); - - return true; } /* * glUniform1iv dispatcher. id = 76 */ -static bool yagl_func_glUniform1iv(struct yagl_transport *t) +static void yagl_func_glUniform1iv(struct yagl_transport *t) { GLboolean tl; uint32_t location; @@ -1596,20 +1374,16 @@ static bool yagl_func_glUniform1iv(struct yagl_transport *t) int32_t v_count; tl = yagl_transport_get_out_GLboolean(t); location = yagl_transport_get_out_uint32_t(t); - if (!yagl_transport_get_out_array(t, sizeof(GLint), (const void**)&v, &v_count)) { - return false; - } + yagl_transport_get_out_array(t, sizeof(GLint), (const void**)&v, &v_count); YAGL_LOG_FUNC_ENTER_SPLIT3(glUniform1iv, GLboolean, uint32_t, void*, tl, location, v); (void)yagl_host_glUniform1iv(tl, location, v, v_count); YAGL_LOG_FUNC_EXIT(NULL); - - return true; } /* * glUniform2f dispatcher. id = 77 */ -static bool yagl_func_glUniform2f(struct yagl_transport *t) +static void yagl_func_glUniform2f(struct yagl_transport *t) { GLboolean tl; uint32_t location; @@ -1622,14 +1396,12 @@ static bool yagl_func_glUniform2f(struct yagl_transport *t) YAGL_LOG_FUNC_ENTER_SPLIT4(glUniform2f, GLboolean, uint32_t, GLfloat, GLfloat, tl, location, x, y); (void)yagl_host_glUniform2f(tl, location, x, y); YAGL_LOG_FUNC_EXIT(NULL); - - return true; } /* * glUniform2fv dispatcher. id = 78 */ -static bool yagl_func_glUniform2fv(struct yagl_transport *t) +static void yagl_func_glUniform2fv(struct yagl_transport *t) { GLboolean tl; uint32_t location; @@ -1637,20 +1409,16 @@ static bool yagl_func_glUniform2fv(struct yagl_transport *t) int32_t v_count; tl = yagl_transport_get_out_GLboolean(t); location = yagl_transport_get_out_uint32_t(t); - if (!yagl_transport_get_out_array(t, sizeof(GLfloat), (const void**)&v, &v_count)) { - return false; - } + yagl_transport_get_out_array(t, sizeof(GLfloat), (const void**)&v, &v_count); YAGL_LOG_FUNC_ENTER_SPLIT3(glUniform2fv, GLboolean, uint32_t, void*, tl, location, v); (void)yagl_host_glUniform2fv(tl, location, v, v_count); YAGL_LOG_FUNC_EXIT(NULL); - - return true; } /* * glUniform2i dispatcher. id = 79 */ -static bool yagl_func_glUniform2i(struct yagl_transport *t) +static void yagl_func_glUniform2i(struct yagl_transport *t) { GLboolean tl; uint32_t location; @@ -1663,14 +1431,12 @@ static bool yagl_func_glUniform2i(struct yagl_transport *t) YAGL_LOG_FUNC_ENTER_SPLIT4(glUniform2i, GLboolean, uint32_t, GLint, GLint, tl, location, x, y); (void)yagl_host_glUniform2i(tl, location, x, y); YAGL_LOG_FUNC_EXIT(NULL); - - return true; } /* * glUniform2iv dispatcher. id = 80 */ -static bool yagl_func_glUniform2iv(struct yagl_transport *t) +static void yagl_func_glUniform2iv(struct yagl_transport *t) { GLboolean tl; uint32_t location; @@ -1678,20 +1444,16 @@ static bool yagl_func_glUniform2iv(struct yagl_transport *t) int32_t v_count; tl = yagl_transport_get_out_GLboolean(t); location = yagl_transport_get_out_uint32_t(t); - if (!yagl_transport_get_out_array(t, sizeof(GLint), (const void**)&v, &v_count)) { - return false; - } + yagl_transport_get_out_array(t, sizeof(GLint), (const void**)&v, &v_count); YAGL_LOG_FUNC_ENTER_SPLIT3(glUniform2iv, GLboolean, uint32_t, void*, tl, location, v); (void)yagl_host_glUniform2iv(tl, location, v, v_count); YAGL_LOG_FUNC_EXIT(NULL); - - return true; } /* * glUniform3f dispatcher. id = 81 */ -static bool yagl_func_glUniform3f(struct yagl_transport *t) +static void yagl_func_glUniform3f(struct yagl_transport *t) { GLboolean tl; uint32_t location; @@ -1706,14 +1468,12 @@ static bool yagl_func_glUniform3f(struct yagl_transport *t) YAGL_LOG_FUNC_ENTER_SPLIT5(glUniform3f, GLboolean, uint32_t, GLfloat, GLfloat, GLfloat, tl, location, x, y, z); (void)yagl_host_glUniform3f(tl, location, x, y, z); YAGL_LOG_FUNC_EXIT(NULL); - - return true; } /* * glUniform3fv dispatcher. id = 82 */ -static bool yagl_func_glUniform3fv(struct yagl_transport *t) +static void yagl_func_glUniform3fv(struct yagl_transport *t) { GLboolean tl; uint32_t location; @@ -1721,20 +1481,16 @@ static bool yagl_func_glUniform3fv(struct yagl_transport *t) int32_t v_count; tl = yagl_transport_get_out_GLboolean(t); location = yagl_transport_get_out_uint32_t(t); - if (!yagl_transport_get_out_array(t, sizeof(GLfloat), (const void**)&v, &v_count)) { - return false; - } + yagl_transport_get_out_array(t, sizeof(GLfloat), (const void**)&v, &v_count); YAGL_LOG_FUNC_ENTER_SPLIT3(glUniform3fv, GLboolean, uint32_t, void*, tl, location, v); (void)yagl_host_glUniform3fv(tl, location, v, v_count); YAGL_LOG_FUNC_EXIT(NULL); - - return true; } /* * glUniform3i dispatcher. id = 83 */ -static bool yagl_func_glUniform3i(struct yagl_transport *t) +static void yagl_func_glUniform3i(struct yagl_transport *t) { GLboolean tl; uint32_t location; @@ -1749,14 +1505,12 @@ static bool yagl_func_glUniform3i(struct yagl_transport *t) YAGL_LOG_FUNC_ENTER_SPLIT5(glUniform3i, GLboolean, uint32_t, GLint, GLint, GLint, tl, location, x, y, z); (void)yagl_host_glUniform3i(tl, location, x, y, z); YAGL_LOG_FUNC_EXIT(NULL); - - return true; } /* * glUniform3iv dispatcher. id = 84 */ -static bool yagl_func_glUniform3iv(struct yagl_transport *t) +static void yagl_func_glUniform3iv(struct yagl_transport *t) { GLboolean tl; uint32_t location; @@ -1764,20 +1518,16 @@ static bool yagl_func_glUniform3iv(struct yagl_transport *t) int32_t v_count; tl = yagl_transport_get_out_GLboolean(t); location = yagl_transport_get_out_uint32_t(t); - if (!yagl_transport_get_out_array(t, sizeof(GLint), (const void**)&v, &v_count)) { - return false; - } + yagl_transport_get_out_array(t, sizeof(GLint), (const void**)&v, &v_count); YAGL_LOG_FUNC_ENTER_SPLIT3(glUniform3iv, GLboolean, uint32_t, void*, tl, location, v); (void)yagl_host_glUniform3iv(tl, location, v, v_count); YAGL_LOG_FUNC_EXIT(NULL); - - return true; } /* * glUniform4f dispatcher. id = 85 */ -static bool yagl_func_glUniform4f(struct yagl_transport *t) +static void yagl_func_glUniform4f(struct yagl_transport *t) { GLboolean tl; uint32_t location; @@ -1794,14 +1544,12 @@ static bool yagl_func_glUniform4f(struct yagl_transport *t) YAGL_LOG_FUNC_ENTER_SPLIT6(glUniform4f, GLboolean, uint32_t, GLfloat, GLfloat, GLfloat, GLfloat, tl, location, x, y, z, w); (void)yagl_host_glUniform4f(tl, location, x, y, z, w); YAGL_LOG_FUNC_EXIT(NULL); - - return true; } /* * glUniform4fv dispatcher. id = 86 */ -static bool yagl_func_glUniform4fv(struct yagl_transport *t) +static void yagl_func_glUniform4fv(struct yagl_transport *t) { GLboolean tl; uint32_t location; @@ -1809,20 +1557,16 @@ static bool yagl_func_glUniform4fv(struct yagl_transport *t) int32_t v_count; tl = yagl_transport_get_out_GLboolean(t); location = yagl_transport_get_out_uint32_t(t); - if (!yagl_transport_get_out_array(t, sizeof(GLfloat), (const void**)&v, &v_count)) { - return false; - } + yagl_transport_get_out_array(t, sizeof(GLfloat), (const void**)&v, &v_count); YAGL_LOG_FUNC_ENTER_SPLIT3(glUniform4fv, GLboolean, uint32_t, void*, tl, location, v); (void)yagl_host_glUniform4fv(tl, location, v, v_count); YAGL_LOG_FUNC_EXIT(NULL); - - return true; } /* * glUniform4i dispatcher. id = 87 */ -static bool yagl_func_glUniform4i(struct yagl_transport *t) +static void yagl_func_glUniform4i(struct yagl_transport *t) { GLboolean tl; uint32_t location; @@ -1839,14 +1583,12 @@ static bool yagl_func_glUniform4i(struct yagl_transport *t) YAGL_LOG_FUNC_ENTER_SPLIT6(glUniform4i, GLboolean, uint32_t, GLint, GLint, GLint, GLint, tl, location, x, y, z, w); (void)yagl_host_glUniform4i(tl, location, x, y, z, w); YAGL_LOG_FUNC_EXIT(NULL); - - return true; } /* * glUniform4iv dispatcher. id = 88 */ -static bool yagl_func_glUniform4iv(struct yagl_transport *t) +static void yagl_func_glUniform4iv(struct yagl_transport *t) { GLboolean tl; uint32_t location; @@ -1854,20 +1596,16 @@ static bool yagl_func_glUniform4iv(struct yagl_transport *t) int32_t v_count; tl = yagl_transport_get_out_GLboolean(t); location = yagl_transport_get_out_uint32_t(t); - if (!yagl_transport_get_out_array(t, sizeof(GLint), (const void**)&v, &v_count)) { - return false; - } + yagl_transport_get_out_array(t, sizeof(GLint), (const void**)&v, &v_count); YAGL_LOG_FUNC_ENTER_SPLIT3(glUniform4iv, GLboolean, uint32_t, void*, tl, location, v); (void)yagl_host_glUniform4iv(tl, location, v, v_count); YAGL_LOG_FUNC_EXIT(NULL); - - return true; } /* * glUniformMatrix2fv dispatcher. id = 89 */ -static bool yagl_func_glUniformMatrix2fv(struct yagl_transport *t) +static void yagl_func_glUniformMatrix2fv(struct yagl_transport *t) { GLboolean tl; uint32_t location; @@ -1877,20 +1615,16 @@ static bool yagl_func_glUniformMatrix2fv(struct yagl_transport *t) tl = yagl_transport_get_out_GLboolean(t); location = yagl_transport_get_out_uint32_t(t); transpose = yagl_transport_get_out_GLboolean(t); - if (!yagl_transport_get_out_array(t, sizeof(GLfloat), (const void**)&value, &value_count)) { - return false; - } + yagl_transport_get_out_array(t, sizeof(GLfloat), (const void**)&value, &value_count); YAGL_LOG_FUNC_ENTER_SPLIT4(glUniformMatrix2fv, GLboolean, uint32_t, GLboolean, void*, tl, location, transpose, value); (void)yagl_host_glUniformMatrix2fv(tl, location, transpose, value, value_count); YAGL_LOG_FUNC_EXIT(NULL); - - return true; } /* * glUniformMatrix3fv dispatcher. id = 90 */ -static bool yagl_func_glUniformMatrix3fv(struct yagl_transport *t) +static void yagl_func_glUniformMatrix3fv(struct yagl_transport *t) { GLboolean tl; uint32_t location; @@ -1900,20 +1634,16 @@ static bool yagl_func_glUniformMatrix3fv(struct yagl_transport *t) tl = yagl_transport_get_out_GLboolean(t); location = yagl_transport_get_out_uint32_t(t); transpose = yagl_transport_get_out_GLboolean(t); - if (!yagl_transport_get_out_array(t, sizeof(GLfloat), (const void**)&value, &value_count)) { - return false; - } + yagl_transport_get_out_array(t, sizeof(GLfloat), (const void**)&value, &value_count); YAGL_LOG_FUNC_ENTER_SPLIT4(glUniformMatrix3fv, GLboolean, uint32_t, GLboolean, void*, tl, location, transpose, value); (void)yagl_host_glUniformMatrix3fv(tl, location, transpose, value, value_count); YAGL_LOG_FUNC_EXIT(NULL); - - return true; } /* * glUniformMatrix4fv dispatcher. id = 91 */ -static bool yagl_func_glUniformMatrix4fv(struct yagl_transport *t) +static void yagl_func_glUniformMatrix4fv(struct yagl_transport *t) { GLboolean tl; uint32_t location; @@ -1923,48 +1653,40 @@ static bool yagl_func_glUniformMatrix4fv(struct yagl_transport *t) tl = yagl_transport_get_out_GLboolean(t); location = yagl_transport_get_out_uint32_t(t); transpose = yagl_transport_get_out_GLboolean(t); - if (!yagl_transport_get_out_array(t, sizeof(GLfloat), (const void**)&value, &value_count)) { - return false; - } + yagl_transport_get_out_array(t, sizeof(GLfloat), (const void**)&value, &value_count); YAGL_LOG_FUNC_ENTER_SPLIT4(glUniformMatrix4fv, GLboolean, uint32_t, GLboolean, void*, tl, location, transpose, value); (void)yagl_host_glUniformMatrix4fv(tl, location, transpose, value, value_count); YAGL_LOG_FUNC_EXIT(NULL); - - return true; } /* * glUseProgram dispatcher. id = 92 */ -static bool yagl_func_glUseProgram(struct yagl_transport *t) +static void yagl_func_glUseProgram(struct yagl_transport *t) { GLuint program; program = yagl_transport_get_out_GLuint(t); YAGL_LOG_FUNC_ENTER_SPLIT1(glUseProgram, GLuint, program); (void)yagl_host_glUseProgram(program); YAGL_LOG_FUNC_EXIT(NULL); - - return true; } /* * glValidateProgram dispatcher. id = 93 */ -static bool yagl_func_glValidateProgram(struct yagl_transport *t) +static void yagl_func_glValidateProgram(struct yagl_transport *t) { GLuint program; program = yagl_transport_get_out_GLuint(t); YAGL_LOG_FUNC_ENTER_SPLIT1(glValidateProgram, GLuint, program); (void)yagl_host_glValidateProgram(program); YAGL_LOG_FUNC_EXIT(NULL); - - return true; } /* * glVertexAttrib1f dispatcher. id = 94 */ -static bool yagl_func_glVertexAttrib1f(struct yagl_transport *t) +static void yagl_func_glVertexAttrib1f(struct yagl_transport *t) { GLuint indx; GLfloat x; @@ -1973,33 +1695,27 @@ static bool yagl_func_glVertexAttrib1f(struct yagl_transport *t) YAGL_LOG_FUNC_ENTER_SPLIT2(glVertexAttrib1f, GLuint, GLfloat, indx, x); (void)yagl_host_glVertexAttrib1f(indx, x); YAGL_LOG_FUNC_EXIT(NULL); - - return true; } /* * glVertexAttrib1fv dispatcher. id = 95 */ -static bool yagl_func_glVertexAttrib1fv(struct yagl_transport *t) +static void yagl_func_glVertexAttrib1fv(struct yagl_transport *t) { GLuint indx; const GLfloat *values; int32_t values_count; indx = yagl_transport_get_out_GLuint(t); - if (!yagl_transport_get_out_array(t, sizeof(GLfloat), (const void**)&values, &values_count)) { - return false; - } + yagl_transport_get_out_array(t, sizeof(GLfloat), (const void**)&values, &values_count); YAGL_LOG_FUNC_ENTER_SPLIT2(glVertexAttrib1fv, GLuint, void*, indx, values); (void)yagl_host_glVertexAttrib1fv(indx, values, values_count); YAGL_LOG_FUNC_EXIT(NULL); - - return true; } /* * glVertexAttrib2f dispatcher. id = 96 */ -static bool yagl_func_glVertexAttrib2f(struct yagl_transport *t) +static void yagl_func_glVertexAttrib2f(struct yagl_transport *t) { GLuint indx; GLfloat x; @@ -2010,33 +1726,27 @@ static bool yagl_func_glVertexAttrib2f(struct yagl_transport *t) YAGL_LOG_FUNC_ENTER_SPLIT3(glVertexAttrib2f, GLuint, GLfloat, GLfloat, indx, x, y); (void)yagl_host_glVertexAttrib2f(indx, x, y); YAGL_LOG_FUNC_EXIT(NULL); - - return true; } /* * glVertexAttrib2fv dispatcher. id = 97 */ -static bool yagl_func_glVertexAttrib2fv(struct yagl_transport *t) +static void yagl_func_glVertexAttrib2fv(struct yagl_transport *t) { GLuint indx; const GLfloat *values; int32_t values_count; indx = yagl_transport_get_out_GLuint(t); - if (!yagl_transport_get_out_array(t, sizeof(GLfloat), (const void**)&values, &values_count)) { - return false; - } + yagl_transport_get_out_array(t, sizeof(GLfloat), (const void**)&values, &values_count); YAGL_LOG_FUNC_ENTER_SPLIT2(glVertexAttrib2fv, GLuint, void*, indx, values); (void)yagl_host_glVertexAttrib2fv(indx, values, values_count); YAGL_LOG_FUNC_EXIT(NULL); - - return true; } /* * glVertexAttrib3f dispatcher. id = 98 */ -static bool yagl_func_glVertexAttrib3f(struct yagl_transport *t) +static void yagl_func_glVertexAttrib3f(struct yagl_transport *t) { GLuint indx; GLfloat x; @@ -2049,33 +1759,27 @@ static bool yagl_func_glVertexAttrib3f(struct yagl_transport *t) YAGL_LOG_FUNC_ENTER_SPLIT4(glVertexAttrib3f, GLuint, GLfloat, GLfloat, GLfloat, indx, x, y, z); (void)yagl_host_glVertexAttrib3f(indx, x, y, z); YAGL_LOG_FUNC_EXIT(NULL); - - return true; } /* * glVertexAttrib3fv dispatcher. id = 99 */ -static bool yagl_func_glVertexAttrib3fv(struct yagl_transport *t) +static void yagl_func_glVertexAttrib3fv(struct yagl_transport *t) { GLuint indx; const GLfloat *values; int32_t values_count; indx = yagl_transport_get_out_GLuint(t); - if (!yagl_transport_get_out_array(t, sizeof(GLfloat), (const void**)&values, &values_count)) { - return false; - } + yagl_transport_get_out_array(t, sizeof(GLfloat), (const void**)&values, &values_count); YAGL_LOG_FUNC_ENTER_SPLIT2(glVertexAttrib3fv, GLuint, void*, indx, values); (void)yagl_host_glVertexAttrib3fv(indx, values, values_count); YAGL_LOG_FUNC_EXIT(NULL); - - return true; } /* * glVertexAttrib4f dispatcher. id = 100 */ -static bool yagl_func_glVertexAttrib4f(struct yagl_transport *t) +static void yagl_func_glVertexAttrib4f(struct yagl_transport *t) { GLuint indx; GLfloat x; @@ -2090,96 +1794,78 @@ static bool yagl_func_glVertexAttrib4f(struct yagl_transport *t) YAGL_LOG_FUNC_ENTER_SPLIT5(glVertexAttrib4f, GLuint, GLfloat, GLfloat, GLfloat, GLfloat, indx, x, y, z, w); (void)yagl_host_glVertexAttrib4f(indx, x, y, z, w); YAGL_LOG_FUNC_EXIT(NULL); - - return true; } /* * glVertexAttrib4fv dispatcher. id = 101 */ -static bool yagl_func_glVertexAttrib4fv(struct yagl_transport *t) +static void yagl_func_glVertexAttrib4fv(struct yagl_transport *t) { GLuint indx; const GLfloat *values; int32_t values_count; indx = yagl_transport_get_out_GLuint(t); - if (!yagl_transport_get_out_array(t, sizeof(GLfloat), (const void**)&values, &values_count)) { - return false; - } + yagl_transport_get_out_array(t, sizeof(GLfloat), (const void**)&values, &values_count); YAGL_LOG_FUNC_ENTER_SPLIT2(glVertexAttrib4fv, GLuint, void*, indx, values); (void)yagl_host_glVertexAttrib4fv(indx, values, values_count); YAGL_LOG_FUNC_EXIT(NULL); - - return true; } /* * glGetIntegerv dispatcher. id = 102 */ -static bool yagl_func_glGetIntegerv(struct yagl_transport *t) +static void yagl_func_glGetIntegerv(struct yagl_transport *t) { GLenum pname; GLint *params; int32_t params_maxcount; int32_t *params_count; pname = yagl_transport_get_out_GLenum(t); - if (!yagl_transport_get_in_array(t, sizeof(GLint), (void**)¶ms, ¶ms_maxcount, ¶ms_count)) { - return false; - } + yagl_transport_get_in_array(t, sizeof(GLint), (void**)¶ms, ¶ms_maxcount, ¶ms_count); YAGL_LOG_FUNC_ENTER_SPLIT2(glGetIntegerv, GLenum, void*, pname, params); *params_count = 0; (void)yagl_host_glGetIntegerv(pname, params, params_maxcount, params_count); YAGL_LOG_FUNC_EXIT(NULL); - - return true; } /* * glGetFloatv dispatcher. id = 103 */ -static bool yagl_func_glGetFloatv(struct yagl_transport *t) +static void yagl_func_glGetFloatv(struct yagl_transport *t) { GLenum pname; GLfloat *params; int32_t params_maxcount; int32_t *params_count; pname = yagl_transport_get_out_GLenum(t); - if (!yagl_transport_get_in_array(t, sizeof(GLfloat), (void**)¶ms, ¶ms_maxcount, ¶ms_count)) { - return false; - } + yagl_transport_get_in_array(t, sizeof(GLfloat), (void**)¶ms, ¶ms_maxcount, ¶ms_count); YAGL_LOG_FUNC_ENTER_SPLIT2(glGetFloatv, GLenum, void*, pname, params); *params_count = 0; (void)yagl_host_glGetFloatv(pname, params, params_maxcount, params_count); YAGL_LOG_FUNC_EXIT(NULL); - - return true; } /* * glGetString dispatcher. id = 104 */ -static bool yagl_func_glGetString(struct yagl_transport *t) +static void yagl_func_glGetString(struct yagl_transport *t) { GLenum name; GLchar *str; int32_t str_maxcount; int32_t *str_count; name = yagl_transport_get_out_GLenum(t); - if (!yagl_transport_get_in_array(t, sizeof(GLchar), (void**)&str, &str_maxcount, &str_count)) { - return false; - } + yagl_transport_get_in_array(t, sizeof(GLchar), (void**)&str, &str_maxcount, &str_count); YAGL_LOG_FUNC_ENTER_SPLIT2(glGetString, GLenum, void*, name, str); *str_count = 0; (void)yagl_host_glGetString(name, str, str_maxcount, str_count); YAGL_LOG_FUNC_EXIT(NULL); - - return true; } /* * glIsEnabled dispatcher. id = 105 */ -static bool yagl_func_glIsEnabled(struct yagl_transport *t) +static void yagl_func_glIsEnabled(struct yagl_transport *t) { GLenum cap; GLboolean *retval; @@ -2188,45 +1874,37 @@ static bool yagl_func_glIsEnabled(struct yagl_transport *t) YAGL_LOG_FUNC_ENTER_SPLIT1(glIsEnabled, GLenum, cap); *retval = yagl_host_glIsEnabled(cap); YAGL_LOG_FUNC_EXIT_SPLIT(GLboolean, *retval); - - return true; } /* * glDeleteObjects dispatcher. id = 106 */ -static bool yagl_func_glDeleteObjects(struct yagl_transport *t) +static void yagl_func_glDeleteObjects(struct yagl_transport *t) { const GLuint *objects; int32_t objects_count; - if (!yagl_transport_get_out_array(t, sizeof(GLuint), (const void**)&objects, &objects_count)) { - return false; - } + yagl_transport_get_out_array(t, sizeof(GLuint), (const void**)&objects, &objects_count); YAGL_LOG_FUNC_ENTER_SPLIT1(glDeleteObjects, void*, objects); (void)yagl_host_glDeleteObjects(objects, objects_count); YAGL_LOG_FUNC_EXIT(NULL); - - return true; } /* * glBlendEquation dispatcher. id = 107 */ -static bool yagl_func_glBlendEquation(struct yagl_transport *t) +static void yagl_func_glBlendEquation(struct yagl_transport *t) { GLenum mode; mode = yagl_transport_get_out_GLenum(t); YAGL_LOG_FUNC_ENTER_SPLIT1(glBlendEquation, GLenum, mode); (void)yagl_host_glBlendEquation(mode); YAGL_LOG_FUNC_EXIT(NULL); - - return true; } /* * glBlendEquationSeparate dispatcher. id = 108 */ -static bool yagl_func_glBlendEquationSeparate(struct yagl_transport *t) +static void yagl_func_glBlendEquationSeparate(struct yagl_transport *t) { GLenum modeRGB; GLenum modeAlpha; @@ -2235,14 +1913,12 @@ static bool yagl_func_glBlendEquationSeparate(struct yagl_transport *t) YAGL_LOG_FUNC_ENTER_SPLIT2(glBlendEquationSeparate, GLenum, GLenum, modeRGB, modeAlpha); (void)yagl_host_glBlendEquationSeparate(modeRGB, modeAlpha); YAGL_LOG_FUNC_EXIT(NULL); - - return true; } /* * glBlendFunc dispatcher. id = 109 */ -static bool yagl_func_glBlendFunc(struct yagl_transport *t) +static void yagl_func_glBlendFunc(struct yagl_transport *t) { GLenum sfactor; GLenum dfactor; @@ -2251,14 +1927,12 @@ static bool yagl_func_glBlendFunc(struct yagl_transport *t) YAGL_LOG_FUNC_ENTER_SPLIT2(glBlendFunc, GLenum, GLenum, sfactor, dfactor); (void)yagl_host_glBlendFunc(sfactor, dfactor); YAGL_LOG_FUNC_EXIT(NULL); - - return true; } /* * glBlendFuncSeparate dispatcher. id = 110 */ -static bool yagl_func_glBlendFuncSeparate(struct yagl_transport *t) +static void yagl_func_glBlendFuncSeparate(struct yagl_transport *t) { GLenum srcRGB; GLenum dstRGB; @@ -2271,14 +1945,12 @@ static bool yagl_func_glBlendFuncSeparate(struct yagl_transport *t) YAGL_LOG_FUNC_ENTER_SPLIT4(glBlendFuncSeparate, GLenum, GLenum, GLenum, GLenum, srcRGB, dstRGB, srcAlpha, dstAlpha); (void)yagl_host_glBlendFuncSeparate(srcRGB, dstRGB, srcAlpha, dstAlpha); YAGL_LOG_FUNC_EXIT(NULL); - - return true; } /* * glBlendColor dispatcher. id = 111 */ -static bool yagl_func_glBlendColor(struct yagl_transport *t) +static void yagl_func_glBlendColor(struct yagl_transport *t) { GLclampf red; GLclampf green; @@ -2291,28 +1963,24 @@ static bool yagl_func_glBlendColor(struct yagl_transport *t) YAGL_LOG_FUNC_ENTER_SPLIT4(glBlendColor, GLclampf, GLclampf, GLclampf, GLclampf, red, green, blue, alpha); (void)yagl_host_glBlendColor(red, green, blue, alpha); YAGL_LOG_FUNC_EXIT(NULL); - - return true; } /* * glClear dispatcher. id = 112 */ -static bool yagl_func_glClear(struct yagl_transport *t) +static void yagl_func_glClear(struct yagl_transport *t) { GLbitfield mask; mask = yagl_transport_get_out_GLbitfield(t); YAGL_LOG_FUNC_ENTER_SPLIT1(glClear, GLbitfield, mask); (void)yagl_host_glClear(mask); YAGL_LOG_FUNC_EXIT(NULL); - - return true; } /* * glClearColor dispatcher. id = 113 */ -static bool yagl_func_glClearColor(struct yagl_transport *t) +static void yagl_func_glClearColor(struct yagl_transport *t) { GLclampf red; GLclampf green; @@ -2325,42 +1993,36 @@ static bool yagl_func_glClearColor(struct yagl_transport *t) YAGL_LOG_FUNC_ENTER_SPLIT4(glClearColor, GLclampf, GLclampf, GLclampf, GLclampf, red, green, blue, alpha); (void)yagl_host_glClearColor(red, green, blue, alpha); YAGL_LOG_FUNC_EXIT(NULL); - - return true; } /* * glClearDepthf dispatcher. id = 114 */ -static bool yagl_func_glClearDepthf(struct yagl_transport *t) +static void yagl_func_glClearDepthf(struct yagl_transport *t) { GLclampf depth; depth = yagl_transport_get_out_GLclampf(t); YAGL_LOG_FUNC_ENTER_SPLIT1(glClearDepthf, GLclampf, depth); (void)yagl_host_glClearDepthf(depth); YAGL_LOG_FUNC_EXIT(NULL); - - return true; } /* * glClearStencil dispatcher. id = 115 */ -static bool yagl_func_glClearStencil(struct yagl_transport *t) +static void yagl_func_glClearStencil(struct yagl_transport *t) { GLint s; s = yagl_transport_get_out_GLint(t); YAGL_LOG_FUNC_ENTER_SPLIT1(glClearStencil, GLint, s); (void)yagl_host_glClearStencil(s); YAGL_LOG_FUNC_EXIT(NULL); - - return true; } /* * glColorMask dispatcher. id = 116 */ -static bool yagl_func_glColorMask(struct yagl_transport *t) +static void yagl_func_glColorMask(struct yagl_transport *t) { GLboolean red; GLboolean green; @@ -2373,56 +2035,48 @@ static bool yagl_func_glColorMask(struct yagl_transport *t) YAGL_LOG_FUNC_ENTER_SPLIT4(glColorMask, GLboolean, GLboolean, GLboolean, GLboolean, red, green, blue, alpha); (void)yagl_host_glColorMask(red, green, blue, alpha); YAGL_LOG_FUNC_EXIT(NULL); - - return true; } /* * glCullFace dispatcher. id = 117 */ -static bool yagl_func_glCullFace(struct yagl_transport *t) +static void yagl_func_glCullFace(struct yagl_transport *t) { GLenum mode; mode = yagl_transport_get_out_GLenum(t); YAGL_LOG_FUNC_ENTER_SPLIT1(glCullFace, GLenum, mode); (void)yagl_host_glCullFace(mode); YAGL_LOG_FUNC_EXIT(NULL); - - return true; } /* * glDepthFunc dispatcher. id = 118 */ -static bool yagl_func_glDepthFunc(struct yagl_transport *t) +static void yagl_func_glDepthFunc(struct yagl_transport *t) { GLenum func; func = yagl_transport_get_out_GLenum(t); YAGL_LOG_FUNC_ENTER_SPLIT1(glDepthFunc, GLenum, func); (void)yagl_host_glDepthFunc(func); YAGL_LOG_FUNC_EXIT(NULL); - - return true; } /* * glDepthMask dispatcher. id = 119 */ -static bool yagl_func_glDepthMask(struct yagl_transport *t) +static void yagl_func_glDepthMask(struct yagl_transport *t) { GLboolean flag; flag = yagl_transport_get_out_GLboolean(t); YAGL_LOG_FUNC_ENTER_SPLIT1(glDepthMask, GLboolean, flag); (void)yagl_host_glDepthMask(flag); YAGL_LOG_FUNC_EXIT(NULL); - - return true; } /* * glDepthRangef dispatcher. id = 120 */ -static bool yagl_func_glDepthRangef(struct yagl_transport *t) +static void yagl_func_glDepthRangef(struct yagl_transport *t) { GLclampf zNear; GLclampf zFar; @@ -2431,82 +2085,70 @@ static bool yagl_func_glDepthRangef(struct yagl_transport *t) YAGL_LOG_FUNC_ENTER_SPLIT2(glDepthRangef, GLclampf, GLclampf, zNear, zFar); (void)yagl_host_glDepthRangef(zNear, zFar); YAGL_LOG_FUNC_EXIT(NULL); - - return true; } /* * glEnable dispatcher. id = 121 */ -static bool yagl_func_glEnable(struct yagl_transport *t) +static void yagl_func_glEnable(struct yagl_transport *t) { GLenum cap; cap = yagl_transport_get_out_GLenum(t); YAGL_LOG_FUNC_ENTER_SPLIT1(glEnable, GLenum, cap); (void)yagl_host_glEnable(cap); YAGL_LOG_FUNC_EXIT(NULL); - - return true; } /* * glDisable dispatcher. id = 122 */ -static bool yagl_func_glDisable(struct yagl_transport *t) +static void yagl_func_glDisable(struct yagl_transport *t) { GLenum cap; cap = yagl_transport_get_out_GLenum(t); YAGL_LOG_FUNC_ENTER_SPLIT1(glDisable, GLenum, cap); (void)yagl_host_glDisable(cap); YAGL_LOG_FUNC_EXIT(NULL); - - return true; } /* * glFlush dispatcher. id = 123 */ -static bool yagl_func_glFlush(struct yagl_transport *t) +static void yagl_func_glFlush(struct yagl_transport *t) { YAGL_LOG_FUNC_ENTER_SPLIT0(glFlush); (void)yagl_host_glFlush(); YAGL_LOG_FUNC_EXIT(NULL); - - return true; } /* * glFrontFace dispatcher. id = 124 */ -static bool yagl_func_glFrontFace(struct yagl_transport *t) +static void yagl_func_glFrontFace(struct yagl_transport *t) { GLenum mode; mode = yagl_transport_get_out_GLenum(t); YAGL_LOG_FUNC_ENTER_SPLIT1(glFrontFace, GLenum, mode); (void)yagl_host_glFrontFace(mode); YAGL_LOG_FUNC_EXIT(NULL); - - return true; } /* * glGenerateMipmap dispatcher. id = 125 */ -static bool yagl_func_glGenerateMipmap(struct yagl_transport *t) +static void yagl_func_glGenerateMipmap(struct yagl_transport *t) { GLenum target; target = yagl_transport_get_out_GLenum(t); YAGL_LOG_FUNC_ENTER_SPLIT1(glGenerateMipmap, GLenum, target); (void)yagl_host_glGenerateMipmap(target); YAGL_LOG_FUNC_EXIT(NULL); - - return true; } /* * glHint dispatcher. id = 126 */ -static bool yagl_func_glHint(struct yagl_transport *t) +static void yagl_func_glHint(struct yagl_transport *t) { GLenum target; GLenum mode; @@ -2515,28 +2157,24 @@ static bool yagl_func_glHint(struct yagl_transport *t) YAGL_LOG_FUNC_ENTER_SPLIT2(glHint, GLenum, GLenum, target, mode); (void)yagl_host_glHint(target, mode); YAGL_LOG_FUNC_EXIT(NULL); - - return true; } /* * glLineWidth dispatcher. id = 127 */ -static bool yagl_func_glLineWidth(struct yagl_transport *t) +static void yagl_func_glLineWidth(struct yagl_transport *t) { GLfloat width; width = yagl_transport_get_out_GLfloat(t); YAGL_LOG_FUNC_ENTER_SPLIT1(glLineWidth, GLfloat, width); (void)yagl_host_glLineWidth(width); YAGL_LOG_FUNC_EXIT(NULL); - - return true; } /* * glPixelStorei dispatcher. id = 128 */ -static bool yagl_func_glPixelStorei(struct yagl_transport *t) +static void yagl_func_glPixelStorei(struct yagl_transport *t) { GLenum pname; GLint param; @@ -2545,14 +2183,12 @@ static bool yagl_func_glPixelStorei(struct yagl_transport *t) YAGL_LOG_FUNC_ENTER_SPLIT2(glPixelStorei, GLenum, GLint, pname, param); (void)yagl_host_glPixelStorei(pname, param); YAGL_LOG_FUNC_EXIT(NULL); - - return true; } /* * glPolygonOffset dispatcher. id = 129 */ -static bool yagl_func_glPolygonOffset(struct yagl_transport *t) +static void yagl_func_glPolygonOffset(struct yagl_transport *t) { GLfloat factor; GLfloat units; @@ -2561,14 +2197,12 @@ static bool yagl_func_glPolygonOffset(struct yagl_transport *t) YAGL_LOG_FUNC_ENTER_SPLIT2(glPolygonOffset, GLfloat, GLfloat, factor, units); (void)yagl_host_glPolygonOffset(factor, units); YAGL_LOG_FUNC_EXIT(NULL); - - return true; } /* * glScissor dispatcher. id = 130 */ -static bool yagl_func_glScissor(struct yagl_transport *t) +static void yagl_func_glScissor(struct yagl_transport *t) { GLint x; GLint y; @@ -2581,14 +2215,12 @@ static bool yagl_func_glScissor(struct yagl_transport *t) YAGL_LOG_FUNC_ENTER_SPLIT4(glScissor, GLint, GLint, GLsizei, GLsizei, x, y, width, height); (void)yagl_host_glScissor(x, y, width, height); YAGL_LOG_FUNC_EXIT(NULL); - - return true; } /* * glStencilFunc dispatcher. id = 131 */ -static bool yagl_func_glStencilFunc(struct yagl_transport *t) +static void yagl_func_glStencilFunc(struct yagl_transport *t) { GLenum func; GLint ref; @@ -2599,28 +2231,24 @@ static bool yagl_func_glStencilFunc(struct yagl_transport *t) YAGL_LOG_FUNC_ENTER_SPLIT3(glStencilFunc, GLenum, GLint, GLuint, func, ref, mask); (void)yagl_host_glStencilFunc(func, ref, mask); YAGL_LOG_FUNC_EXIT(NULL); - - return true; } /* * glStencilMask dispatcher. id = 132 */ -static bool yagl_func_glStencilMask(struct yagl_transport *t) +static void yagl_func_glStencilMask(struct yagl_transport *t) { GLuint mask; mask = yagl_transport_get_out_GLuint(t); YAGL_LOG_FUNC_ENTER_SPLIT1(glStencilMask, GLuint, mask); (void)yagl_host_glStencilMask(mask); YAGL_LOG_FUNC_EXIT(NULL); - - return true; } /* * glStencilOp dispatcher. id = 133 */ -static bool yagl_func_glStencilOp(struct yagl_transport *t) +static void yagl_func_glStencilOp(struct yagl_transport *t) { GLenum fail; GLenum zfail; @@ -2631,14 +2259,12 @@ static bool yagl_func_glStencilOp(struct yagl_transport *t) YAGL_LOG_FUNC_ENTER_SPLIT3(glStencilOp, GLenum, GLenum, GLenum, fail, zfail, zpass); (void)yagl_host_glStencilOp(fail, zfail, zpass); YAGL_LOG_FUNC_EXIT(NULL); - - return true; } /* * glSampleCoverage dispatcher. id = 134 */ -static bool yagl_func_glSampleCoverage(struct yagl_transport *t) +static void yagl_func_glSampleCoverage(struct yagl_transport *t) { GLclampf value; GLboolean invert; @@ -2647,14 +2273,12 @@ static bool yagl_func_glSampleCoverage(struct yagl_transport *t) YAGL_LOG_FUNC_ENTER_SPLIT2(glSampleCoverage, GLclampf, GLboolean, value, invert); (void)yagl_host_glSampleCoverage(value, invert); YAGL_LOG_FUNC_EXIT(NULL); - - return true; } /* * glViewport dispatcher. id = 135 */ -static bool yagl_func_glViewport(struct yagl_transport *t) +static void yagl_func_glViewport(struct yagl_transport *t) { GLint x; GLint y; @@ -2667,14 +2291,12 @@ static bool yagl_func_glViewport(struct yagl_transport *t) YAGL_LOG_FUNC_ENTER_SPLIT4(glViewport, GLint, GLint, GLsizei, GLsizei, x, y, width, height); (void)yagl_host_glViewport(x, y, width, height); YAGL_LOG_FUNC_EXIT(NULL); - - return true; } /* * glStencilFuncSeparate dispatcher. id = 136 */ -static bool yagl_func_glStencilFuncSeparate(struct yagl_transport *t) +static void yagl_func_glStencilFuncSeparate(struct yagl_transport *t) { GLenum face; GLenum func; @@ -2687,14 +2309,12 @@ static bool yagl_func_glStencilFuncSeparate(struct yagl_transport *t) YAGL_LOG_FUNC_ENTER_SPLIT4(glStencilFuncSeparate, GLenum, GLenum, GLint, GLuint, face, func, ref, mask); (void)yagl_host_glStencilFuncSeparate(face, func, ref, mask); YAGL_LOG_FUNC_EXIT(NULL); - - return true; } /* * glStencilMaskSeparate dispatcher. id = 137 */ -static bool yagl_func_glStencilMaskSeparate(struct yagl_transport *t) +static void yagl_func_glStencilMaskSeparate(struct yagl_transport *t) { GLenum face; GLuint mask; @@ -2703,14 +2323,12 @@ static bool yagl_func_glStencilMaskSeparate(struct yagl_transport *t) YAGL_LOG_FUNC_ENTER_SPLIT2(glStencilMaskSeparate, GLenum, GLuint, face, mask); (void)yagl_host_glStencilMaskSeparate(face, mask); YAGL_LOG_FUNC_EXIT(NULL); - - return true; } /* * glStencilOpSeparate dispatcher. id = 138 */ -static bool yagl_func_glStencilOpSeparate(struct yagl_transport *t) +static void yagl_func_glStencilOpSeparate(struct yagl_transport *t) { GLenum face; GLenum fail; @@ -2723,28 +2341,24 @@ static bool yagl_func_glStencilOpSeparate(struct yagl_transport *t) YAGL_LOG_FUNC_ENTER_SPLIT4(glStencilOpSeparate, GLenum, GLenum, GLenum, GLenum, face, fail, zfail, zpass); (void)yagl_host_glStencilOpSeparate(face, fail, zfail, zpass); YAGL_LOG_FUNC_EXIT(NULL); - - return true; } /* * glPointSize dispatcher. id = 139 */ -static bool yagl_func_glPointSize(struct yagl_transport *t) +static void yagl_func_glPointSize(struct yagl_transport *t) { GLfloat size; size = yagl_transport_get_out_GLfloat(t); YAGL_LOG_FUNC_ENTER_SPLIT1(glPointSize, GLfloat, size); (void)yagl_host_glPointSize(size); YAGL_LOG_FUNC_EXIT(NULL); - - return true; } /* * glAlphaFunc dispatcher. id = 140 */ -static bool yagl_func_glAlphaFunc(struct yagl_transport *t) +static void yagl_func_glAlphaFunc(struct yagl_transport *t) { GLenum func; GLclampf ref; @@ -2753,64 +2367,54 @@ static bool yagl_func_glAlphaFunc(struct yagl_transport *t) YAGL_LOG_FUNC_ENTER_SPLIT2(glAlphaFunc, GLenum, GLclampf, func, ref); (void)yagl_host_glAlphaFunc(func, ref); YAGL_LOG_FUNC_EXIT(NULL); - - return true; } /* * glMatrixMode dispatcher. id = 141 */ -static bool yagl_func_glMatrixMode(struct yagl_transport *t) +static void yagl_func_glMatrixMode(struct yagl_transport *t) { GLenum mode; mode = yagl_transport_get_out_GLenum(t); YAGL_LOG_FUNC_ENTER_SPLIT1(glMatrixMode, GLenum, mode); (void)yagl_host_glMatrixMode(mode); YAGL_LOG_FUNC_EXIT(NULL); - - return true; } /* * glLoadIdentity dispatcher. id = 142 */ -static bool yagl_func_glLoadIdentity(struct yagl_transport *t) +static void yagl_func_glLoadIdentity(struct yagl_transport *t) { YAGL_LOG_FUNC_ENTER_SPLIT0(glLoadIdentity); (void)yagl_host_glLoadIdentity(); YAGL_LOG_FUNC_EXIT(NULL); - - return true; } /* * glPopMatrix dispatcher. id = 143 */ -static bool yagl_func_glPopMatrix(struct yagl_transport *t) +static void yagl_func_glPopMatrix(struct yagl_transport *t) { YAGL_LOG_FUNC_ENTER_SPLIT0(glPopMatrix); (void)yagl_host_glPopMatrix(); YAGL_LOG_FUNC_EXIT(NULL); - - return true; } /* * glPushMatrix dispatcher. id = 144 */ -static bool yagl_func_glPushMatrix(struct yagl_transport *t) +static void yagl_func_glPushMatrix(struct yagl_transport *t) { YAGL_LOG_FUNC_ENTER_SPLIT0(glPushMatrix); (void)yagl_host_glPushMatrix(); YAGL_LOG_FUNC_EXIT(NULL); - - return true; } /* * glRotatef dispatcher. id = 145 */ -static bool yagl_func_glRotatef(struct yagl_transport *t) +static void yagl_func_glRotatef(struct yagl_transport *t) { GLfloat angle; GLfloat x; @@ -2823,14 +2427,12 @@ static bool yagl_func_glRotatef(struct yagl_transport *t) YAGL_LOG_FUNC_ENTER_SPLIT4(glRotatef, GLfloat, GLfloat, GLfloat, GLfloat, angle, x, y, z); (void)yagl_host_glRotatef(angle, x, y, z); YAGL_LOG_FUNC_EXIT(NULL); - - return true; } /* * glTranslatef dispatcher. id = 146 */ -static bool yagl_func_glTranslatef(struct yagl_transport *t) +static void yagl_func_glTranslatef(struct yagl_transport *t) { GLfloat x; GLfloat y; @@ -2841,14 +2443,12 @@ static bool yagl_func_glTranslatef(struct yagl_transport *t) YAGL_LOG_FUNC_ENTER_SPLIT3(glTranslatef, GLfloat, GLfloat, GLfloat, x, y, z); (void)yagl_host_glTranslatef(x, y, z); YAGL_LOG_FUNC_EXIT(NULL); - - return true; } /* * glScalef dispatcher. id = 147 */ -static bool yagl_func_glScalef(struct yagl_transport *t) +static void yagl_func_glScalef(struct yagl_transport *t) { GLfloat x; GLfloat y; @@ -2859,14 +2459,12 @@ static bool yagl_func_glScalef(struct yagl_transport *t) YAGL_LOG_FUNC_ENTER_SPLIT3(glScalef, GLfloat, GLfloat, GLfloat, x, y, z); (void)yagl_host_glScalef(x, y, z); YAGL_LOG_FUNC_EXIT(NULL); - - return true; } /* * glOrthof dispatcher. id = 148 */ -static bool yagl_func_glOrthof(struct yagl_transport *t) +static void yagl_func_glOrthof(struct yagl_transport *t) { GLfloat left; GLfloat right; @@ -2883,14 +2481,12 @@ static bool yagl_func_glOrthof(struct yagl_transport *t) YAGL_LOG_FUNC_ENTER_SPLIT6(glOrthof, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, left, right, bottom, top, zNear, zFar); (void)yagl_host_glOrthof(left, right, bottom, top, zNear, zFar); YAGL_LOG_FUNC_EXIT(NULL); - - return true; } /* * glColor4f dispatcher. id = 149 */ -static bool yagl_func_glColor4f(struct yagl_transport *t) +static void yagl_func_glColor4f(struct yagl_transport *t) { GLfloat red; GLfloat green; @@ -2903,14 +2499,12 @@ static bool yagl_func_glColor4f(struct yagl_transport *t) YAGL_LOG_FUNC_ENTER_SPLIT4(glColor4f, GLfloat, GLfloat, GLfloat, GLfloat, red, green, blue, alpha); (void)yagl_host_glColor4f(red, green, blue, alpha); YAGL_LOG_FUNC_EXIT(NULL); - - return true; } /* * glColor4ub dispatcher. id = 150 */ -static bool yagl_func_glColor4ub(struct yagl_transport *t) +static void yagl_func_glColor4ub(struct yagl_transport *t) { GLubyte red; GLubyte green; @@ -2923,14 +2517,12 @@ static bool yagl_func_glColor4ub(struct yagl_transport *t) YAGL_LOG_FUNC_ENTER_SPLIT4(glColor4ub, GLubyte, GLubyte, GLubyte, GLubyte, red, green, blue, alpha); (void)yagl_host_glColor4ub(red, green, blue, alpha); YAGL_LOG_FUNC_EXIT(NULL); - - return true; } /* * glNormal3f dispatcher. id = 151 */ -static bool yagl_func_glNormal3f(struct yagl_transport *t) +static void yagl_func_glNormal3f(struct yagl_transport *t) { GLfloat nx; GLfloat ny; @@ -2941,14 +2533,12 @@ static bool yagl_func_glNormal3f(struct yagl_transport *t) YAGL_LOG_FUNC_ENTER_SPLIT3(glNormal3f, GLfloat, GLfloat, GLfloat, nx, ny, nz); (void)yagl_host_glNormal3f(nx, ny, nz); YAGL_LOG_FUNC_EXIT(NULL); - - return true; } /* * glPointParameterf dispatcher. id = 152 */ -static bool yagl_func_glPointParameterf(struct yagl_transport *t) +static void yagl_func_glPointParameterf(struct yagl_transport *t) { GLenum pname; GLfloat param; @@ -2957,33 +2547,27 @@ static bool yagl_func_glPointParameterf(struct yagl_transport *t) YAGL_LOG_FUNC_ENTER_SPLIT2(glPointParameterf, GLenum, GLfloat, pname, param); (void)yagl_host_glPointParameterf(pname, param); YAGL_LOG_FUNC_EXIT(NULL); - - return true; } /* * glPointParameterfv dispatcher. id = 153 */ -static bool yagl_func_glPointParameterfv(struct yagl_transport *t) +static void yagl_func_glPointParameterfv(struct yagl_transport *t) { GLenum pname; const GLfloat *params; int32_t params_count; pname = yagl_transport_get_out_GLenum(t); - if (!yagl_transport_get_out_array(t, sizeof(GLfloat), (const void**)¶ms, ¶ms_count)) { - return false; - } + yagl_transport_get_out_array(t, sizeof(GLfloat), (const void**)¶ms, ¶ms_count); YAGL_LOG_FUNC_ENTER_SPLIT2(glPointParameterfv, GLenum, void*, pname, params); (void)yagl_host_glPointParameterfv(pname, params, params_count); YAGL_LOG_FUNC_EXIT(NULL); - - return true; } /* * glFogf dispatcher. id = 154 */ -static bool yagl_func_glFogf(struct yagl_transport *t) +static void yagl_func_glFogf(struct yagl_transport *t) { GLenum pname; GLfloat param; @@ -2992,33 +2576,27 @@ static bool yagl_func_glFogf(struct yagl_transport *t) YAGL_LOG_FUNC_ENTER_SPLIT2(glFogf, GLenum, GLfloat, pname, param); (void)yagl_host_glFogf(pname, param); YAGL_LOG_FUNC_EXIT(NULL); - - return true; } /* * glFogfv dispatcher. id = 155 */ -static bool yagl_func_glFogfv(struct yagl_transport *t) +static void yagl_func_glFogfv(struct yagl_transport *t) { GLenum pname; const GLfloat *params; int32_t params_count; pname = yagl_transport_get_out_GLenum(t); - if (!yagl_transport_get_out_array(t, sizeof(GLfloat), (const void**)¶ms, ¶ms_count)) { - return false; - } + yagl_transport_get_out_array(t, sizeof(GLfloat), (const void**)¶ms, ¶ms_count); YAGL_LOG_FUNC_ENTER_SPLIT2(glFogfv, GLenum, void*, pname, params); (void)yagl_host_glFogfv(pname, params, params_count); YAGL_LOG_FUNC_EXIT(NULL); - - return true; } /* * glFrustumf dispatcher. id = 156 */ -static bool yagl_func_glFrustumf(struct yagl_transport *t) +static void yagl_func_glFrustumf(struct yagl_transport *t) { GLfloat left; GLfloat right; @@ -3035,14 +2613,12 @@ static bool yagl_func_glFrustumf(struct yagl_transport *t) YAGL_LOG_FUNC_ENTER_SPLIT6(glFrustumf, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, left, right, bottom, top, zNear, zFar); (void)yagl_host_glFrustumf(left, right, bottom, top, zNear, zFar); YAGL_LOG_FUNC_EXIT(NULL); - - return true; } /* * glLightf dispatcher. id = 157 */ -static bool yagl_func_glLightf(struct yagl_transport *t) +static void yagl_func_glLightf(struct yagl_transport *t) { GLenum light; GLenum pname; @@ -3053,14 +2629,12 @@ static bool yagl_func_glLightf(struct yagl_transport *t) YAGL_LOG_FUNC_ENTER_SPLIT3(glLightf, GLenum, GLenum, GLfloat, light, pname, param); (void)yagl_host_glLightf(light, pname, param); YAGL_LOG_FUNC_EXIT(NULL); - - return true; } /* * glLightfv dispatcher. id = 158 */ -static bool yagl_func_glLightfv(struct yagl_transport *t) +static void yagl_func_glLightfv(struct yagl_transport *t) { GLenum light; GLenum pname; @@ -3068,20 +2642,16 @@ static bool yagl_func_glLightfv(struct yagl_transport *t) int32_t params_count; light = yagl_transport_get_out_GLenum(t); pname = yagl_transport_get_out_GLenum(t); - if (!yagl_transport_get_out_array(t, sizeof(GLfloat), (const void**)¶ms, ¶ms_count)) { - return false; - } + yagl_transport_get_out_array(t, sizeof(GLfloat), (const void**)¶ms, ¶ms_count); YAGL_LOG_FUNC_ENTER_SPLIT3(glLightfv, GLenum, GLenum, void*, light, pname, params); (void)yagl_host_glLightfv(light, pname, params, params_count); YAGL_LOG_FUNC_EXIT(NULL); - - return true; } /* * glGetLightfv dispatcher. id = 159 */ -static bool yagl_func_glGetLightfv(struct yagl_transport *t) +static void yagl_func_glGetLightfv(struct yagl_transport *t) { GLenum light; GLenum pname; @@ -3090,21 +2660,17 @@ static bool yagl_func_glGetLightfv(struct yagl_transport *t) int32_t *params_count; light = yagl_transport_get_out_GLenum(t); pname = yagl_transport_get_out_GLenum(t); - if (!yagl_transport_get_in_array(t, sizeof(GLfloat), (void**)¶ms, ¶ms_maxcount, ¶ms_count)) { - return false; - } + yagl_transport_get_in_array(t, sizeof(GLfloat), (void**)¶ms, ¶ms_maxcount, ¶ms_count); YAGL_LOG_FUNC_ENTER_SPLIT3(glGetLightfv, GLenum, GLenum, void*, light, pname, params); *params_count = 0; (void)yagl_host_glGetLightfv(light, pname, params, params_maxcount, params_count); YAGL_LOG_FUNC_EXIT(NULL); - - return true; } /* * glLightModelf dispatcher. id = 160 */ -static bool yagl_func_glLightModelf(struct yagl_transport *t) +static void yagl_func_glLightModelf(struct yagl_transport *t) { GLenum pname; GLfloat param; @@ -3113,33 +2679,27 @@ static bool yagl_func_glLightModelf(struct yagl_transport *t) YAGL_LOG_FUNC_ENTER_SPLIT2(glLightModelf, GLenum, GLfloat, pname, param); (void)yagl_host_glLightModelf(pname, param); YAGL_LOG_FUNC_EXIT(NULL); - - return true; } /* * glLightModelfv dispatcher. id = 161 */ -static bool yagl_func_glLightModelfv(struct yagl_transport *t) +static void yagl_func_glLightModelfv(struct yagl_transport *t) { GLenum pname; const GLfloat *params; int32_t params_count; pname = yagl_transport_get_out_GLenum(t); - if (!yagl_transport_get_out_array(t, sizeof(GLfloat), (const void**)¶ms, ¶ms_count)) { - return false; - } + yagl_transport_get_out_array(t, sizeof(GLfloat), (const void**)¶ms, ¶ms_count); YAGL_LOG_FUNC_ENTER_SPLIT2(glLightModelfv, GLenum, void*, pname, params); (void)yagl_host_glLightModelfv(pname, params, params_count); YAGL_LOG_FUNC_EXIT(NULL); - - return true; } /* * glMaterialf dispatcher. id = 162 */ -static bool yagl_func_glMaterialf(struct yagl_transport *t) +static void yagl_func_glMaterialf(struct yagl_transport *t) { GLenum face; GLenum pname; @@ -3150,14 +2710,12 @@ static bool yagl_func_glMaterialf(struct yagl_transport *t) YAGL_LOG_FUNC_ENTER_SPLIT3(glMaterialf, GLenum, GLenum, GLfloat, face, pname, param); (void)yagl_host_glMaterialf(face, pname, param); YAGL_LOG_FUNC_EXIT(NULL); - - return true; } /* * glMaterialfv dispatcher. id = 163 */ -static bool yagl_func_glMaterialfv(struct yagl_transport *t) +static void yagl_func_glMaterialfv(struct yagl_transport *t) { GLenum face; GLenum pname; @@ -3165,20 +2723,16 @@ static bool yagl_func_glMaterialfv(struct yagl_transport *t) int32_t params_count; face = yagl_transport_get_out_GLenum(t); pname = yagl_transport_get_out_GLenum(t); - if (!yagl_transport_get_out_array(t, sizeof(GLfloat), (const void**)¶ms, ¶ms_count)) { - return false; - } + yagl_transport_get_out_array(t, sizeof(GLfloat), (const void**)¶ms, ¶ms_count); YAGL_LOG_FUNC_ENTER_SPLIT3(glMaterialfv, GLenum, GLenum, void*, face, pname, params); (void)yagl_host_glMaterialfv(face, pname, params, params_count); YAGL_LOG_FUNC_EXIT(NULL); - - return true; } /* * glGetMaterialfv dispatcher. id = 164 */ -static bool yagl_func_glGetMaterialfv(struct yagl_transport *t) +static void yagl_func_glGetMaterialfv(struct yagl_transport *t) { GLenum face; GLenum pname; @@ -3187,123 +2741,99 @@ static bool yagl_func_glGetMaterialfv(struct yagl_transport *t) int32_t *params_count; face = yagl_transport_get_out_GLenum(t); pname = yagl_transport_get_out_GLenum(t); - if (!yagl_transport_get_in_array(t, sizeof(GLfloat), (void**)¶ms, ¶ms_maxcount, ¶ms_count)) { - return false; - } + yagl_transport_get_in_array(t, sizeof(GLfloat), (void**)¶ms, ¶ms_maxcount, ¶ms_count); YAGL_LOG_FUNC_ENTER_SPLIT3(glGetMaterialfv, GLenum, GLenum, void*, face, pname, params); *params_count = 0; (void)yagl_host_glGetMaterialfv(face, pname, params, params_maxcount, params_count); YAGL_LOG_FUNC_EXIT(NULL); - - return true; } /* * glShadeModel dispatcher. id = 165 */ -static bool yagl_func_glShadeModel(struct yagl_transport *t) +static void yagl_func_glShadeModel(struct yagl_transport *t) { GLenum mode; mode = yagl_transport_get_out_GLenum(t); YAGL_LOG_FUNC_ENTER_SPLIT1(glShadeModel, GLenum, mode); (void)yagl_host_glShadeModel(mode); YAGL_LOG_FUNC_EXIT(NULL); - - return true; } /* * glLogicOp dispatcher. id = 166 */ -static bool yagl_func_glLogicOp(struct yagl_transport *t) +static void yagl_func_glLogicOp(struct yagl_transport *t) { GLenum opcode; opcode = yagl_transport_get_out_GLenum(t); YAGL_LOG_FUNC_ENTER_SPLIT1(glLogicOp, GLenum, opcode); (void)yagl_host_glLogicOp(opcode); YAGL_LOG_FUNC_EXIT(NULL); - - return true; } /* * glMultMatrixf dispatcher. id = 167 */ -static bool yagl_func_glMultMatrixf(struct yagl_transport *t) +static void yagl_func_glMultMatrixf(struct yagl_transport *t) { const GLfloat *m; int32_t m_count; - if (!yagl_transport_get_out_array(t, sizeof(GLfloat), (const void**)&m, &m_count)) { - return false; - } + yagl_transport_get_out_array(t, sizeof(GLfloat), (const void**)&m, &m_count); YAGL_LOG_FUNC_ENTER_SPLIT1(glMultMatrixf, void*, m); (void)yagl_host_glMultMatrixf(m, m_count); YAGL_LOG_FUNC_EXIT(NULL); - - return true; } /* * glLoadMatrixf dispatcher. id = 168 */ -static bool yagl_func_glLoadMatrixf(struct yagl_transport *t) +static void yagl_func_glLoadMatrixf(struct yagl_transport *t) { const GLfloat *m; int32_t m_count; - if (!yagl_transport_get_out_array(t, sizeof(GLfloat), (const void**)&m, &m_count)) { - return false; - } + yagl_transport_get_out_array(t, sizeof(GLfloat), (const void**)&m, &m_count); YAGL_LOG_FUNC_ENTER_SPLIT1(glLoadMatrixf, void*, m); (void)yagl_host_glLoadMatrixf(m, m_count); YAGL_LOG_FUNC_EXIT(NULL); - - return true; } /* * glClipPlanef dispatcher. id = 169 */ -static bool yagl_func_glClipPlanef(struct yagl_transport *t) +static void yagl_func_glClipPlanef(struct yagl_transport *t) { GLenum plane; const GLfloat *equation; int32_t equation_count; plane = yagl_transport_get_out_GLenum(t); - if (!yagl_transport_get_out_array(t, sizeof(GLfloat), (const void**)&equation, &equation_count)) { - return false; - } + yagl_transport_get_out_array(t, sizeof(GLfloat), (const void**)&equation, &equation_count); YAGL_LOG_FUNC_ENTER_SPLIT2(glClipPlanef, GLenum, void*, plane, equation); (void)yagl_host_glClipPlanef(plane, equation, equation_count); YAGL_LOG_FUNC_EXIT(NULL); - - return true; } /* * glGetClipPlanef dispatcher. id = 170 */ -static bool yagl_func_glGetClipPlanef(struct yagl_transport *t) +static void yagl_func_glGetClipPlanef(struct yagl_transport *t) { GLenum pname; GLfloat *eqn; int32_t eqn_maxcount; int32_t *eqn_count; pname = yagl_transport_get_out_GLenum(t); - if (!yagl_transport_get_in_array(t, sizeof(GLfloat), (void**)&eqn, &eqn_maxcount, &eqn_count)) { - return false; - } + yagl_transport_get_in_array(t, sizeof(GLfloat), (void**)&eqn, &eqn_maxcount, &eqn_count); YAGL_LOG_FUNC_ENTER_SPLIT2(glGetClipPlanef, GLenum, void*, pname, eqn); *eqn_count = 0; (void)yagl_host_glGetClipPlanef(pname, eqn, eqn_maxcount, eqn_count); YAGL_LOG_FUNC_EXIT(NULL); - - return true; } /* * glUpdateOffscreenImageYAGL dispatcher. id = 171 */ -static bool yagl_func_glUpdateOffscreenImageYAGL(struct yagl_transport *t) +static void yagl_func_glUpdateOffscreenImageYAGL(struct yagl_transport *t) { GLuint texture; uint32_t width; @@ -3315,20 +2845,16 @@ static bool yagl_func_glUpdateOffscreenImageYAGL(struct yagl_transport *t) width = yagl_transport_get_out_uint32_t(t); height = yagl_transport_get_out_uint32_t(t); bpp = yagl_transport_get_out_uint32_t(t); - if (!yagl_transport_get_out_array(t, 1, (const void**)&pixels, &pixels_count)) { - return false; - } + yagl_transport_get_out_array(t, 1, (const void**)&pixels, &pixels_count); YAGL_LOG_FUNC_ENTER_SPLIT5(glUpdateOffscreenImageYAGL, GLuint, uint32_t, uint32_t, uint32_t, void*, texture, width, height, bpp, pixels); (void)yagl_host_glUpdateOffscreenImageYAGL(texture, width, height, bpp, pixels, pixels_count); YAGL_LOG_FUNC_EXIT(NULL); - - return true; } /* * glGenUniformLocationYAGL dispatcher. id = 172 */ -static bool yagl_func_glGenUniformLocationYAGL(struct yagl_transport *t) +static void yagl_func_glGenUniformLocationYAGL(struct yagl_transport *t) { uint32_t location; GLuint program; @@ -3336,31 +2862,23 @@ static bool yagl_func_glGenUniformLocationYAGL(struct yagl_transport *t) int32_t name_count; location = yagl_transport_get_out_uint32_t(t); program = yagl_transport_get_out_GLuint(t); - if (!yagl_transport_get_out_array(t, sizeof(GLchar), (const void**)&name, &name_count)) { - return false; - } + yagl_transport_get_out_array(t, sizeof(GLchar), (const void**)&name, &name_count); YAGL_LOG_FUNC_ENTER_SPLIT3(glGenUniformLocationYAGL, uint32_t, GLuint, void*, location, program, name); (void)yagl_host_glGenUniformLocationYAGL(location, program, name, name_count); YAGL_LOG_FUNC_EXIT(NULL); - - return true; } /* * glDeleteUniformLocationsYAGL dispatcher. id = 173 */ -static bool yagl_func_glDeleteUniformLocationsYAGL(struct yagl_transport *t) +static void yagl_func_glDeleteUniformLocationsYAGL(struct yagl_transport *t) { const uint32_t *locations; int32_t locations_count; - if (!yagl_transport_get_out_array(t, sizeof(uint32_t), (const void**)&locations, &locations_count)) { - return false; - } + yagl_transport_get_out_array(t, sizeof(uint32_t), (const void**)&locations, &locations_count); YAGL_LOG_FUNC_ENTER_SPLIT1(glDeleteUniformLocationsYAGL, void*, locations); (void)yagl_host_glDeleteUniformLocationsYAGL(locations, locations_count); YAGL_LOG_FUNC_EXIT(NULL); - - return true; } const uint32_t yagl_gles_api_num_funcs = 173; diff --git a/hw/yagl/yagl_backends/egl_offscreen/yagl_egl_offscreen_surface.c b/hw/yagl/yagl_backends/egl_offscreen/yagl_egl_offscreen_surface.c index d02fadb..3351f22 100644 --- a/hw/yagl/yagl_backends/egl_offscreen/yagl_egl_offscreen_surface.c +++ b/hw/yagl/yagl_backends/egl_offscreen/yagl_egl_offscreen_surface.c @@ -116,7 +116,7 @@ static bool yagl_egl_offscreen_surface_query(struct yagl_eglb_surface *sfc, return true; } -static bool yagl_egl_offscreen_surface_swap_buffers(struct yagl_eglb_surface *sfc) +static void yagl_egl_offscreen_surface_swap_buffers(struct yagl_eglb_surface *sfc) { struct yagl_egl_offscreen_surface *osfc = (struct yagl_egl_offscreen_surface*)sfc; @@ -132,17 +132,15 @@ static bool yagl_egl_offscreen_surface_swap_buffers(struct yagl_eglb_surface *sf osfc->bpp, osfc->host_pixels)) { YAGL_LOG_ERROR("read_pixels failed"); - return false; + return; } assert(osfc->bimage_ct); yagl_compiled_transfer_exec(osfc->bimage_ct, osfc->host_pixels); - - return true; } -static bool yagl_egl_offscreen_surface_copy_buffers(struct yagl_eglb_surface *sfc) +static void yagl_egl_offscreen_surface_copy_buffers(struct yagl_eglb_surface *sfc) { struct yagl_egl_offscreen_surface *osfc = (struct yagl_egl_offscreen_surface*)sfc; @@ -158,14 +156,12 @@ static bool yagl_egl_offscreen_surface_copy_buffers(struct yagl_eglb_surface *sf osfc->bpp, osfc->host_pixels)) { YAGL_LOG_ERROR("read_pixels failed"); - return false; + return; } assert(osfc->bimage_ct); yagl_compiled_transfer_exec(osfc->bimage_ct, osfc->host_pixels); - - return true; } static void yagl_egl_offscreen_surface_wait_gl(struct yagl_eglb_surface *sfc) diff --git a/hw/yagl/yagl_backends/egl_onscreen/yagl_egl_onscreen_surface.c b/hw/yagl/yagl_backends/egl_onscreen/yagl_egl_onscreen_surface.c index 911e22a..cac5ba2 100644 --- a/hw/yagl/yagl_backends/egl_onscreen/yagl_egl_onscreen_surface.c +++ b/hw/yagl/yagl_backends/egl_onscreen/yagl_egl_onscreen_surface.c @@ -119,7 +119,7 @@ static bool yagl_egl_onscreen_surface_query(struct yagl_eglb_surface *sfc, return true; } -static bool yagl_egl_onscreen_surface_swap_buffers(struct yagl_eglb_surface *sfc) +static void yagl_egl_onscreen_surface_swap_buffers(struct yagl_eglb_surface *sfc) { struct yagl_egl_onscreen_surface *osfc = (struct yagl_egl_onscreen_surface*)sfc; @@ -129,11 +129,9 @@ static bool yagl_egl_onscreen_surface_swap_buffers(struct yagl_eglb_surface *sfc egl_onscreen->gles_driver->Finish(); osfc->ws_sfc->base.set_dirty(&osfc->ws_sfc->base); - - return true; } -static bool yagl_egl_onscreen_surface_copy_buffers(struct yagl_eglb_surface *sfc) +static void yagl_egl_onscreen_surface_copy_buffers(struct yagl_eglb_surface *sfc) { struct yagl_egl_onscreen_surface *osfc = (struct yagl_egl_onscreen_surface*)sfc; @@ -143,8 +141,6 @@ static bool yagl_egl_onscreen_surface_copy_buffers(struct yagl_eglb_surface *sfc egl_onscreen->gles_driver->Finish(); osfc->ws_sfc->base.set_dirty(&osfc->ws_sfc->base); - - return true; } static void yagl_egl_onscreen_surface_wait_gl(struct yagl_eglb_surface *sfc) diff --git a/hw/yagl/yagl_compiled_transfer.c b/hw/yagl/yagl_compiled_transfer.c index 32d08b2..bdf383e 100644 --- a/hw/yagl/yagl_compiled_transfer.c +++ b/hw/yagl/yagl_compiled_transfer.c @@ -32,6 +32,7 @@ #include "yagl_thread.h" #include "yagl_process.h" #include "yagl_log.h" +#include "yagl_transport.h" #include "exec/cpu-all.h" #define YAGL_TARGET_PAGE_VA(addr) ((addr) & ~(TARGET_PAGE_SIZE - 1)) @@ -56,16 +57,62 @@ struct yagl_compiled_transfer bool is_write) { struct yagl_compiled_transfer *ct; + + ct = g_malloc0(sizeof(*ct)); + + ct->va = va; + ct->len = len; + ct->is_write = is_write; + + QLIST_INSERT_HEAD(&cur_ts->t->compiled_transfers, ct, entry); + + ct->in_list = true; + + return ct; +} + +void yagl_compiled_transfer_destroy(struct yagl_compiled_transfer *ct) +{ + int i; + + if (ct->in_list) { + QLIST_REMOVE(ct, entry); + ct->in_list = false; + } + + for (i = 0; i < ct->num_sections; ++i) { + cpu_physical_memory_unmap(ct->sections[i].map_base, + ct->sections[i].map_len, + 0, + ct->sections[i].map_len); + } + + g_free(ct->sections); + + ct->sections = NULL; + ct->num_sections = 0; + + g_free(ct); +} + +void yagl_compiled_transfer_prepare(struct yagl_compiled_transfer *ct) +{ struct yagl_vector v; - target_ulong last_page_va = YAGL_TARGET_PAGE_VA(va + len - 1); - target_ulong cur_va = va; + target_ulong last_page_va = YAGL_TARGET_PAGE_VA(ct->va + ct->len - 1); + target_ulong cur_va = ct->va; + uint32_t len = ct->len; int i, num_sections; - YAGL_LOG_FUNC_ENTER(yagl_compiled_transfer_init, + YAGL_LOG_FUNC_ENTER(yagl_compiled_transfer_prepare, "va = 0x%X, len = 0x%X, is_write = %u", - (uint32_t)va, - len, - (uint32_t)is_write); + (uint32_t)ct->va, + ct->len, + (uint32_t)ct->is_write); + + if (ct->in_list) { + QLIST_REMOVE(ct, entry); + ct->in_list = false; + } yagl_vector_init(&v, sizeof(struct yagl_compiled_transfer_section), 0); @@ -128,15 +175,12 @@ struct yagl_compiled_transfer cur_va += section.len; } - ct = g_malloc0(sizeof(*ct)); - ct->num_sections = yagl_vector_size(&v); ct->sections = yagl_vector_detach(&v); - ct->is_write = is_write; YAGL_LOG_FUNC_EXIT("num_sections = %d", ct->num_sections); - return ct; + return; fail: num_sections = yagl_vector_size(&v); @@ -156,28 +200,6 @@ fail: yagl_vector_cleanup(&v); YAGL_LOG_FUNC_EXIT(NULL); - - return NULL; -} - -void yagl_compiled_transfer_destroy(struct yagl_compiled_transfer *ct) -{ - int i; - - for (i = 0; i < ct->num_sections; ++i) { - cpu_physical_memory_unmap(ct->sections[i].map_base, - ct->sections[i].map_len, - 0, - ct->sections[i].map_len); - } - - g_free(ct->sections); - - ct->sections = NULL; - ct->num_sections = 0; - ct->is_write = false; - - g_free(ct); } void yagl_compiled_transfer_exec(struct yagl_compiled_transfer *ct, void* data) diff --git a/hw/yagl/yagl_compiled_transfer.h b/hw/yagl/yagl_compiled_transfer.h index adfe537..50580d8 100644 --- a/hw/yagl/yagl_compiled_transfer.h +++ b/hw/yagl/yagl_compiled_transfer.h @@ -31,6 +31,7 @@ #define _QEMU_YAGL_COMPILED_TRANSFER_H #include "yagl_types.h" +#include "qemu/queue.h" struct yagl_compiled_transfer_section { @@ -49,9 +50,16 @@ struct yagl_compiled_transfer_section struct yagl_compiled_transfer { + QLIST_ENTRY(yagl_compiled_transfer) entry; + + target_ulong va; + uint32_t len; + bool is_write; + + bool in_list; + struct yagl_compiled_transfer_section *sections; int num_sections; - bool is_write; }; struct yagl_compiled_transfer @@ -61,6 +69,8 @@ struct yagl_compiled_transfer void yagl_compiled_transfer_destroy(struct yagl_compiled_transfer *ct); +void yagl_compiled_transfer_prepare(struct yagl_compiled_transfer *ct); + void yagl_compiled_transfer_exec(struct yagl_compiled_transfer *ct, void* data); #endif diff --git a/hw/yagl/yagl_device.c b/hw/yagl/yagl_device.c index f7a5dab..ff66228 100644 --- a/hw/yagl/yagl_device.c +++ b/hw/yagl/yagl_device.c @@ -56,6 +56,8 @@ #define YAGL_MAX_USERS (YAGL_MEM_SIZE / YAGL_REGS_SIZE) +struct work_queue; + struct yagl_user { bool activated; @@ -66,8 +68,13 @@ struct yagl_user typedef struct YaGLState { PCIDevice dev; + void *display; + + struct work_queue *render_queue; + struct winsys_interface *wsi; + MemoryRegion iomem; struct yagl_server_state *ss; struct yagl_user users[YAGL_MAX_USERS]; @@ -157,15 +164,15 @@ out: YAGL_LOG_FUNC_EXIT(NULL); } -static void yagl_device_trigger(YaGLState *s, int user_index, uint32_t offset) +static void yagl_device_trigger(YaGLState *s, int user_index, bool sync) { - YAGL_LOG_FUNC_ENTER(yagl_device_trigger, "%d, %u", user_index, offset); + YAGL_LOG_FUNC_ENTER(yagl_device_trigger, "%d, %d", user_index, sync); if (s->users[user_index].activated) { yagl_server_dispatch_batch(s->ss, s->users[user_index].process_id, s->users[user_index].thread_id, - offset); + sync); } else { YAGL_LOG_CRITICAL("user %d not activated", user_index); } @@ -262,7 +269,8 @@ static int yagl_device_init(PCIDevice *dev) */ egl_driver = NULL; - s->ss = yagl_server_state_create(egl_backend, gles_driver); + s->ss = yagl_server_state_create(egl_backend, gles_driver, + s->render_queue, s->wsi); /* * Owned/destroyed by server state. @@ -344,6 +352,11 @@ static Property yagl_properties[] = { .offset = offsetof(YaGLState, display), }, { + .name = "render_queue", + .info = &qdev_prop_ptr, + .offset = offsetof(YaGLState, render_queue), + }, + { .name = "winsys_gl_interface", .info = &qdev_prop_ptr, .offset = offsetof(YaGLState, wsi), diff --git a/hw/yagl/yagl_eglb_surface.h b/hw/yagl/yagl_eglb_surface.h index fa9de86..67ecdd8 100644 --- a/hw/yagl/yagl_eglb_surface.h +++ b/hw/yagl/yagl_eglb_surface.h @@ -71,9 +71,9 @@ struct yagl_eglb_surface EGLint /*attribute*/, EGLint */*value*/); - bool (*swap_buffers)(struct yagl_eglb_surface */*sfc*/); + void (*swap_buffers)(struct yagl_eglb_surface */*sfc*/); - bool (*copy_buffers)(struct yagl_eglb_surface */*sfc*/); + void (*copy_buffers)(struct yagl_eglb_surface */*sfc*/); void (*wait_gl)(struct yagl_eglb_surface */*sfc*/); diff --git a/hw/yagl/yagl_mem.c b/hw/yagl/yagl_mem.c index 8534581..d6a4c73 100644 --- a/hw/yagl/yagl_mem.c +++ b/hw/yagl/yagl_mem.c @@ -33,105 +33,21 @@ #include "yagl_log.h" #include "exec/cpu-all.h" -struct yagl_mem_transfer *yagl_mem_transfer_create(void) +bool yagl_mem_put(target_ulong va, const void* data, uint32_t len) { - struct yagl_mem_transfer *mt; - - mt = g_malloc0(sizeof(*mt)); - - return mt; -} - -void yagl_mem_transfer_destroy(struct yagl_mem_transfer *mt) -{ - g_free(mt->pages); - g_free(mt); -} - -bool yagl_mem_prepare(struct yagl_mem_transfer *mt, - target_ulong va, - int len) -{ - bool res = true; - int l; - hwaddr page_pa; - target_ulong page_va; - - YAGL_LOG_FUNC_ENTER(yagl_mem_prepare, "va = 0x%X, len = %d", (uint32_t)va, len); - - if (len >= 0) { - int max_pages = ((len + TARGET_PAGE_SIZE - 1) / TARGET_PAGE_SIZE) + 1; - - if (max_pages > mt->max_pages) { - g_free(mt->pages); - mt->pages = g_malloc(sizeof(*mt->pages) * max_pages); - } - - mt->max_pages = max_pages; - } - - mt->va = va; - mt->offset = (va & ~TARGET_PAGE_MASK); - mt->len = len; - mt->num_pages = 0; - - if (va) { - while (len > 0) { - page_va = va & TARGET_PAGE_MASK; - page_pa = cpu_get_phys_page_debug(current_cpu, page_va); - - if (page_pa == -1) { - YAGL_LOG_WARN("page fault at 0x%X", (uint32_t)page_va); - res = false; - break; - } - - l = (page_va + TARGET_PAGE_SIZE) - va; - if (l > len) { - l = len; - } + int ret; - len -= l; - va += l; + YAGL_LOG_FUNC_ENTER(yagl_mem_put, "va = 0x%X, len = %u", (uint32_t)va, len); - assert(mt->num_pages < mt->max_pages); + ret = cpu_memory_rw_debug(current_cpu, va, (void*)data, len, 1); - mt->pages[mt->num_pages++] = page_pa; - } + if (ret == -1) { + YAGL_LOG_WARN("page fault at 0x%X", (uint32_t)va, len); } YAGL_LOG_FUNC_EXIT(NULL); - return res; -} - -void yagl_mem_put(struct yagl_mem_transfer *mt, const void *data, int len) -{ - int offset = mt->offset, i = 0; - - YAGL_LOG_FUNC_ENTER(yagl_mem_put, "va = 0X%X, data = %p, len = %d", (uint32_t)mt->va, data, len); - - if (!mt->va) { - assert(false); - YAGL_LOG_CRITICAL("mt->va is 0"); - YAGL_LOG_FUNC_EXIT(NULL); - return; - } - - while (len > 0) { - int l = MIN(len, (TARGET_PAGE_SIZE - offset)); - - assert(i < mt->num_pages); - - cpu_physical_memory_write_rom(mt->pages[i++] + offset, data, l); - - offset = 0; - - data += l; - len -= l; - } - - YAGL_LOG_FUNC_EXIT(NULL); + return ret != -1; } bool yagl_mem_get(target_ulong va, uint32_t len, void* data) diff --git a/hw/yagl/yagl_mem.h b/hw/yagl/yagl_mem.h index 75b8fc7..80dae0c 100644 --- a/hw/yagl/yagl_mem.h +++ b/hw/yagl/yagl_mem.h @@ -32,29 +32,7 @@ #include "yagl_types.h" -struct yagl_mem_transfer -{ - hwaddr *pages; - int max_pages; - - target_ulong va; - int offset; - int len; - int num_pages; -}; - -/* - * Guaranteed to succeed. - */ -struct yagl_mem_transfer *yagl_mem_transfer_create(void); - -void yagl_mem_transfer_destroy(struct yagl_mem_transfer *mt); - -bool yagl_mem_prepare(struct yagl_mem_transfer *mt, - target_ulong va, - int len); - -void yagl_mem_put(struct yagl_mem_transfer *mt, const void *data, int len); +bool yagl_mem_put(target_ulong va, const void *data, uint32_t len); bool yagl_mem_get(target_ulong va, uint32_t len, void *data); diff --git a/hw/yagl/yagl_server.c b/hw/yagl/yagl_server.c index ea24759..bbb097b 100644 --- a/hw/yagl/yagl_server.c +++ b/hw/yagl/yagl_server.c @@ -33,7 +33,6 @@ #include "yagl_thread.h" #include "yagl_version.h" #include "yagl_log.h" -#include "yagl_transport.h" #include "yagl_egl_backend.h" #include "yagl_apis/egl/yagl_egl_api.h" #include "yagl_apis/gles/yagl_gles_api.h" @@ -71,7 +70,9 @@ static struct yagl_thread_state struct yagl_server_state *yagl_server_state_create(struct yagl_egl_backend *egl_backend, - struct yagl_gles_driver *gles_driver) + struct yagl_gles_driver *gles_driver, + struct work_queue *render_queue, + struct winsys_interface *wsi) { int i; struct yagl_server_state *ss = @@ -79,15 +80,6 @@ struct yagl_server_state QLIST_INIT(&ss->processes); - ss->t = yagl_transport_create(); - - if (!ss->t) { - egl_backend->destroy(egl_backend); - gles_driver->destroy(gles_driver); - - goto fail; - } - ss->apis[yagl_api_id_egl - 1] = yagl_egl_api_create(egl_backend); if (!ss->apis[yagl_api_id_egl - 1]) { @@ -107,6 +99,10 @@ struct yagl_server_state ss->render_type = egl_backend->render_type; + ss->render_queue = render_queue; + + ss->wsi = wsi; + return ss; fail: @@ -117,10 +113,6 @@ fail: } } - if (ss->t) { - yagl_transport_destroy(ss->t); - } - g_free(ss); return NULL; @@ -139,8 +131,6 @@ void yagl_server_state_destroy(struct yagl_server_state *ss) } } - yagl_transport_destroy(ss->t); - g_free(ss); } @@ -148,6 +138,8 @@ void yagl_server_reset(struct yagl_server_state *ss) { struct yagl_process_state *ps, *next; + work_queue_wait(ss->render_queue); + QLIST_FOREACH_SAFE(ps, &ss->processes, entry, next) { QLIST_REMOVE(ps, entry); yagl_process_state_destroy(ps); @@ -196,6 +188,8 @@ bool yagl_server_dispatch_init(struct yagl_server_state *ss, return false; } + work_queue_wait(ss->render_queue); + QLIST_FOREACH(ps, &ss->processes, entry) { if (ps->id == *target_pid) { /* @@ -312,6 +306,8 @@ void yagl_server_dispatch_update(struct yagl_server_state *ss, goto fail; } + work_queue_wait(ss->render_queue); + count = yagl_marshal_get_uint32_t(&buff); if (count > ((TARGET_PAGE_SIZE / 8) - 2)) { @@ -358,7 +354,7 @@ out: void yagl_server_dispatch_batch(struct yagl_server_state *ss, yagl_pid target_pid, yagl_tid target_tid, - uint32_t offset) + bool sync) { struct yagl_thread_state *ts; @@ -367,7 +363,7 @@ void yagl_server_dispatch_batch(struct yagl_server_state *ss, ts = yagl_server_find_thread(ss, target_pid, target_tid); if (ts) { - yagl_thread_call(ts, offset); + yagl_thread_call(ts, sync); } else { YAGL_LOG_CRITICAL("process/thread %u/%u not found", target_pid, target_tid); @@ -395,6 +391,8 @@ void yagl_server_dispatch_exit(struct yagl_server_state *ss, return; } + work_queue_wait(ss->render_queue); + ps = ts->ps; yagl_process_remove_thread(ps, target_tid); diff --git a/hw/yagl/yagl_server.h b/hw/yagl/yagl_server.h index 09aacb1..e012b2e 100644 --- a/hw/yagl/yagl_server.h +++ b/hw/yagl/yagl_server.h @@ -37,7 +37,8 @@ struct yagl_api; struct yagl_process_state; struct yagl_egl_backend; struct yagl_gles_driver; -struct yagl_transport; +struct work_queue; +struct winsys_interface; struct yagl_server_state { @@ -47,10 +48,9 @@ struct yagl_server_state QLIST_HEAD(, yagl_process_state) processes; - /* - * Single transport that's used by all threads. - */ - struct yagl_transport *t; + struct work_queue *render_queue; + + struct winsys_interface *wsi; }; /* @@ -65,7 +65,9 @@ struct yagl_server_state */ struct yagl_server_state *yagl_server_state_create(struct yagl_egl_backend *egl_backend, - struct yagl_gles_driver *gles_driver); + struct yagl_gles_driver *gles_driver, + struct work_queue *render_queue, + struct winsys_interface *wsi); void yagl_server_state_destroy(struct yagl_server_state *ss); /* @@ -99,7 +101,7 @@ void yagl_server_dispatch_update(struct yagl_server_state *ss, void yagl_server_dispatch_batch(struct yagl_server_state *ss, yagl_pid target_pid, yagl_tid target_tid, - uint32_t offset); + bool sync); /* * This is called for last YaGL call. diff --git a/hw/yagl/yagl_thread.c b/hw/yagl/yagl_thread.c index f92a8e7..ff3206a 100644 --- a/hw/yagl/yagl_thread.c +++ b/hw/yagl/yagl_thread.c @@ -35,11 +35,25 @@ #include "yagl_stats.h" #include "yagl_transport.h" #include "yagl_object_map.h" +#include "work_queue.h" +#include "winsys.h" #include "sysemu/kvm.h" #include "sysemu/hax.h" YAGL_DEFINE_TLS(struct yagl_thread_state*, cur_ts); +struct yagl_thread_work_item +{ + struct work_queue_item base; + + struct yagl_thread_state *ts; + + uint32_t fence_seq; + + uint32_t batch_size; + uint32_t out_arrays_size; +}; + #ifdef CONFIG_KVM static __inline void yagl_cpu_synchronize_state(struct yagl_process_state *ps) { @@ -53,6 +67,88 @@ static __inline void yagl_cpu_synchronize_state(struct yagl_process_state *ps) } #endif +static void yagl_thread_work(struct work_queue_item *wq_item) +{ + struct yagl_thread_work_item *item = (struct yagl_thread_work_item*)wq_item; + int i; + uint32_t num_calls = 0; + struct yagl_transport *t = item->ts->t; + struct winsys_interface *wsi = item->ts->ps->ss->wsi; + + cur_ts = item->ts; + + YAGL_LOG_FUNC_SET(yagl_thread_work); + + YAGL_LOG_TRACE("batch started"); + + for (i = 0; i < YAGL_NUM_APIS; ++i) { + if (cur_ts->ps->api_states[i]) { + cur_ts->ps->api_states[i]->batch_start(cur_ts->ps->api_states[i]); + } + } + + yagl_transport_reset(t, (uint8_t*)(item + 1), + item->batch_size, item->out_arrays_size); + + while (true) { + yagl_api_id api_id; + yagl_func_id func_id; + struct yagl_api_ps *api_ps; + yagl_api_func func; + + if (!yagl_transport_begin_call(t, &api_id, &func_id)) { + /* + * Batch ended. + */ + break; + } + + if ((api_id <= 0) || (api_id > YAGL_NUM_APIS)) { + YAGL_LOG_CRITICAL("target-host protocol error, bad api_id - %u", api_id); + break; + } + + api_ps = cur_ts->ps->api_states[api_id - 1]; + + if (!api_ps) { + YAGL_LOG_CRITICAL("uninitialized api - %u. host logic error", api_id); + break; + } + + func = api_ps->get_func(api_ps, func_id); + + if (func) { + func(t); + yagl_transport_end_call(t); + } else { + YAGL_LOG_CRITICAL("bad function call (api = %u, func = %u)", + api_id, + func_id); + break; + } + + ++num_calls; + } + + YAGL_LOG_TRACE("batch ended: %u calls", num_calls); + + for (i = 0; i < YAGL_NUM_APIS; ++i) { + if (cur_ts->ps->api_states[i]) { + cur_ts->ps->api_states[i]->batch_end(cur_ts->ps->api_states[i]); + } + } + + cur_ts = NULL; + + --item->ts->num_in_progress; + + if (wsi && item->fence_seq) { + wsi->fence_ack(wsi, item->fence_seq); + } + + g_free(item); +} + struct yagl_thread_state *yagl_thread_state_create(struct yagl_process_state *ps, yagl_tid id, @@ -65,6 +161,7 @@ struct yagl_thread_state ts->ps = ps; ts->id = id; + ts->t = yagl_transport_create(); cur_ts = ts; @@ -134,107 +231,63 @@ void yagl_thread_state_destroy(struct yagl_thread_state *ts, yagl_thread_set_buffer(ts, NULL); + yagl_transport_destroy(ts->t); + g_free(ts); } void yagl_thread_set_buffer(struct yagl_thread_state *ts, uint8_t **pages) { - if (ts->pages) { + if (ts->t->pages) { uint8_t **tmp; - for (tmp = ts->pages; *tmp; ++tmp) { + for (tmp = ts->t->pages; *tmp; ++tmp) { cpu_physical_memory_unmap(*tmp, TARGET_PAGE_SIZE, false, TARGET_PAGE_SIZE); } - g_free(ts->pages); - ts->pages = NULL; + g_free(ts->t->pages); } - ts->pages = pages; + yagl_transport_set_buffer(ts->t, pages); } -void yagl_thread_call(struct yagl_thread_state *ts, uint32_t offset) +void yagl_thread_call(struct yagl_thread_state *ts, bool sync) { - int i; - uint32_t num_calls = 0; - struct yagl_transport *t = ts->ps->ss->t; - - YAGL_LOG_FUNC_SET(yagl_thread_call); - assert(current_cpu); yagl_cpu_synchronize_state(ts->ps); - YAGL_LOG_TRACE("batch started"); - - cur_ts = ts; - - for (i = 0; i < YAGL_NUM_APIS; ++i) { - if (ts->ps->api_states[i]) { - ts->ps->api_states[i]->batch_start(ts->ps->api_states[i]); - } - } - - yagl_transport_begin(t, ts->pages, offset); - - while (true) { - yagl_api_id api_id; - yagl_func_id func_id; - struct yagl_api_ps *api_ps; - yagl_api_func func; - - yagl_transport_begin_call(t, &api_id, &func_id); - - if (api_id == 0) { - /* - * Batch ended. - */ - break; - } - - if ((api_id <= 0) || (api_id > YAGL_NUM_APIS)) { - YAGL_LOG_CRITICAL("target-host protocol error, bad api_id - %u", api_id); - break; + if (sync) { + if (ts->num_in_progress > 0) { + work_queue_wait(ts->ps->ss->render_queue); } - api_ps = ts->ps->api_states[api_id - 1]; - - if (!api_ps) { - YAGL_LOG_CRITICAL("uninitialized api - %u. host logic error", api_id); - break; - } + yagl_transport_end(ts->t); + } else { + struct yagl_thread_work_item *item; + uint32_t batch_size; + uint32_t out_arrays_size; + uint32_t fence_seq; - func = api_ps->get_func(api_ps, func_id); + item = (struct yagl_thread_work_item*)yagl_transport_begin(ts->t, + sizeof(*item), &batch_size, &out_arrays_size, &fence_seq); - if (func) { - if (func(t)) { - yagl_transport_end_call(t); - } else { - /* - * Retry is requested. - */ - break; - } - } else { - YAGL_LOG_CRITICAL("bad function call (api = %u, func = %u)", - api_id, - func_id); - break; + if (!item) { + return; } - ++num_calls; - } + work_queue_item_init(&item->base, &yagl_thread_work); - YAGL_LOG_TRACE("batch ended: %u calls", num_calls); + item->ts = ts; + item->fence_seq = fence_seq; + item->batch_size = batch_size; + item->out_arrays_size = out_arrays_size; - yagl_stats_batch(num_calls, yagl_transport_bytes_processed(t)); + ++ts->num_in_progress; - for (i = 0; i < YAGL_NUM_APIS; ++i) { - if (ts->ps->api_states[i]) { - ts->ps->api_states[i]->batch_end(ts->ps->api_states[i]); - } + work_queue_add_item(ts->ps->ss->render_queue, &item->base); } } diff --git a/hw/yagl/yagl_thread.h b/hw/yagl/yagl_thread.h index 0533067..21cfc0c 100644 --- a/hw/yagl/yagl_thread.h +++ b/hw/yagl/yagl_thread.h @@ -33,10 +33,12 @@ #include "yagl_types.h" #include "yagl_event.h" #include "yagl_tls.h" +#include "work_queue.h" #include "qemu/queue.h" #include "qemu/thread.h" struct yagl_process_state; +struct yagl_transport; struct yagl_thread_state { @@ -46,7 +48,9 @@ struct yagl_thread_state yagl_tid id; - uint8_t **pages; + struct yagl_transport *t; + + uint32_t num_in_progress; /* * Fake TLS. @@ -73,6 +77,6 @@ void yagl_thread_state_destroy(struct yagl_thread_state *ts, void yagl_thread_set_buffer(struct yagl_thread_state *ts, uint8_t **pages); -void yagl_thread_call(struct yagl_thread_state *ts, uint32_t offset); +void yagl_thread_call(struct yagl_thread_state *ts, bool sync); #endif diff --git a/hw/yagl/yagl_transport.c b/hw/yagl/yagl_transport.c index 6287d84..a922377 100644 --- a/hw/yagl/yagl_transport.c +++ b/hw/yagl/yagl_transport.c @@ -28,6 +28,7 @@ */ #include "yagl_transport.h" +#include "yagl_compiled_transfer.h" #include "yagl_mem.h" typedef enum @@ -36,29 +37,60 @@ typedef enum yagl_call_result_retry = 0xB, /* Page fault on host, retry is required. */ } yagl_call_result; +#define YAGL_TRANSPORT_BATCH_HEADER_SIZE (4 * 8) + +static __inline uint32_t yagl_transport_uint32_t_at(struct yagl_transport *t, + uint32_t offset) +{ + return *(uint32_t*)(t->pages[offset / TARGET_PAGE_SIZE] + + (offset & ~TARGET_PAGE_MASK)); +} + +static __inline target_ulong yagl_transport_va_at(struct yagl_transport *t, + uint32_t offset) +{ + return *(target_ulong*)(t->pages[offset / TARGET_PAGE_SIZE] + + (offset & ~TARGET_PAGE_MASK)); +} + +static __inline void yagl_transport_uint32_t_to(struct yagl_transport *t, + uint32_t offset, + uint32_t value) +{ + *(uint32_t*)(t->pages[offset / TARGET_PAGE_SIZE] + + (offset & ~TARGET_PAGE_MASK)) = value; +} + static void yagl_transport_copy_from(struct yagl_transport *t, + uint32_t offset, uint8_t *data, uint32_t size) { + uint32_t page_index = offset / TARGET_PAGE_SIZE; + uint8_t *ptr = t->pages[page_index] + (offset & ~TARGET_PAGE_MASK); + while (size > 0) { - uint32_t rem = t->next_page - t->ptr; + uint32_t rem = t->pages[page_index] + TARGET_PAGE_SIZE - ptr; rem = MIN(rem, size); - memcpy(data, t->ptr, rem); + memcpy(data, ptr, rem); size -= rem; data += rem; - yagl_transport_advance(t, rem); + ++page_index; + ptr = t->pages[page_index]; } } static void yagl_transport_copy_to(struct yagl_transport *t, - uint32_t page_index, - uint8_t *ptr, - uint8_t *data, + uint32_t offset, + const uint8_t *data, uint32_t size) { + uint32_t page_index = offset / TARGET_PAGE_SIZE; + uint8_t *ptr = t->pages[page_index] + (offset & ~TARGET_PAGE_MASK); + while (size > 0) { uint32_t rem = t->pages[page_index] + TARGET_PAGE_SIZE - ptr; rem = MIN(rem, size); @@ -80,15 +112,12 @@ struct yagl_transport *yagl_transport_create(void) t = g_malloc0(sizeof(*t)); - for (i = 0; i < YAGL_TRANSPORT_MAX_OUT; ++i) { - yagl_vector_init(&t->out_arrays[i], 1, 0); - } - for (i = 0; i < YAGL_TRANSPORT_MAX_IN; ++i) { yagl_vector_init(&t->in_arrays[i].v, 1, 0); - t->in_arrays[i].mt = yagl_mem_transfer_create(); } + QLIST_INIT(&t->compiled_transfers); + return t; } @@ -96,139 +125,169 @@ void yagl_transport_destroy(struct yagl_transport *t) { uint32_t i; - for (i = 0; i < YAGL_TRANSPORT_MAX_OUT; ++i) { - yagl_vector_cleanup(&t->out_arrays[i]); - } - for (i = 0; i < YAGL_TRANSPORT_MAX_IN; ++i) { yagl_vector_cleanup(&t->in_arrays[i].v); - yagl_mem_transfer_destroy(t->in_arrays[i].mt); } g_free(t); } -void yagl_transport_begin(struct yagl_transport *t, - uint8_t **pages, - uint32_t offset) +void yagl_transport_set_buffer(struct yagl_transport *t, uint8_t **pages) { t->pages = pages; - t->offset = offset; - t->page_index = offset / TARGET_PAGE_SIZE; - t->ptr = t->pages[t->page_index] + (offset & ~TARGET_PAGE_MASK); - t->next_page = t->pages[t->page_index] + TARGET_PAGE_SIZE; } -void yagl_transport_begin_call(struct yagl_transport *t, - yagl_api_id *api_id, - yagl_func_id *func_id) +uint8_t *yagl_transport_begin(struct yagl_transport *t, + uint32_t header_size, + uint32_t *batch_size, + uint32_t *out_arrays_size, + uint32_t *fence_seq) { - *api_id = yagl_transport_get_out_uint32_t(t); + uint32_t num_out_da, i; + uint8_t *batch_data, *tmp; - if (!*api_id) { - return; + *fence_seq = yagl_transport_uint32_t_at(t, 1 * 8); + *batch_size = yagl_transport_uint32_t_at(t, 2 * 8); + num_out_da = yagl_transport_uint32_t_at(t, 3 * 8); + + *out_arrays_size = 0; + + for (i = 0; i < num_out_da; ++i) { + *out_arrays_size += yagl_transport_uint32_t_at(t, + YAGL_TRANSPORT_BATCH_HEADER_SIZE + *batch_size + ((2 * i + 1) * 8)); } - *func_id = yagl_transport_get_out_uint32_t(t); + batch_data = tmp = g_malloc( + header_size + YAGL_TRANSPORT_BATCH_HEADER_SIZE + + *batch_size + *out_arrays_size); - t->res = (uint32_t*)t->ptr; - t->direct = yagl_transport_get_out_uint32_t(t); - t->num_out_arrays = t->num_in_arrays = 0; + tmp += header_size + YAGL_TRANSPORT_BATCH_HEADER_SIZE + *batch_size; + + for (i = 0; i < num_out_da; ++i) { + target_ulong va = yagl_transport_va_at(t, + YAGL_TRANSPORT_BATCH_HEADER_SIZE + *batch_size + ((2 * i + 0) * 8)); + uint32_t size = yagl_transport_uint32_t_at(t, + YAGL_TRANSPORT_BATCH_HEADER_SIZE + *batch_size + ((2 * i + 1) * 8)); + + if (!yagl_mem_get(va, size, tmp)) { + yagl_transport_uint32_t_to(t, 0, yagl_call_result_retry); + g_free(batch_data); + return NULL; + } + + tmp += size; + } + + yagl_transport_copy_from(t, + 0, + batch_data + header_size, + YAGL_TRANSPORT_BATCH_HEADER_SIZE + *batch_size); + + yagl_transport_uint32_t_to(t, 0, yagl_call_result_ok); + + return batch_data; } -void yagl_transport_end_call(struct yagl_transport *t) +void yagl_transport_end(struct yagl_transport *t) { uint32_t i; + struct yagl_compiled_transfer *ct, *tmp; for (i = 0; i < t->num_in_arrays; ++i) { struct yagl_transport_in_array *in_array = &t->in_arrays[i]; - if (*in_array->count > 0) { - if (t->direct) { - yagl_mem_put(in_array->mt, - yagl_vector_data(&in_array->v), - *in_array->count * in_array->el_size); - } else { - yagl_transport_copy_to(t, - in_array->page_index, - in_array->ptr, - yagl_vector_data(&in_array->v), - *in_array->count * in_array->el_size); + if ((*in_array->count > 0) && t->direct) { + if (!yagl_mem_put(in_array->va, + yagl_vector_data(&in_array->v), + *in_array->count * in_array->el_size)) { + yagl_transport_uint32_t_to(t, 0, yagl_call_result_retry); + return; } } } - *t->res = yagl_call_result_ok; + QLIST_FOREACH_SAFE(ct, &t->compiled_transfers, entry, tmp) { + yagl_compiled_transfer_prepare(ct); + } + + t->direct = false; + t->num_in_arrays = 0; + + yagl_transport_uint32_t_to(t, 0, yagl_call_result_ok); } -uint32_t yagl_transport_bytes_processed(struct yagl_transport *t) +void yagl_transport_reset(struct yagl_transport *t, + uint8_t *batch_data, + uint32_t batch_size, + uint32_t out_arrays_size) { - uint32_t start_page_index = t->offset / TARGET_PAGE_SIZE; - uint32_t start_page_offset = t->offset & ~TARGET_PAGE_MASK; - uint32_t end_page_offset = t->ptr - t->pages[t->page_index]; + t->batch_data = batch_data; + t->batch_size = batch_size; + t->out_arrays_size = out_arrays_size; + + t->ptr = batch_data + YAGL_TRANSPORT_BATCH_HEADER_SIZE; + t->out_array_ptr = batch_data + YAGL_TRANSPORT_BATCH_HEADER_SIZE + batch_size; +} - return (t->page_index - start_page_index) * TARGET_PAGE_SIZE + - end_page_offset - start_page_offset; +bool yagl_transport_begin_call(struct yagl_transport *t, + yagl_api_id *api_id, + yagl_func_id *func_id) +{ + if (t->ptr >= (t->batch_data + t->batch_size)) { + return false; + } + + *api_id = yagl_transport_get_out_uint32_t(t); + *func_id = yagl_transport_get_out_uint32_t(t); + t->direct = yagl_transport_get_out_uint32_t(t); + t->num_in_arrays = 0; + + return true; } -bool yagl_transport_get_out_array(struct yagl_transport *t, +void yagl_transport_end_call(struct yagl_transport *t) +{ + uint32_t i; + + for (i = 0; i < t->num_in_arrays; ++i) { + struct yagl_transport_in_array *in_array = &t->in_arrays[i]; + + if ((*in_array->count > 0) && !t->direct) { + yagl_transport_copy_to(t, + in_array->offset, + t->batch_data + in_array->offset, + *in_array->count * in_array->el_size); + } + } +} + +void yagl_transport_get_out_array(struct yagl_transport *t, int32_t el_size, const void **data, int32_t *count) { target_ulong va = (target_ulong)yagl_transport_get_out_uint32_t(t); uint32_t size; - struct yagl_vector *v; *count = yagl_transport_get_out_uint32_t(t); if (!va) { *data = NULL; - return true; + return; } size = (*count > 0) ? (*count * el_size) : 0; if (t->direct) { - v = &t->out_arrays[t->num_out_arrays]; - - yagl_vector_resize(v, size); - - if (!yagl_mem_get(va, size, yagl_vector_data(v))) { - *t->res = yagl_call_result_retry; - return false; - } - - ++t->num_out_arrays; - - *data = yagl_vector_data(v); - - return true; - } - - if ((t->ptr + size) <= t->next_page) { + *data = t->out_array_ptr; + t->out_array_ptr += size; + } else { *data = t->ptr; - - yagl_transport_advance(t, (size + 7U) & ~7U); - - return true; + t->ptr += (size + 7U) & ~7U; } - - v = &t->out_arrays[t->num_out_arrays]; - - yagl_vector_resize(v, size); - - yagl_transport_copy_from(t, yagl_vector_data(v), size); - yagl_transport_advance(t, 7U - ((size + 7U) & 7U)); - - ++t->num_out_arrays; - - *data = yagl_vector_data(v); - - return true; } -bool yagl_transport_get_in_array(struct yagl_transport *t, +void yagl_transport_get_in_array(struct yagl_transport *t, int32_t el_size, void **data, int32_t *maxcount, @@ -237,60 +296,42 @@ bool yagl_transport_get_in_array(struct yagl_transport *t, target_ulong va = (target_ulong)yagl_transport_get_out_uint32_t(t); uint32_t size; struct yagl_transport_in_array *in_array; + uint32_t offset; + + offset = t->ptr - t->batch_data; - *count = (int32_t*)t->ptr; + *count = (int32_t*)(t->pages[offset / TARGET_PAGE_SIZE] + + (offset & ~TARGET_PAGE_MASK)); *maxcount = yagl_transport_get_out_uint32_t(t); if (!va) { *data = NULL; - return true; + return; } size = (*maxcount > 0) ? (*maxcount * el_size) : 0; - if (t->direct) { - in_array = &t->in_arrays[t->num_in_arrays]; - - if (!yagl_mem_prepare(in_array->mt, va, size)) { - *t->res = yagl_call_result_retry; - return false; - } + in_array = &t->in_arrays[t->num_in_arrays]; + if (t->direct) { yagl_vector_resize(&in_array->v, size); + in_array->va = va; in_array->el_size = el_size; in_array->count = *count; ++t->num_in_arrays; *data = yagl_vector_data(&in_array->v); + } else { + in_array->offset = t->ptr - t->batch_data; + in_array->el_size = el_size; + in_array->count = *count; - return true; - } + ++t->num_in_arrays; - if ((t->ptr + size) <= t->next_page) { *data = t->ptr; - yagl_transport_advance(t, (size + 7U) & ~7U); - - return true; + t->ptr += (size + 7U) & ~7U; } - - in_array = &t->in_arrays[t->num_in_arrays]; - - in_array->page_index = t->page_index; - in_array->ptr = t->ptr; - - yagl_vector_resize(&in_array->v, size); - - in_array->el_size = el_size; - in_array->count = *count; - - yagl_transport_advance(t, (size + 7U) & ~7U); - - ++t->num_in_arrays; - - *data = yagl_vector_data(&in_array->v); - - return true; } diff --git a/hw/yagl/yagl_transport.h b/hw/yagl/yagl_transport.h index 07cc502..e1dddca 100644 --- a/hw/yagl/yagl_transport.h +++ b/hw/yagl/yagl_transport.h @@ -32,19 +32,21 @@ #include "yagl_types.h" #include "yagl_vector.h" +#include "qemu/queue.h" #define YAGL_TRANSPORT_MAX_IN 8 -#define YAGL_TRANSPORT_MAX_OUT 8 -struct yagl_mem_transfer; +struct yagl_compiled_transfer; struct yagl_transport_in_array { - struct yagl_mem_transfer *mt; struct yagl_vector v; - uint32_t page_index; - uint8_t *ptr; + union + { + target_ulong va; + uint32_t offset; + }; int32_t el_size; int32_t *count; @@ -53,17 +55,27 @@ struct yagl_transport_in_array struct yagl_transport { /* - * per-batch. + * per-transport. * @{ */ uint8_t **pages; - uint32_t offset; - uint32_t page_index; - uint8_t *next_page; + /* + * @} + */ + + /* + * per-batch. + * @{ + */ + + uint8_t *batch_data; + uint32_t batch_size; + uint32_t out_arrays_size; uint8_t *ptr; + uint8_t *out_array_ptr; /* * @} @@ -76,14 +88,12 @@ struct yagl_transport bool direct; - uint32_t *res; - - uint32_t num_out_arrays; uint32_t num_in_arrays; - struct yagl_vector out_arrays[YAGL_TRANSPORT_MAX_OUT]; struct yagl_transport_in_array in_arrays[YAGL_TRANSPORT_MAX_IN]; + QLIST_HEAD(, yagl_compiled_transfer) compiled_transfers; + /* * @} */ @@ -93,61 +103,56 @@ struct yagl_transport *yagl_transport_create(void); void yagl_transport_destroy(struct yagl_transport *t); -void yagl_transport_begin(struct yagl_transport *t, - uint8_t **pages, - uint32_t offset); +void yagl_transport_set_buffer(struct yagl_transport *t, uint8_t **pages); + +uint8_t *yagl_transport_begin(struct yagl_transport *t, + uint32_t header_size, + uint32_t *batch_size, + uint32_t *out_arrays_size, + uint32_t *fence_seq); + +void yagl_transport_end(struct yagl_transport *t); -void yagl_transport_begin_call(struct yagl_transport *t, +void yagl_transport_reset(struct yagl_transport *t, + uint8_t *batch_data, + uint32_t batch_size, + uint32_t out_arrays_size); + +bool yagl_transport_begin_call(struct yagl_transport *t, yagl_api_id *api_id, yagl_func_id *func_id); void yagl_transport_end_call(struct yagl_transport *t); -uint32_t yagl_transport_bytes_processed(struct yagl_transport *t); - -bool yagl_transport_get_out_array(struct yagl_transport *t, +void yagl_transport_get_out_array(struct yagl_transport *t, int32_t el_size, const void **data, int32_t *count); -bool yagl_transport_get_in_array(struct yagl_transport *t, +void yagl_transport_get_in_array(struct yagl_transport *t, int32_t el_size, void **data, int32_t *maxcount, int32_t **count); -static __inline void yagl_transport_advance(struct yagl_transport *t, - uint32_t size) -{ - t->ptr += size; - - if (t->ptr >= t->next_page) { - uint32_t offset = t->ptr - t->next_page; - - t->page_index += 1 + (offset / TARGET_PAGE_SIZE); - t->ptr = t->pages[t->page_index] + (offset & ~TARGET_PAGE_MASK); - t->next_page = t->pages[t->page_index] + TARGET_PAGE_SIZE; - } -} - static __inline uint8_t yagl_transport_get_out_uint8_t(struct yagl_transport *t) { uint8_t tmp = *t->ptr; - yagl_transport_advance(t, 8); + t->ptr += 8; return tmp; } static __inline uint32_t yagl_transport_get_out_uint32_t(struct yagl_transport *t) { uint32_t tmp = *(uint32_t*)t->ptr; - yagl_transport_advance(t, 8); + t->ptr += 8; return tmp; } static __inline float yagl_transport_get_out_float(struct yagl_transport *t) { float tmp = *(float*)t->ptr; - yagl_transport_advance(t, 8); + t->ptr += 8; return tmp; } @@ -157,8 +162,10 @@ static __inline void yagl_transport_get_in_arg(struct yagl_transport *t, target_ulong va = (target_ulong)yagl_transport_get_out_uint32_t(t); if (va) { - *value = t->ptr; - yagl_transport_advance(t, 8); + uint32_t offset = t->ptr - t->batch_data; + *value = t->pages[offset / TARGET_PAGE_SIZE] + + (offset & ~TARGET_PAGE_MASK); + t->ptr += 8; } else { *value = NULL; } diff --git a/hw/yagl/yagl_types.h b/hw/yagl/yagl_types.h index e5d0109..529322c 100644 --- a/hw/yagl/yagl_types.h +++ b/hw/yagl/yagl_types.h @@ -74,6 +74,6 @@ typedef enum #define YAGL_NUM_CLIENT_APIS 4 -typedef bool (*yagl_api_func)(struct yagl_transport */*t*/); +typedef void (*yagl_api_func)(struct yagl_transport */*t*/); #endif diff --git a/hw/yagl/yagl_version.h b/hw/yagl/yagl_version.h index 638149e..1bed5d8 100644 --- a/hw/yagl/yagl_version.h +++ b/hw/yagl/yagl_version.h @@ -35,6 +35,6 @@ /* * Whenever protocol changes be sure to bump this. */ -#define YAGL_VERSION 21 +#define YAGL_VERSION 22 #endif diff --git a/tizen/src/hw/maru_board.c b/tizen/src/hw/maru_board.c index d0f8518..069f70a 100644 --- a/tizen/src/hw/maru_board.c +++ b/tizen/src/hw/maru_board.c @@ -75,6 +75,7 @@ #include #endif #include "vigs/vigs_device.h" +#include "work_queue.h" extern int enable_yagl; extern const char *yagl_backend; extern int enable_vigs; @@ -113,15 +114,21 @@ static void maru_device_init(void) #else void *display = NULL; #endif + struct work_queue *render_queue = NULL; struct winsys_interface *vigs_wsi = NULL; pci_maru_overlay_init(pci_bus); pci_maru_brightness_init(pci_bus); maru_brill_codec_pci_device_init(pci_bus); + if (enable_vigs || enable_yagl) { + render_queue = work_queue_create(); + } + if (enable_vigs) { PCIDevice *pci_dev = pci_create(pci_bus, -1, "vigs"); qdev_prop_set_ptr(&pci_dev->qdev, "display", display); + qdev_prop_set_ptr(&pci_dev->qdev, "render_queue", render_queue); qdev_init_nofail(&pci_dev->qdev); vigs_wsi = DO_UPCAST(VIGSDevice, pci_dev, pci_dev)->wsi; } @@ -129,6 +136,7 @@ static void maru_device_init(void) if (enable_yagl) { PCIDevice *pci_dev = pci_create(pci_bus, -1, "yagl"); qdev_prop_set_ptr(&pci_dev->qdev, "display", display); + qdev_prop_set_ptr(&pci_dev->qdev, "render_queue", render_queue); if (vigs_wsi && (strcmp(yagl_backend, "vigs") == 0) && (strcmp(vigs_backend, "gl") == 0)) { -- 2.7.4