ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
Loading...
Searching...
No Matches
ra8_drw_draw.c
Go to the documentation of this file.
1
24
25#include <stdint.h>
26
27#include "ra8_attributes.h"
28#include "ra8_check.h"
29#include "ra8_drw.h"
30#include "ra8_drw_dlist.h"
31#include "ra8_drw_internal.h"
32#include "ra8_drw_regs.h"
33#include "ra8_err.h"
34
35/* =============================================================================
36 * Driver-private state
37 * =============================================================================
38 */
39
52static const char* s_tag = "DRW";
53
54/* =============================================================================
55 * Drawing primitives
56 * =============================================================================
57 */
58
59[[nodiscard]] ra8_err_t ra8_drw_fill_rect(const ra8_drw_rect_t* rect)
60{
61 RA8_CHECK_NULL_PTR(rect, s_tag, "rect must not be nullptr");
62 if ((uint16_t)rect->width_px < k_ra8_drw_min_dim_px ||
63 (uint16_t)rect->height_px < k_ra8_drw_min_dim_px) {
65 }
66 if ((uint16_t)rect->width_px > k_ra8_drw_max_width_px ||
67 (uint16_t)rect->height_px > k_ra8_drw_max_height_px) {
69 }
72 }
73
74 /* COLOR1 goes through the shadowed writer (write-only register). */
76
78
79 /* HUM Ch 62.2.1 "CONTROL: Geometry Control Register", p 3689 */
80 /* No spatial limiter: the bounding box scan (HUM Ch 62.6.2 p 3716) already
81 * covers exactly the rectangle, so every enable bit stays clear. Driving
82 * the quad-box limiters here is what produced the half-sized rect on
83 * silicon -- the limiters were fed absolute pixel coordinates while the
84 * hardware wants the decision value at the bounding box's top-left corner,
85 * and their coverage output then landed as alpha 0x01 rather than 0xFF. */
87
88 /* HUM Ch 62.2.31 "ORIGIN: Framebuffer Base Address Register", p 3705 */
89 /* ORIGIN both POSITIONS the bounding box and TRIGGERS the render, so it is
90 * written last and points at the rectangle's own top-left pixel rather
91 * than the framebuffer base. Without the trigger the engine never
92 * rasterizes (silicon-verified: the demo framebuffer stayed zero-filled). */
94
95 return k_ra8_ok;
96}
97
99{
100 RA8_CHECK_NULL_PTR(rect, s_tag, "rect must not be nullptr");
102 (uint16_t)rect->width_px,
103 (uint16_t)rect->height_px)) {
105 }
107 (uint16_t)k_ra8_drw_max_height_px,
108 (uint16_t)rect->width_px,
109 (uint16_t)rect->height_px)) {
111 }
114 }
115
117
118 /* HUM Ch 62.2.18 "LUSTART: U Limiter Start Value Register" p 3701 */
120 /* HUM Ch 62.2.18 "LUSTART: U Limiter Start Value Register" p 3701 */
122 /* HUM Ch 62.2.18 "LUSTART: U Limiter Start Value Register" p 3701 */
124
125 /* HUM Ch 62.2.20 "LVSTARTI: V Limiter Start Integer Part", p 3702 */
127 /* HUM Ch 62.2.21 "LVSTARTF: V Limiter Start Fractional Part", p 3702 */
129 /* HUM Ch 62.2.22 "LVXADDI: V Limiter X-Axis Increment Integer", p 3702 */
131 /* HUM Ch 62.2.23 "LVYADDI: V Limiter Y-Axis Increment Integer", p 3702 */
133 /* HUM Ch 62.2.24 "LVYXADDF: V Limiter Increment Fractional", p 3703 */
135
136 /* HUM Ch 62.2.4 "CACHECTL: Cache Control Register", p 3694 */
137 /* Pulse the texture cache flush so this blit cannot consume texels a
138 * previous primitive left cached. The framebuffer cache is left exactly as
139 * ::ra8_drw_init configured it -- a primitive must not silently switch on a
140 * cache the caller asked to keep off, because the rendered pixels then sit
141 * in the DRW cache instead of memory until something flushes them. */
143
144 /* HUM Ch 62.2.1 "CONTROL: Geometry Control Register", p 3689 */
145 /* No spatial limiter -- the bounding box scan is the rectangle. */
147
148 /* HUM Ch 62.2.31 "ORIGIN: Framebuffer Base Address Register", p 3705 */
149 /* ORIGIN positions the bounding box AND triggers the render. */
151 return k_ra8_ok;
152}
153
175{
176 const int32_t dx = line->x1 - line->x0;
177 const int32_t dy = line->y1 - line->y0;
178 const int32_t adx = internal_iabs(dx);
179 const int32_t ady = internal_iabs(dy);
180
181 /* HUM Ch 62.2.10 "LnSTART: Limiter n Start Value Register", p 3698 */
186
187 /* HUM Ch 62.2.11 "LnXADD: Limiter n X-Axis Increment Register", p 3698 */
192
193 /* HUM Ch 62.2.12 "LnYADD: Limiter n Y-Axis Increment Register", p 3699 */
198
199 /* HUM Ch 62.2.13 "L1BAND/L2BAND: Limiter Band Width Register", p 3699.
200 * Band width = stroke width in sub-pixels for L1 and L2. */
201 const uint32_t band = (uint32_t)line->width_px * (uint32_t)k_ra8_drw_subpixel_unit;
204}
205
207{
208 RA8_CHECK_NULL_PTR(line, s_tag, "line must not be nullptr");
209 if (line->width_px == 0U || (uint16_t)line->width_px > k_ra8_drw_max_width_px) {
211 }
212
213 /* COLOR1 goes through the shadowed writer (write-only register). */
215
216 /* Compute the bounding box of the stroke for SIZE: a simple
217 * over-estimate using axis-aligned span + width. The DRW only uses
218 * SIZE as an enumeration upper bound, not for clipping the stroke
219 * itself. HUM Ch 62.2.29 p 3704. */
220 const int32_t min_x = (line->x0 < line->x1) ? line->x0 : line->x1;
221 const int32_t max_x = (line->x0 > line->x1) ? line->x0 : line->x1;
222 const int32_t min_y = (line->y0 < line->y1) ? line->y0 : line->y1;
223 const int32_t max_y = (line->y0 > line->y1) ? line->y0 : line->y1;
224 const uint32_t span_x = (uint32_t)(max_x - min_x) + (uint32_t)line->width_px;
225 const uint32_t span_y = (uint32_t)(max_y - min_y) + (uint32_t)line->width_px;
226
227 /* HUM Ch 62.2.29 "SIZE: Bounding Box Dimension Register", p 3704 */
229
231
232 /* HUM Ch 62.2.4 "CACHECTL: Cache Control Register", p 3694 */
235
236 /* HUM Ch 62.2.1 "CONTROL: Geometry Control Register", p 3689 */
238
239 /* HUM Ch 62.2.31 "ORIGIN: Framebuffer Base Address Register", p 3705 */
240 /* ORIGIN write = render trigger (see ra8_drw_fill_rect). */
242 return k_ra8_ok;
243}
244
246{
247 RA8_CHECK_NULL_PTR(tri, s_tag, "tri must not be nullptr");
248
249 /* COLOR1 goes through the shadowed writer (write-only register). */
251
252 /* Bounding box for SIZE -- HUM Ch 62.2.29 p 3704. */
253 int32_t min_x = (tri->x0 < tri->x1) ? tri->x0 : tri->x1;
254 if (tri->x2 < (int16_t)min_x) {
255 min_x = tri->x2;
256 }
257 int32_t max_x = (tri->x0 > tri->x1) ? tri->x0 : tri->x1;
258 if (tri->x2 > (int16_t)max_x) {
259 max_x = tri->x2;
260 }
261 int32_t min_y = (tri->y0 < tri->y1) ? tri->y0 : tri->y1;
262 if (tri->y2 < (int16_t)min_y) {
263 min_y = tri->y2;
264 }
265 int32_t max_y = (tri->y0 > tri->y1) ? tri->y0 : tri->y1;
266 if (tri->y2 > (int16_t)max_y) {
267 max_y = tri->y2;
268 }
269 const uint32_t span_x = (uint32_t)(max_x - min_x);
270 const uint32_t span_y = (uint32_t)(max_y - min_y);
271
273
274 /* HUM Ch 62.4.5 "Triangles" p 3726: three half-plane limiters,
275 * one per edge. The HAL programmes the simplest "axis-aligned
276 * triangle" encoding -- the application can override LnSTART /
277 * LnXADD / LnYADD via display lists for arbitrary geometry. */
278
279 /* HUM Ch 62.2.10 "LnSTART: Limiter n Start Value Register", p 3698 */
283
284 /* HUM Ch 62.2.11 "LnXADD: Limiter n X-Axis Increment", p 3698 */
285 *ra8_drw_reg32(k_ra8_drw_off_l1xadd) = internal_to_subpixel((int32_t)tri->y1 - (int32_t)tri->y0);
286 *ra8_drw_reg32(k_ra8_drw_off_l2xadd) = internal_to_subpixel((int32_t)tri->y2 - (int32_t)tri->y1);
287 *ra8_drw_reg32(k_ra8_drw_off_l3xadd) = internal_to_subpixel((int32_t)tri->y0 - (int32_t)tri->y2);
288
289 /* HUM Ch 62.2.12 "LnYADD: Limiter n Y-Axis Increment", p 3699 */
290 *ra8_drw_reg32(k_ra8_drw_off_l1yadd) = internal_to_subpixel((int32_t)tri->x0 - (int32_t)tri->x1);
291 *ra8_drw_reg32(k_ra8_drw_off_l2yadd) = internal_to_subpixel((int32_t)tri->x1 - (int32_t)tri->x2);
292 *ra8_drw_reg32(k_ra8_drw_off_l3yadd) = internal_to_subpixel((int32_t)tri->x2 - (int32_t)tri->x0);
293
294 /* HUM Ch 62.2.4 "CACHECTL: Cache Control Register", p 3694 */
297
298 /* HUM Ch 62.2.1 "CONTROL: Geometry Control Register", p 3689 */
300
301 /* HUM Ch 62.2.31 "ORIGIN: Framebuffer Base Address Register", p 3705 */
302 /* ORIGIN write = render trigger (see ra8_drw_fill_rect). */
304 return k_ra8_ok;
305}
306
307/* =============================================================================
308 * Display list mode
309 * =============================================================================
310 */
311
312[[nodiscard]] ra8_err_t ra8_drw_run_dlist(const uint32_t* dlist_addr)
313{
314 if (dlist_addr == nullptr) {
316 }
317 if (((uintptr_t)dlist_addr & (uintptr_t)k_ra8_drw_internal_align_mask) != 0U) {
319 }
320
321 /* HUM Ch 62.2.4 "CACHECTL: Cache Control Register", p 3694 */
322 /* Flush both caches so the dlist words written by the CPU are
323 * visible to the DRW bus initiator. */
324 const uint32_t cur_cc = *ra8_drw_reg32(k_ra8_drw_off_cachectl);
326
327 /* HUM Ch 62.2.32 "DLISTSTART: Display List Start Address Register",
328 * p 3705. Writing a new value triggers execution. */
329 *ra8_drw_reg32(k_ra8_drw_off_dliststart) = (uint32_t)(uintptr_t)dlist_addr;
330 return k_ra8_ok;
331}
332
351
375{
376 dl->buf[dl->count] = (uint32_t)k_ra8_drw_dlr_tag_one_index | (uint32_t)idx;
377 dl->buf[dl->count + 1U] = val;
378 dl->count += (uint32_t)k_ra8_drw_dlist_entry_words;
379}
380
400static void internal_dlist_put_special(ra8_drw_dlist_t* dl, uint32_t arg)
401{
402 dl->buf[dl->count] =
403 (uint32_t)k_ra8_drw_dlr_eol_byte | (arg << (uint32_t)k_ra8_drw_dlr_eol_arg_pos);
404 dl->count += (uint32_t)k_ra8_drw_dlist_special_words;
405}
406
407[[nodiscard]] ra8_err_t ra8_drw_dlist_begin(ra8_drw_dlist_t* dl, uint32_t* buf, uint32_t cap_words)
408{
409 RA8_CHECK_NULL_PTR(dl, s_tag, "dl must not be nullptr");
410 RA8_CHECK_NULL_PTR(buf, s_tag, "buf must not be nullptr");
411 if (((uintptr_t)buf & (uintptr_t)k_ra8_drw_internal_align_mask) != 0U) {
413 }
414 if (cap_words == 0U) {
416 }
417 dl->buf = buf;
418 dl->cap_words = cap_words;
419 dl->count = 0U;
420 dl->overflow = false;
421 dl->terminated = false;
422 return k_ra8_ok;
423}
424
426{
427 RA8_CHECK_NULL_PTR(dl, s_tag, "dl must not be nullptr");
428 RA8_CHECK_NULL_PTR(rect, s_tag, "rect must not be nullptr");
430 (uint16_t)rect->width_px,
431 (uint16_t)rect->height_px)) {
433 }
435 (uint16_t)k_ra8_drw_max_height_px,
436 (uint16_t)rect->width_px,
437 (uint16_t)rect->height_px)) {
439 }
442 }
443 /* Reject up front so no partial primitive is left in the buffer. */
444 if ((dl->count + (uint32_t)k_ra8_drw_dlist_fill_words) > dl->cap_words) {
445 dl->overflow = true;
446 return k_ra8_err_no_mem;
447 }
448
449 /* Same geometry as the register-mode ra8_drw_fill_rect: COLOR1 carries the
450 * ARGB, SIZE the bounding box, CONTROL clears the spatial limiters so the
451 * box scan is the rectangle, and ORIGIN (the render trigger) anchors it at
452 * the rectangle's top-left pixel. CONTROL2 / PITCH / cache stay as
453 * ra8_drw_init programmed them. */
457 ((uint32_t)rect->height_px << k_ra8_drw_size_height_pos) |
458 (uint32_t)rect->width_px);
461 /* Wait for the pipeline and framebuffer cache to drain so this primitive
462 * fully lands before the next one (or the CPU read) begins. */
464 return k_ra8_ok;
465}
466
468{
469 RA8_CHECK_NULL_PTR(dl, s_tag, "dl must not be nullptr");
470 if (dl->overflow) {
472 }
473 if ((dl->count + (uint32_t)k_ra8_drw_dlist_special_words) > dl->cap_words) {
474 dl->overflow = true;
475 return k_ra8_err_no_mem;
476 }
478 dl->terminated = true;
479 return k_ra8_ok;
480}
481
483{
484 RA8_CHECK_NULL_PTR(dl, s_tag, "dl must not be nullptr");
485 if (dl->overflow || !dl->terminated || (dl->count == 0U)) {
487 }
488 return ra8_drw_run_dlist(dl->buf);
489}
490
491/* =============================================================================
492 * Performance counters
493 * =============================================================================
494 */
495
497 ra8_drw_perftrigger_t event_ctr2)
498{
499 if ((uint16_t)event_ctr1 > k_ra8_drw_internal_perfev_max ||
500 (uint16_t)event_ctr2 > k_ra8_drw_internal_perfev_max) {
502 }
503
504 /* HUM Ch 62.2.33 "PERFTRIGGER: Performance Counters Control Register",
505 * p 3706. PERFTRIGGER1 in [15:0], PERFTRIGGER2 in [31:16]. */
507 ((uint32_t)event_ctr2 << k_ra8_drw_perftrigger2_pos) | (uint32_t)event_ctr1;
508
509 /* HUM Ch 62.2.34 "PERFCOUNTk: Performance Counter k", p 3706 */
512 return k_ra8_ok;
513}
514
516{
517 RA8_CHECK_NULL_PTR(out, s_tag, "out must not be nullptr");
519 /* HUM Ch 62.2.34 "PERFCOUNTk: Performance Counter k", p 3706 */
520 if (id == k_ra8_drw_perfctr_1) {
522 result = k_ra8_ok;
523 } else if (id == k_ra8_drw_perfctr_2) {
525 result = k_ra8_ok;
526 } else {
527 result = k_ra8_err_invalid_arg;
528 }
529 return result;
530}
531
533{
535 /* HUM Ch 62.2.34 "PERFCOUNTk: Performance Counter k", p 3706 */
536 if (id == k_ra8_drw_perfctr_1) {
538 result = k_ra8_ok;
539 } else if (id == k_ra8_drw_perfctr_2) {
541 result = k_ra8_ok;
542 } else {
543 result = k_ra8_err_invalid_arg;
544 }
545 return result;
546}
static const char * s_tag
Logging / check tag.
Definition ra8_app.c:17
Annotation-attribute framework macros for ra8-firmware.
#define RA8_INTERNAL
Marker that a function is intended to be static (file-local).
Validation and Error-Checking Macros for ra8-firmware.
#define RA8_CHECK_NULL_PTR(ptr, tag, message)
Reject nullptr pointer, returning k_ra8_err_null_ptr.
Definition ra8_check.h:243
bool priv_ra8_drw_internal_rect_off_surface(const ra8_drw_rect_t *rect)
Reject a rectangle that would rasterize outside the framebuffer.
Definition ra8_drw.c:225
bool priv_ra8_drw_internal_rect_above_max(uint16_t max_w, uint16_t max_h, uint16_t width, uint16_t height)
Pure rect-above-max predicate – see header for full contract.
Definition ra8_drw.c:97
uint32_t priv_ra8_drw_internal_origin(void)
Implementation of priv_ra8_drw_internal_origin() – shadow read.
Definition ra8_drw.c:212
void priv_program_rect_bbox(const ra8_drw_rect_t *rect)
Programme the bounding box that describes an axis-aligned rect.
Definition ra8_drw.c:416
uint32_t priv_ra8_drw_internal_rect_origin(const ra8_drw_rect_t *rect)
Framebuffer byte address of a rectangle's top-left pixel.
Definition ra8_drw.c:217
bool priv_ra8_drw_internal_rect_below_min(uint16_t min_dim, uint16_t width, uint16_t height)
Pure rect-below-min predicate – see header for full contract.
Definition ra8_drw.c:75
void priv_ra8_drw_internal_color1_write(uint32_t argb8888)
Implementation of priv_ra8_drw_internal_color1_write() – MMIO + shadow.
Definition ra8_drw.c:238
2D Drawing Engine (DRW / D/AVE 2D) HAL driver – public API
2D Drawing Engine (DRW / D/AVE 2D) display-list builder – public API
ra8_err_t ra8_drw_run_dlist(const uint32_t *dlist_addr)
Trigger execution of a display list.
ra8_err_t ra8_drw_draw_line(const ra8_drw_line_t *line)
Issue an anti-aliased line stroke between two points.
ra8_err_t ra8_drw_fill_rect(const ra8_drw_rect_t *rect)
Issue a solid-fill rectangle blit into the framebuffer.
ra8_err_t ra8_drw_dlist_end(ra8_drw_dlist_t *dl)
Close a display list with its terminator word.
ra8_err_t ra8_drw_perf_read(ra8_drw_perfcounter_id_t id, uint32_t *out)
Read one PERFCOUNTk register.
ra8_err_t ra8_drw_blit_textured_rect(const ra8_drw_rect_t *rect)
Blit a textured rectangle (texture must be programmed first).
ra8_err_t ra8_drw_perf_reset(ra8_drw_perfcounter_id_t id)
Reset one PERFCOUNTk register to zero.
ra8_drw_dlist_span_t
Word spans of the display-list entries the builder emits.
@ k_ra8_drw_dlist_fill_regs
COLOR1, SIZE, CONTROL, ORIGIN.
@ k_ra8_drw_dlist_fill_words
4 * 2 + 1 wait word.
@ k_ra8_drw_dlist_entry_words
1-register entry: tag + value.
@ k_ra8_drw_dlist_special_words
Wait or terminate word.
static void internal_dlist_put_reg(ra8_drw_dlist_t *dl, ra8_drw_dlr_index_t idx, uint32_t val)
Append a single-register display-list entry to the builder buffer.
ra8_err_t ra8_drw_dlist_begin(ra8_drw_dlist_t *dl, uint32_t *buf, uint32_t cap_words)
Bind a display-list builder to a caller-owned word buffer.
ra8_err_t ra8_drw_dlist_add_fill(ra8_drw_dlist_t *dl, const ra8_drw_rect_t *rect)
Append one solid-rectangle fill primitive to a display list.
static void internal_program_line_limiters(const ra8_drw_line_t *line)
Program L1..L4 START/XADD/YADD for a stroked line.
static void internal_dlist_put_special(ra8_drw_dlist_t *dl, uint32_t arg)
Append a display-list special word (wait or terminate).
ra8_err_t ra8_drw_perf_arm(ra8_drw_perftrigger_t event_ctr1, ra8_drw_perftrigger_t event_ctr2)
Programme PERFTRIGGER for the two performance counters and reset both PERFCOUNTk registers.
ra8_err_t ra8_drw_draw_triangle(const ra8_drw_triangle_t *tri)
Issue an anti-aliased filled triangle.
ra8_err_t ra8_drw_dlist_run(const ra8_drw_dlist_t *dl)
Trigger a built display list (writes DLISTSTART).
Test-access surface for ra8_drw internal helpers (MC/DC).
@ k_ra8_drw_internal_perfev_max
0x1F is "every clock".
static int32_t internal_iabs(int32_t v)
Compute integer absolute value with no library calls.
@ k_ra8_drw_internal_align_mask
4-byte alignment.
static uint32_t internal_to_subpixel(int32_t px)
Convert a signed pixel coordinate to the DRW Q12.4 sub-pixel grid.
2D Drawing Engine (DRW / D/AVE 2D) register layout for the RA8D2
@ k_ra8_drw_off_origin
W: Framebuffer base address.
@ k_ra8_drw_off_l1start
W: Limiter 1 start.
@ k_ra8_drw_off_l3xadd
W: Limiter 3 X-axis increment.
@ k_ra8_drw_off_lvxaddi
W: V limiter X integer.
@ k_ra8_drw_off_l1yadd
W: Limiter 1 Y-axis increment.
@ k_ra8_drw_off_l4yadd
W: Limiter 4 Y-axis increment.
@ k_ra8_drw_off_lvyaddi
W: V limiter Y integer.
@ k_ra8_drw_off_lvstarti
W: V limiter start integer.
@ k_ra8_drw_off_luyadd
W: U limiter Y increment.
@ k_ra8_drw_off_l4start
W: Limiter 4 start.
@ k_ra8_drw_off_l1band
W: Limiter 1 band width.
@ k_ra8_drw_off_cachectl
W: Cache enable / flush.
@ k_ra8_drw_off_perfcount2
RW: Performance counter 2.
@ k_ra8_drw_off_l3start
W: Limiter 3 start.
@ k_ra8_drw_off_size
W: Bounding box (W,H).
@ k_ra8_drw_off_dliststart
W: Display list start address.
@ k_ra8_drw_off_control
W: Geometry control.
@ k_ra8_drw_off_lvstartf
W: V limiter start fraction.
@ k_ra8_drw_off_l2xadd
W: Limiter 2 X-axis increment.
@ k_ra8_drw_off_lvyxaddf
W: V limiter X/Y fraction.
@ k_ra8_drw_off_l2yadd
W: Limiter 2 Y-axis increment.
@ k_ra8_drw_off_l2band
W: Limiter 2 band width.
@ k_ra8_drw_off_perfcount1
RW: Performance counter 1.
@ k_ra8_drw_off_perftrigger
W: Performance trigger select.
@ k_ra8_drw_off_l1xadd
W: Limiter 1 X-axis increment.
@ k_ra8_drw_off_luxadd
W: U limiter X increment.
@ k_ra8_drw_off_l2start
W: Limiter 2 start.
@ k_ra8_drw_off_l4xadd
W: Limiter 4 X-axis increment.
@ k_ra8_drw_off_lustart
W: U limiter start.
@ k_ra8_drw_off_l3yadd
W: Limiter 3 Y-axis increment.
@ k_ra8_drw_perftrigger2_pos
Counter-2 selector pos.
@ k_ra8_drw_size_height_pos
SIZEY in upper half-word.
static volatile uint32_t * ra8_drw_reg32(ra8_drw_off_t off)
Pointer to a 32-bit register inside the DRW block.
ra8_drw_perfcounter_id_t
Selector for the two PERFCOUNTk registers.
@ k_ra8_drw_perfctr_1
PERFCOUNT1 @ +0xCC.
@ k_ra8_drw_perfctr_2
PERFCOUNT2 @ +0xD0.
@ k_ra8_drw_subpixel_unit
1 pixel value (1 << 4).
ra8_drw_perftrigger_t
Internal events that increment a PERFCOUNT register.
@ k_ra8_drw_max_height_px
HUM 62.2.29 SIZEY max.
@ k_ra8_drw_min_dim_px
Zero-sized rect rejected.
@ k_ra8_drw_max_width_px
HUM 62.2.29 SIZEX max.
@ k_ra8_drw_dlr_eol_byte
End-of-list low byte marker.
@ k_ra8_drw_dlr_arg_terminate
Arg: terminate the list.
@ k_ra8_drw_dlr_arg_wait
Arg: wait pipe+cache, go on.
@ k_ra8_drw_dlr_tag_one_index
1-register entry tag base.
@ k_ra8_drw_dlr_eol_arg_pos
End-of-list argument shift.
@ k_ra8_drw_cachectl_all_flush
RA8 DRW cachectl all flush.
@ k_ra8_drw_cachectl_all_en
RA8 DRW cachectl all en.
@ k_ra8_drw_cachectl_cflushtx
Texture cache flush.
@ k_ra8_drw_cachectl_cflushfx
FB cache flush.
ra8_drw_dlr_index_t
Register indices a display-list entry addresses (byte offset / 4).
@ k_ra8_drw_dlr_idx_color1
COLOR1 (HUM Ch 62.2.7, 0x64/4).
@ k_ra8_drw_dlr_idx_control
CONTROL (HUM Ch 62.2.1, 0x00/4).
@ k_ra8_drw_dlr_idx_origin
ORIGIN (HUM Ch 62.2.31, 0x80/4).
@ k_ra8_drw_dlr_idx_size
SIZE (HUM Ch 62.2.29, 0x78/4).
@ k_ra8_drw_control_line_quad
RA8 DRW control line quad.
@ k_ra8_drw_control_triangle
RA8 DRW control triangle.
Error Code Definitions for ra8-firmware.
@ k_ra8_err_no_mem
Static buffer exhausted (no dynamic memory on this project).
Definition ra8_err.h:142
@ k_ra8_err_invalid_arg
Invalid function argument.
Definition ra8_err.h:152
@ k_ra8_ok
Success – operation completed with all postconditions satisfied.
Definition ra8_err.h:119
ra8_err_codes_t ra8_err_t
Canonical error-return type used by every ra8-firmware API.
Definition ra8_err.h:546
Builder state for composing a DRW display list in a caller buffer.
Definition ra8_drw.h:238
uint32_t cap_words
Buffer capacity in 32-bit words.
Definition ra8_drw.h:240
uint32_t * buf
Caller word buffer, 4-byte aligned, in SRAM.
Definition ra8_drw.h:239
bool overflow
A request exceeded the buffer capacity.
Definition ra8_drw.h:242
bool terminated
ra8_drw_dlist_end has closed the list.
Definition ra8_drw.h:243
uint32_t count
Words emitted so far (<= cap_words).
Definition ra8_drw.h:241
Anti-aliased line parameters.
Definition ra8_drw.h:168
int16_t y1
End-point 1 Y in pixels.
Definition ra8_drw.h:172
uint16_t width_px
Stroke width in pixels.
Definition ra8_drw.h:173
uint32_t color_argb8888
0xAARRGGBB stroke colour.
Definition ra8_drw.h:174
int16_t y0
End-point 0 Y in pixels.
Definition ra8_drw.h:170
int16_t x0
End-point 0 X in pixels.
Definition ra8_drw.h:169
int16_t x1
End-point 1 X in pixels.
Definition ra8_drw.h:171
Rectangle parameters for ra8_drw_fill_rect.
Definition ra8_drw.h:96
uint16_t height_px
Height in pixels.
Definition ra8_drw.h:100
uint32_t color_argb8888
0xAARRGGBB fill colour.
Definition ra8_drw.h:101
uint16_t width_px
Width in pixels.
Definition ra8_drw.h:99
Anti-aliased filled triangle parameters.
Definition ra8_drw.h:185
int16_t y0
Vertex 0 Y.
Definition ra8_drw.h:187
int16_t y1
Vertex 1 Y.
Definition ra8_drw.h:189
int16_t y2
Vertex 2 Y.
Definition ra8_drw.h:191
int16_t x2
Vertex 2 X.
Definition ra8_drw.h:190
uint32_t color_argb8888
Fill colour.
Definition ra8_drw.h:192
int16_t x1
Vertex 1 X.
Definition ra8_drw.h:188
int16_t x0
Vertex 0 X.
Definition ra8_drw.h:186