|
ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
|
Bounded raw-descriptor presentation surface and scratch workspace. More...
Go to the source code of this file.
Data Structures | |
| struct | emu_presentation_spec_t |
| Inputs controlling exact presentation requirements. More... | |
| struct | emu_presentation_result_t |
| Exact result of a requirements or workspace operation. More... | |
| struct | emu_presentation_workspace_t |
| One independent owned surface plus non-owning bounded scratch. More... | |
Enumerations | |
| enum | emu_presentation_limit_t : size_t { k_emu_presentation_max_panel_px = 4096U , k_emu_presentation_tile_px = 64U , k_emu_presentation_max_scratch_bytes } |
| Geometry and bounded tile limits for streamed presentation. More... | |
| enum | emu_presentation_status_t : uint8_t { k_emu_presentation_ok = 0U , k_emu_presentation_invalid , k_emu_presentation_overflow , k_emu_presentation_capacity , k_emu_presentation_io } |
| Presentation planning, creation, and transfer status. More... | |
Functions | |
| emu_presentation_result_t | emu_presentation_requirements (const emu_presentation_spec_t *spec) |
| Compute exact raw-fd and scratch requirements without mutation. | |
| emu_presentation_result_t | emu_presentation_open (const emu_presentation_spec_t *spec, void *scratch, size_t supplied_scratch_bytes, emu_presentation_workspace_t *workspace) |
| Create and bind one unlinked raw-fd presentation workspace. | |
| bool | emu_presentation_close (emu_presentation_workspace_t *workspace) |
| Close one owned presentation descriptor and invalidate the workspace. | |
| bool | emu_presentation_fill (void *context, uint16_t x, uint16_t y, uint16_t width, uint16_t height, uint16_t color) |
| Fill a checked RGB565 rectangle in a raw-fd surface. | |
| bool | emu_presentation_read (const emu_presentation_workspace_t *workspace, size_t offset, void *bytes, size_t count) |
| Read exact RGB565 bytes at a checked surface offset. | |
| bool | emu_presentation_write (emu_presentation_workspace_t *workspace, size_t offset, const void *bytes, size_t count) |
| Write exact RGB565 bytes at a checked surface offset. | |
| bool | emu_presentation_snapshot (emu_presentation_workspace_t *workspace, int *snapshot_fd) |
| Create an immutable unlinked descriptor snapshot of one surface. | |
Bounded raw-descriptor presentation surface and scratch workspace.
Plans exact disk and caller-scratch requirements, creates one unlinked raw backing descriptor, and exposes checked rectangle/read access.
Definition in file emu_presentation.h.
| enum emu_presentation_limit_t : size_t |
Geometry and bounded tile limits for streamed presentation.
Definition at line 25 of file emu_presentation.h.
| enum emu_presentation_status_t : uint8_t |
Presentation planning, creation, and transfer status.
Definition at line 34 of file emu_presentation.h.
| bool emu_presentation_close | ( | emu_presentation_workspace_t * | workspace | ) |
Close one owned presentation descriptor and invalidate the workspace.
| [in,out] | workspace | Workspace returned by emu_presentation_open. |
workspace is reset with fd -1 even when close reports failure. Close one owned presentation descriptor and invalidate the workspace; this step is contained within the emu presentation model and uses bounded caller or module-owned storage.
| true | The emu presentation close condition holds or completed successfully; false otherwise. |
Definition at line 303 of file emu_presentation.c.
References emu_presentation_workspace_t::fd.
Referenced by internal_main_load_images(), main(), and priv_run_cleanup().
| bool emu_presentation_fill | ( | void * | context, |
| uint16_t | x, | ||
| uint16_t | y, | ||
| uint16_t | width, | ||
| uint16_t | height, | ||
| uint16_t | color ) |
Fill a checked RGB565 rectangle in a raw-fd surface.
Matches board_overlay_fill_fn and uses only bound row scratch.
| [in,out] | context | An emu_presentation_workspace_t. |
| [in] | x | Rectangle column. |
| [in] | y | Rectangle row. |
| [in] | width | Rectangle width. |
| [in] | height | Rectangle height. |
| [in] | color | RGB565 fill color. |
| true | The emu presentation fill condition holds or completed successfully; false otherwise. |
Definition at line 339 of file emu_presentation.c.
References emu_presentation_workspace_t::composite_height, emu_presentation_workspace_t::composite_width, emu_presentation_write(), emu_presentation_workspace_t::scratch, and emu_presentation_workspace_t::scratch_bytes.
Referenced by priv_emu_view_surface_build().
|
nodiscard |
Create and bind one unlinked raw-fd presentation workspace.
Validates exact capacity before creating an anonymous temporary; failure preserves workspace and every scratch byte.
| [in] | spec | Presentation geometry and mode. |
| [in,out] | scratch | Caller-owned bounded scratch, or nullptr if inactive. |
| [in] | supplied_scratch_bytes | Writable scratch capacity. |
| [out] | workspace | Receives one independent owned descriptor on success. |
spec and workspace are non-null. scratch spans supplied_scratch_bytes writable bytes. scratch is aligned to alignof(uint16_t). workspace and scratch unchanged with no descriptor leak. Definition at line 246 of file emu_presentation.c.
References emu_presentation_plan_t::composite_height, emu_presentation_plan_t::composite_width, emu_presentation_plan_t::display_height, emu_presentation_plan_t::display_width, internal_anonymous_fd(), internal_plan(), internal_result(), k_emu_presentation_capacity, k_emu_presentation_invalid, k_emu_presentation_io, k_emu_presentation_ok, emu_presentation_plan_t::panel_height, emu_presentation_plan_t::panel_width, emu_presentation_spec_t::rotate_deg, emu_presentation_plan_t::scratch_bytes, and emu_presentation_plan_t::surface_bytes.
Referenced by internal_main_open_presentation().
| bool emu_presentation_read | ( | const emu_presentation_workspace_t * | workspace, |
| size_t | offset, | ||
| void * | bytes, | ||
| size_t | count ) |
Read exact RGB565 bytes at a checked surface offset.
Read exact rgb565 bytes at a checked surface offset; this step is contained within the emu presentation model and uses bounded caller or module-owned storage.
| [in] | workspace | Caller-owned workspace used by the operation. |
| [in] | offset | Byte or register offset at which processing begins. |
| [in,out] | bytes | Byte storage transferred by the operation. |
| [in] | count | Number of elements or bytes to process. |
| true | The emu presentation read condition holds or completed successfully; false otherwise. |
Definition at line 313 of file emu_presentation.c.
References emu_presentation_workspace_t::fd, k_emu_io_ok, priv_emu_io_pread_exact(), emu_io_result_t::status, and emu_presentation_workspace_t::surface_bytes.
Referenced by emu_presentation_snapshot(), and internal_write_ppm_pixels().
|
nodiscard |
Compute exact raw-fd and scratch requirements without mutation.
| [in] | spec | Presentation geometry and mode. |
spec is non-null. Definition at line 235 of file emu_presentation.c.
References internal_plan(), internal_result(), k_emu_presentation_ok, emu_presentation_plan_t::scratch_bytes, and emu_presentation_plan_t::surface_bytes.
| bool emu_presentation_snapshot | ( | emu_presentation_workspace_t * | workspace, |
| int * | snapshot_fd ) |
Create an immutable unlinked descriptor snapshot of one surface.
| [in,out] | workspace | Complete surface and bounded transfer scratch. |
| [out] | snapshot_fd | Receives an owned descriptor positioned arbitrarily. |
snapshot_fd to the caller. snapshot_fd and leaks no descriptor or path. Create an immutable unlinked descriptor snapshot of one surface; this step is contained within the emu presentation model and uses bounded caller or module-owned storage.
| true | The emu presentation snapshot condition holds or completed successfully; false otherwise. |
Definition at line 377 of file emu_presentation.c.
References emu_presentation_read(), emu_presentation_workspace_t::fd, internal_anonymous_fd(), k_emu_io_ok, priv_emu_io_pwrite_exact(), emu_presentation_workspace_t::scratch, emu_presentation_workspace_t::scratch_bytes, emu_io_result_t::status, and emu_presentation_workspace_t::surface_bytes.
| bool emu_presentation_write | ( | emu_presentation_workspace_t * | workspace, |
| size_t | offset, | ||
| const void * | bytes, | ||
| size_t | count ) |
Write exact RGB565 bytes at a checked surface offset.
Write exact rgb565 bytes at a checked surface offset; this step is contained within the emu presentation model and uses bounded caller or module-owned storage.
| [in,out] | workspace | Caller-owned workspace used by the operation. |
| [in] | offset | Byte or register offset at which processing begins. |
| [in] | bytes | Byte storage transferred by the operation. |
| [in] | count | Number of elements or bytes to process. |
| true | The emu presentation write condition holds or completed successfully; false otherwise. |
Definition at line 326 of file emu_presentation.c.
References emu_presentation_workspace_t::fd, k_emu_io_ok, priv_emu_io_pwrite_exact(), emu_io_result_t::status, and emu_presentation_workspace_t::surface_bytes.
Referenced by emu_presentation_fill(), and internal_write_rows().