ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
Loading...
Searching...
No Matches
cm_tiled_check.h File Reference

Boot-time self-check that opens an oversized comic page via the JOF tile path and reports a deterministic digest (#344). More...

#include <stdint.h>
Include dependency graph for cm_tiled_check.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  cm_tiled_result_t
 Outcome of the oversized-page tile self-check. More...

Functions

cm_tiled_result_t cm_comic_tiled_selfcheck (void)
 Open the baked oversized page through the tile path and digest it.

Detailed Description

Boot-time self-check that opens an oversized comic page via the JOF tile path and reports a deterministic digest (#344).

Tag
[Ring 7 / App] {World: NS}

The viewable reader in main.c pages small baked CBZ pages with the whole-decode pipeline (ra8_img_decode_blit). A page whose decoded size exceeds the decode arena cannot be opened that way – the #344 cap. This self-check proves the fix on device: it opens a baked oversized single-page CBZ (k_comic_large_cbz), routes the page through ::comic_tiles (import-time JOF transcode + ra8_tile_cache paging), decodes every tile in bounded RAM, and FNV-hashes the concatenated tile payloads. The integer tile pipeline makes the digest identical on host, ra8_emulator, and silicon, so the boot banner can pin it.

Since
0.1.0

Definition in file cm_tiled_check.h.

Function Documentation

◆ cm_comic_tiled_selfcheck()

cm_tiled_result_t cm_comic_tiled_selfcheck ( void )

Open the baked oversized page through the tile path and digest it.

Opens k_comic_large_cbz with comic, confirms page 0's decoded footprint exceeds the whole-decode budget, transcodes it to a JOF atlas via comic_tiles_import, and decodes every tile through the owned tile cache, FNV-hashing the decoded pixels. All storage is file-static SDRAM (no heap); the panel framebuffer is never touched, so the reader's page-1 render is undisturbed.

Returns
cm_tiled_result_t The page geometry, tile count, digest, and status.
Return values
{.ok=true,...}The oversized page opened + tiled + decoded cleanly.
{.ok=false,...}The archive, footprint, import, or a tile decode failed.
Precondition
ra8_cgc_init / SDRAM bring-up have run (the SDRAM arenas are usable).
The baked k_comic_large_cbz fixture is linked in.
Postcondition
No panel framebuffer or ra8_gfx binding is modified.
On success ok is true and the digest is deterministic.
Note
Not thread-safe; single-threaded boot context.
Since
0.1.0

Definition at line 213 of file cm_tiled_check.c.

References cm_ct_cache_cfg(), cm_ct_hash_tiles(), cm_ct_open(), comic_close(), comic_tiles_footprint(), comic_tiles_import(), comic_tiles_info(), comic_tiles_init(), comic_tiles_over_budget(), cm_tiled_result_t::crc, cm_tiled_result_t::h, jof_info_t::height, k_comic_large_h, k_comic_large_w, k_ct_budget, k_ct_scratch, k_ct_tile, k_jof_codec_deflate, k_ra8_ok, cm_tiled_result_t::ok, s_ct_atlas, s_ct_comic, s_ct_pagebuf, s_ct_reader, s_ct_scratch, s_ct_work, jof_info_t::tile_count, cm_tiled_result_t::tiles, cm_tiled_result_t::w, and jof_info_t::width.

Referenced by main().