Expand the resource cache from 192kb to 320kb

This commit is contained in:
James Babcock committed 2026-11-18 12:29:29 -08:00
1 parent 2922f07c2f
commit d8a15c5251
7 files changed
+107 -62

No files matched your search

+1 -1
View File
@@ -26,7 +26,7 @@ export type FirmwareInfo = {
};
/** The Faceclaw firmware revision this build of the app needs. */
export const REQUIRED_FACECLAW_FIRMWARE_VERSION = 39;
export const REQUIRED_FACECLAW_FIRMWARE_VERSION = 40;
const FACECLAW_PREFIX = "Faceclaw/";
const LEGACY_PREFIX = "EVENCFW";
+76 -40
View File
@@ -19,42 +19,42 @@ export type FirmwarePatchSet = {
export const CFW_PATCH_SET: FirmwarePatchSet = {
"base": "g2_2.3.0.24.bin",
"baseSha256": "187ccf2bcc5c17a212106e8a376745511e8289c4232b634a7ea94b9bf25a0979",
"outputSha256": "e43be9d04031d261574f96d45cb1e0edd67bfb39f0213f323ff82d8560ae454d",
"outputSha256": "2a31417f04cec16ecd4e4c3e575d89ce77fb3c5386b47cdb49b9753aaefb1c32",
"patches": [
{
"offset": 1379947,
"old": "0ef009fa",
"new": "0af3b8fb",
"new": "08f3a6fc",
"desc": "DM callback allocation: retain keyboard lifecycle on queue exhaustion"
},
{
"offset": 1380027,
"old": "0ef0e1f9",
"new": "0af316fb",
"new": "08f304fc",
"desc": "ATT callback allocation: expose lost keyboard events as relay gaps"
},
{
"offset": 2649417,
"old": "0a681279",
"new": "d4f167fb",
"new": "d2f155fc",
"desc": "SMP Pairing I/O capability: KeyboardDisplay only for owned keyboard"
},
{
"offset": 2651811,
"old": "0a681279",
"new": "d3f1bafe",
"new": "d1f1a8ff",
"desc": "SMP Pairing I/O capability: KeyboardDisplay only for owned keyboard"
},
{
"offset": 1385975,
"old": "38b584b0",
"new": "08f3d4be",
"new": "06f3c2bf",
"desc": "BLE app dispatcher: isolate explicitly enabled keyboard connection"
},
{
"offset": 1045797,
"old": "38b584b0",
"new": "5df31bb9",
"new": "5bf309ba",
"desc": "ring receiver entry: timestamped unfiltered reports under framebuffer lease"
},
{
@@ -66,49 +66,49 @@ export const CFW_PATCH_SET: FirmwarePatchSet = {
{
"offset": 1437923,
"old": "fef788ff",
"new": "fdf24cfe",
"new": "fbf23aff",
"desc": "cfw_ancs_event"
},
{
"offset": 1437951,
"old": "fef7e8fb",
"new": "fdf27afb",
"new": "fbf268fc",
"desc": "cfw_ancs_open"
},
{
"offset": 1437969,
"old": "fef7e7fb",
"new": "fdf295fb",
"new": "fbf283fc",
"desc": "cfw_ancs_close"
},
{
"offset": 1388387,
"old": "39694d00",
"new": "79647d00",
"new": "55467d00",
"desc": "connection-bound ANCS EUS write callback"
},
{
"offset": 971497,
"old": "fff717f8",
"new": "6ff34bfa",
"new": "6df339fb",
"desc": "bl faceclaw_input_bridge_received (ring relay and ordered private transport before worker pool)"
},
{
"offset": 971845,
"old": "fef769ff",
"new": "6ff39df9",
"new": "6df38bfa",
"desc": "bl faceclaw_input_bridge_received (ring relay and ordered private transport before worker pool)"
},
{
"offset": 979579,
"old": "fdf74ef8",
"new": "6df382fa",
"new": "6bf370fb",
"desc": "bl faceclaw_input_bridge_received (ring relay and ordered private transport before worker pool)"
},
{
"offset": 1428895,
"old": "f8f76cfd",
"new": "fbf2acfa",
"new": "f9f2d0fb",
"desc": "bl cfw_receive_packet (private SID-f0 probe before TPL reassembly)"
},
{
@@ -132,7 +132,7 @@ export const CFW_PATCH_SET: FirmwarePatchSet = {
{
"offset": 1058287,
"old": "fff754fb",
"new": "5af3ecf8",
"new": "58f3daf9",
"desc": "bl ble_classify_link (only a <= 11.25 ms / latency-0 link is 'already fast')"
},
{
@@ -141,148 +141,184 @@ export const CFW_PATCH_SET: FirmwarePatchSet = {
"new": "5ff43332",
"desc": "reserve final 1 KiB of primary TLSF arena for CFW context anchor"
},
{
"offset": 1130241,
"old": "5ff44d22",
"new": "5ff40622",
"desc": "LVGL arena size 0xcd000 -> 0x86000 (fixed CFW buffers follow it)"
},
{
"offset": 2697223,
"old": "9c212020",
"new": "9c192320",
"desc": "EvenHub arena base 0x2020219c -> 0x2023199c"
},
{
"offset": 2697133,
"old": "5ff4e121",
"new": "5ff48221",
"desc": "EvenHub arena clear length 0x70800 -> 0x41000"
},
{
"offset": 2697149,
"old": "5ff4e121",
"new": "5ff48221",
"desc": "EvenHub TLSF pool size 0x70800 -> 0x41000"
},
{
"offset": 2245731,
"old": "5ff4e125",
"new": "5ff48225",
"desc": "EvenHub heap total in the stock usage log 0x70800 -> 0x41000"
},
{
"offset": 4394495,
"old": "9b212020",
"new": "9bb11b20",
"desc": "MPU region 6 (non-cacheable) ends with the shrunk LVGL arena"
},
{
"offset": 1248487,
"old": "d4f712fb",
"new": "29f396f8",
"new": "27f3a0f9",
"desc": "bl settings_send_wrapper (append caps field 100)"
},
{
"offset": 1246183,
"old": "f5f7e2f8",
"new": "29f394fa",
"new": "27f3befb",
"desc": "bl settings_decode_wrapper (Faceclaw lease field 101)"
},
{
"offset": 975219,
"old": "02f083fc",
"new": "6bf3f6fa",
"new": "69f320fc",
"desc": "bl faceclaw_display_start @ 0x467d68 (fail-open wake takeover)"
},
{
"offset": 975411,
"old": "02f023fc",
"new": "6bf364fb",
"new": "69f38efc",
"desc": "bl faceclaw_display_start_headup @ 0x467e28 (fail-open wake takeover)"
},
{
"offset": 975103,
"old": "07f085fb",
"new": "6ef350fa",
"new": "6cf33efb",
"desc": "bl headup_gate (idle input gate: tap/long/release -> field-102 events, stock result kept)"
},
{
"offset": 830549,
"old": "19f03efb",
"new": "91f325fc",
"new": "8ff313fd",
"desc": "bl gesture_ring_press_mode (ring touch-down 14, head up 12 / down 15; stock dispatch preserved)"
},
{
"offset": 830795,
"old": "1ff071ff",
"new": "91f3defb",
"new": "8ff3ccfc",
"desc": "bl gesture_press (owned event 9 before stock menu gate)"
},
{
"offset": 830887,
"old": "1ff043ff",
"new": "91f3d8fb",
"new": "8ff3c6fc",
"desc": "bl gesture_short_long (Faceclaw lease gates event 11 vs stock Menu path)"
},
{
"offset": 831763,
"old": "1ff08dfd",
"new": "91f30efa",
"new": "8ff3fcfa",
"desc": "bl gesture_release (owned event 10 before stock menu gate)"
},
{
"offset": 1570209,
"old": "7fb50600",
"new": "daf227bc",
"new": "d8f231bd",
"desc": "even_ai_display_ctrl entry -> conditional Faceclaw lease trampoline"
},
{
"offset": 1051545,
"old": "f6f787f9",
"new": "54f31dfe",
"new": "54f359fe",
"desc": "bl display_copy_hook @ 0x47a78e (640x480 direct framebuffer)"
},
{
"offset": 1051861,
"old": "f6f7e9f8",
"new": "54f37ffd",
"new": "54f3bbfd",
"desc": "bl display_copy_hook @ 0x47a8ca (640x480 direct framebuffer)"
},
{
"offset": 1262237,
"old": "d9f7d0fd",
"new": "25f3c3f9",
"new": "23f3edfa",
"desc": "bl faceclaw_send_wear_event @ 0x4ade92 (outside onboarding)"
},
{
"offset": 1262337,
"old": "d9f79efd",
"new": "25f391f9",
"new": "23f3bbfa",
"desc": "bl faceclaw_send_wear_event @ 0x4adef6 (outside onboarding)"
},
{
"offset": 1309405,
"old": "67f02dff",
"new": "19f35ffa",
"new": "17f397fb",
"desc": "bl compass_decode_capture (sample-matched GAF diagnostics)"
},
{
"offset": 1307865,
"old": "fff7c9fb",
"new": "19f3e1fd",
"new": "17f319ff",
"desc": "bl compass_report_event (stock UI + heading with diagnostics over BLE)"
},
{
"offset": 1300937,
"old": "00210170",
"new": "1bf3bffa",
"new": "19f3f7fb",
"desc": "bl compass_preserve_accuracy (retain magnetic calibration under Faceclaw framebuffer lease)"
},
{
"offset": 4537963,
"old": "",
"new": "b0b581ea00039b0701d0034637e0c2b110f0030315d000f1010ca2f1010e0023cc5c9e45c45403f1010404d0634413f003032346f4d121440319121b102a14d302e00346102a10d3d1f800c0d1f804e0cc688d68103adc609d60c3f804e043f810cb0f2a01f11001eed8042a07d300bf51f8045b043a032a43f8045bf8d8002a08bfb0bd0139013b11f8015f013a03f8015ff9d1b0bd00bf884218bf002a00d1704710b50b1a38bf431a934207d288420ad281ea00039b0726d0034669e0fff79fffbde81040704781ea000300eb020c9b0701eb020e42d15fea8c732bd0a0f1010c00bf8b1813f801ec8418531e04f801ec04d0624412f003021a46f2d101eb030e00eb030c17e0830736d0a2f1010c00f1010e002300bfcc5c9c45c45403f1010404d0734413f003032346f4d1121b2144031922e01346042b0ed3aef10402acf1040152f80449043b032b41f80449f8d802f1040e01f1040c1a4653b1aef10101acf1010300bf11f80149013a03f80149f9d1bde8104070470346042a06d351f8044b043a032a43f8044bf8d8002af0d00139013b00bf11f8014f013a03f8014ff9d1e6e700bf80b5002a18bf10f0030301d186460ce000f1010c864600bf013a0ef8011b04d01cf003030cf1010cf6d1102a11d35ffa81fc4ff001330cfb03fc00bf103acef80cc0cef808c0cef804c04ef810cb0f2af4d8042a0bd35ffa81fc4ff001330cfb03fc00bf043a032a4ef804cbfad8002a08bf80bdaef10103013a03f8011ffbd180bd00bf2de9f04fc7b04ff29c5bc2f2290b4ff6ff754ff47e740027012647f67f784ff07f0a1191cde90f3007e000bf48f2a351c0f24501bff32f8f8847dbf80090bff35f8fdbf800000321cff680710140b1f1005fbff35f8f0ad101684ef66c62ccf2ff02914203d14068b0f57e7f3ed04ff47e7006f017fa002800f01b816ff0070142180831b1f57c7f177257729772d772177357739773d773f2d14ef66c61ccf2ff01016044608673a0f8c48180f8c3a1058445848584c584058545858585c585058645868586c586058745878587c5875be8001f4945a9d1bff35f8f4be8000121b15be8001f4945f8d09fe74ff47e7800264ff0010a47f67f797f2707e000bf48f2a351c0f24501bff32f8f8847dbf80040bff35f8fdbf800000321cff680710140b1f1005fbff35f8f0ad101684ef66c62ccf2ff02914203d14168b1f57e7f40d04ff47e7006f0adf9002800f0b1806ff0070142180831b1f57c7f167256729672d672167356739673d673f2d14ef66c61ccf2ff010160c0f8048080f80ea0a0f8c49180f8c371058445848584c584058545858585c585058645868586c586058745878587c5875be8001fa142a7d1bff35f8f4be8000121b15be8001fa142f8d09de7d0f8948242f6f76ac0f2440ab8f1000fbff35f8f4ad00af19a0240464ff0ff314ff0ff379047002840f036811198002860d010980778a7f1170002285ad811980c2840f02381109c6078a178084300f01d81e0780138022800f21881a279e379667a42ea0322237a207942ea034242ea0663a27ae67a6179192f42ea062200f08481172f40f09a81002a40f0ff80fe2800f0b285812800f0a585002840f0b88551ea030040f0f28000f002be04460020d047e0b104f5257151e8008fb8f1000f0cd1bff35f8f00bf41e80002002a00f08b8051e8008fb8f1000ff5d00021bff32f8f0029bff35f8f7ad0804693e74ff0ff37d1e047f6df40c0f24f00cdf83880804700274ff47e784ff0010947f67f764ff07f0a1397adf8507006e048f2a351c0f24501bff32f8f8847dbf80040bff35f8fdbf800000321cff680710140b1f1005fbff35f8f0ad101684ef66c62ccf2ff02914203d14168b1f57e7f47d04ff47e7006f0bdf8002840d06ff0070100bf42180831b1f57c7f177257729772d772177357739773d773f2d14ef66c61ccf2ff010160c0f8048080f80e90a0f8c46180f8c3a1058445848584c584058545858585c585058645868586c586058745878587c5875be8001fa142a7d1bff35f8f4be8000159b15be8001fa142f8d09de70af5a971884716e701217ae70020109f42f6f76addf83880c0f2440a9fb1119989b1397801f07f02b2f10b0418bf0124b2f11c0618bf01268a2924dc0b2926d01c2924d03ce00f9012a803f055fd4ff0ff3701269df85100002812a818bf4ff0ff3703f019fe054646b99df8500028b94af21f30c0f247004c3080470f98002818bf056114e09c2901d08b2918d168b14af21f31c0f247010746884797f8681121b997f824133846109f49b14ff0ff370af5807140468847384647b0bde8f08f0f9012a8264003f017fd387800f07f041e2c05d11199384608f048fd0746b9e71d2c00f07e0018bf1a2819d1dbf800100322cff680720a40b2f1005fbff35f8f12d10a684ef66c63ccf2ff039a420bd14a68b2f57e7f04bf002281f8a12303e0a4f115010129e1d90f2c2cdd142c40f3bb81152c00f0ba82162c00f0c4821f2c40f088831198012840f0588438781f2840f0548445f64d54c0f24604a047012841f0388041f21051c0f2010104f5e2777944e02029220023b8470746002818bf4ff0ff3766e7092c00f3a980052c00f0f081072c40f05e830d9600264ff0010947f67f744ff07f083ae000294ff0ff3708bf002b7ff47caf1328bff479af102a4ff0000138bf01211228b2fa82f218bf510901297ff46caf00f07abc182f4ff0ff3708bf00297ff463af002b7ff460af352800f36483002800f05284012800f05e84312840f05084082abff451af00f05fbc48f2a351c0f24501bff32f8f8847dbf80070bff35f8fdbf800000321cff680710140b1f1005fbff35f8f0bd101684ef66c62ccf2ff02914204d14168b1f57e7f00f060854ff47e7005f051ff002800f058856ff0070142180831b1f57c7f167256729672d672167356739673d673f2d14ef66c61ccf2ff0101604ff47e71416080f80e90a0f8c44180f8c381058445848584c584058545858585c585058645868586c586058745878587c5875be8001fb942a5d1bff35f8f4be80001002900f021855be8001fb942f6d099e70a2c00f0bc810b2c40f0b582dbf800500320cff680702840b0f1005fbff35f8f40f0698728684ef66c61ccf2ff01884240f0618768680027b0f57e7f7ff49baed5f8900342f68d49c0f244090028a5f8a07318bfc8470021a5f8d013c5f8cc13c5f86c1185f86a1185f86811d5f87001c5f8641185f86911c5f87011c5f82013a5f88c1320b148f2a351c0f245018847d5f89802002818bf03f099fd0024c5f89842d5f8880320b148f2a351c0f245018847c5f88843a5f88c43686ca5f8484040b1c847686c09f166018847002804bf002068644bf63940c0f251008047dbf800400320cff680702040b0f1005fbff35f8f48d120684ef66c61ccf2ff01884241d16068b0f57e7f3dd194f87b014Line truncated
"new": "b0b581ea00039b0701d0034637e0c2b110f0030315d000f1010ca2f1010e0023cc5c9e45c45403f1010404d0634413f003032346f4d121440319121b102a14d302e00346102a10d3d1f800c0d1f804e0cc688d68103adc609d60c3f804e043f810cb0f2a01f11001eed8042a07d300bf51f8045b043a032a43f8045bf8d8002a08bfb0bd0139013b11f8015f013a03f8015ff9d1b0bd00bf884218bf002a00d1704710b50b1a38bf431a934207d288420ad281ea00039b0726d0034669e0fff79fffbde81040704781ea000300eb020c9b0701eb020e42d15fea8c732bd0a0f1010c00bf8b1813f801ec8418531e04f801ec04d0624412f003021a46f2d101eb030e00eb030c17e0830736d0a2f1010c00f1010e002300bfcc5c9c45c45403f1010404d0734413f003032346f4d1121b2144031922e01346042b0ed3aef10402acf1040152f80449043b032b41f80449f8d802f1040e01f1040c1a4653b1aef10101acf1010300bf11f80149013a03f80149f9d1bde8104070470346042a06d351f8044b043a032a43f8044bf8d8002af0d00139013b00bf11f8014f013a03f8014ff9d1e6e700bf80b5002a18bf10f0030301d186460ce000f1010c864600bf013a0ef8011b04d01cf003030cf1010cf6d1102a11d35ffa81fc4ff001330cfb03fc00bf103acef80cc0cef808c0cef804c04ef810cb0f2af4d8042a0bd35ffa81fc4ff001330cfb03fc00bf043a032a4ef804cbfad8002a08bf80bdaef10103013a03f8011ffbd180bd00bf2de9f04fc7b04ff29c5bc2f2290b4ff6ff784ff47e740027012647f67f754ff07f0a1191cde90f3007e000bf48f2a351c0f24501bff32f8f8847dbf80090bff35f8fdbf800000321cff680710140b1f1005fbff35f8f0ad101684ef66d62ccf2ff02914203d14068b0f57e7f4ed04ff47e7002f0f9f9002800f027816ff0070142180831b1f57c7f177257729772d772177357739773d773f2d14ef66d61ccf2ff01016044608673a0f8c85180f8c7a1a0f82080a0f82280a0f82480a0f82680a0f82880a0f82a80a0f82c80a0f82e80a0f83080a0f83280a0f83480a0f83680a0f83880a0f83a80a0f83c80a0f83e805be8001f494599d1bff35f8f4be8000121b15be8001f4945f8d08fe74ff47e7a00254ff0010947f67f777f2407e000bf48f2a351c0f24501bff32f8f8847dbf80060bff35f8fdbf800000321cff680710140b1f1005fbff35f8f0ad101684ef66d62ccf2ff02914203d14168b1f57e7f50d04ff47e7002f07ff9002800f0ad806ff0070142180831b1f57c7f157255729572d572157355739573d573f2d14ef66d61ccf2ff010160c0f804a080f80e90a0f8c87180f8c741a0f82080a0f82280a0f82480a0f82680a0f82880a0f82a80a0f82c80a0f82e80a0f83080a0f83280a0f83480a0f83680a0f83880a0f83a80a0f83c80a0f83e805be8001fb14297d1bff35f8f4be8000121b15be8001fb142f8d08de7d0f8984242f6f76ac0f2440abff35f8fdcb30af19a0220464ff0ff314ff0ff379047002840f02e81119800284ed010980778a7f11700022848d811980c2821d1109d6878a97808431cd0e8780138022818d8aa79eb796e7a42ea03222b7a287942ea034242ea0663aa7aee7a6979192f42ea062200f07f81172f40f09581002a00f04e834ff0ff37f8e004460020d047c8b104f5267151e8004f54b9bff35f8f41e80002002a00f0998051e8004f002cf6d00021bff32f8f0029bff35f8f00f089800446a5e74ff0ff37dbe047f6df40c0f24f000e94804700274ff47e79012647f67f744ff07f0a13978df8507006e048f2a351c0f24501bff32f8f8847dbf80050bff35f8fdbf800000321cff680710140b1f1005fbff35f8f0ad101684ef66d62ccf2ff02914203d14168b1f57e7f57d04ff47e7002f095f8002850d06ff0070100bf42180831b1f57c7f177257729772d772177357739773d773f2d14ef66d61ccf2ff010160c0f804908673a0f8c84180f8c7a1a0f82080a0f82280a0f82480a0f82680a0f82880a0f82a80a0f82c80a0f82e80a0f83080a0f83280a0f83480a0f83680a0f83880a0f83a80a0f83c80a0f83e805be8001fa94298d1bff35f8f00bf4be8000159b15be8001fa942f8d08de70af5a97188471ae701216be70020109f42f6f76ac0f2440a9fb1119989b1397801f07f02b2f10b0418bf0124b2f11c0518bf01258a291edc0b2920d01c291ed03ae00f9012a801f06dfe4ff0ff37012612a801f037ff054646b99df8500028b94af21f30c0f247004c3080470f98002818bf056117e09c2901d08b291cd180b14af21f31c0f247010646884796f86811bff35f8f29b996f824133046bff35f8f51b14ff0ff370e9c0af5807120468847384647b0bde8f08f0f9012a804ea050601f030fe387800f07f041e2c05d11199384606f01ffe0746bae71d2c00f07e0018bf1a2819d1dbf800100322cff680720a40b2f1005fbff35f8f12d10a684ef66d63ccf2ff039a420bd14a68b2f57e7f04bf002281f8a12303e0a4f115010129e1d90f2c2cdd142c40f3ad81152c00f0c882162c00f0d2821f2c40f095831198012840f0648438781f2840f0608445f64d54c0f24604a047012841f05e8041f2de01c0f2010104f5e2777944e02029220023b8470746002818bf4ff0ff3767e7092c00f3b880052c00f0ee81072c40f06b830d9600264ff0010947f67f777f243ae000294ff0ff3708bf002b7ff47caf1328bff479af102a4ff0000138bf01211228b2fa82f218bf510901297ff46caf00f087bc182f4ff0ff3708bf00297ff463af002b7ff460af352800f37083002800f05f84012800f06b84312840f05d84082abff451af00f06cbc48f2a351c0f24501bff32f8f8847dbf80050bff35f8fdbf800000321cff680710140b1f1005fbff35f8f0bd101684ef66d62ccf2ff02914204d14168b1f57e7f00f077854ff47e7001f01dff002800f06f856ff0070142180831b1f57c7f167256729672d672167356739673d673f2d14ef66d61ccf2ff0101604ff47e71416080f80e90a0f8c87180f8c741a0f82080a0f82280a0f82480a0f82680a0f82880a0f82a80a0f82c80a0f82e80a0f83080a0f83280a0f83480a0f83680a0f83880a0f83a80a0f83c80a0f83e805be8001fa94295d1bff35f8f4be80001002900f028855be8001fa942f6d089e70a2c00f0bb810b2c40f0b382dbf800500320cff680702840b0f1005fbff35f8f40f0808728684ef66d61ccf2ff01884240f0788768680027b0f57e7f7ff48daed5f8900342f68d49c0f244090028a5f8a07318bfc8470021a5f8d013c5f8cc13c5f8701185f86c11bff35f8f85f86811686c85f86b11c5f87411c5f82013c5f88813a5f88c13a5f8481040b1c847686c09f166018847002804bf002068644bf63940c0f251008047dbf800400320cff680702040b0f1005fbff35f8f46d120684ef66Line truncated
"desc": "append injected blobs to main-app payload"
},
{
"offset": 779123,
"old": "805a3900",
"new": "187c3a00",
"new": "10783a00",
"desc": "main-app subheader payload size (ps)"
},
{
"offset": 152,
"old": "005b3900",
"new": "987c3a00",
"new": "90783a00",
"desc": "main-app TOC entry size (ps + 128)"
},
{
"offset": 779243,
"old": "805a3904",
"new": "187c3a04",
"new": "10783a04",
"desc": "main-app preamble length (low 24 bits)"
},
{
"offset": 779247,
"old": "effdbcea",
"new": "ed6f6deb",
"new": "adc5378e",
"desc": "[5] ota/s200_firmware_ota.bin preamble crc32"
},
{
"offset": 156,
"old": "c0c6322a",
"new": "7141aa39",
"new": "0c2e1c3e",
"desc": "[5] ota/s200_firmware_ota.bin component crc32c (TOC)"
},
{
"offset": 779127,
"old": "c0c6322a",
"new": "7141aa39",
"new": "0c2e1c3e",
"desc": "[5] ota/s200_firmware_ota.bin component crc32c (subheader)"
}
]
@@ -20,11 +20,18 @@ class CachedResource @JvmOverloads constructor(bytes: ByteArray, val owner: Stri
*/
class ResourceCacheState {
companion object {
/** Mirrors g2flash/patches/resource_cache.h. */
const val CACHE_SIZE = 196608
/**
* Mirrors g2flash/patches/resource_cache.h: the id table, then 320 KiB shared by the
* resources and their block headers. Firmware before Faceclaw/40 had 192 KiB in all,
* so this must not grow past what REQUIRED_FACECLAW_FIRMWARE_VERSION guarantees.
* RayNeo iO sessions use the same budget: that firmware's own copy of the header
* (faceclaw-rayneo-cfw patches/fc/resource_cache.h) needs at least this much before
* it reports the required revision.
*/
const val RESOURCE_COUNT = 512
const val TABLE_BYTES = RESOURCE_COUNT * 4
const val ARENA_BYTES = CACHE_SIZE - TABLE_BYTES
const val ARENA_BYTES = 320 * 1024
const val CACHE_SIZE = TABLE_BYTES + ARENA_BYTES
const val MAX_RESOURCE_SIZE = 65536
const val BLOCK_HEADER_BYTES = 16
@@ -507,7 +507,7 @@ class GlassesSessionCore(
// Preview/screenshot/recording callers render those explicitly on demand.
internal val compositor = SurfaceCompositor(false)
// Phone-side model of the CFW's 192 KiB resource cache.
// Phone-side model of the CFW's resource cache (ResourceCacheState.CACHE_SIZE).
// Reset whenever the image pipeline / EvenHub session is torn down: the
// firmware frees the cache with the fb lease, and after any resync the
// cheap safe assumption is an empty cache (glyphs re-upload lazily).
+3 -3
View File
@@ -359,9 +359,9 @@ test('a paired keyboard: the bridge follows the G2 link, and its keys\' gestures
// Connected is not enough: the firmware has to be one with the bridge.
f.bridge.emitState('connected');
assert.ok(!f.keyboard.calls.includes('ready'));
f.bridge.listeners.firmware({ leftVersion: '2.3.0.24', rightVersion: '2.3.0.24', extension: 'Faceclaw/38' });
assert.ok(!f.keyboard.calls.includes('ready'));
f.bridge.listeners.firmware({ leftVersion: '2.3.0.24', rightVersion: '2.3.0.24', extension: 'Faceclaw/39' });
assert.ok(!f.keyboard.calls.includes('ready'));
f.bridge.listeners.firmware({ leftVersion: '2.3.0.24', rightVersion: '2.3.0.24', extension: 'Faceclaw/40' });
assert.equal(f.keyboard.calls.at(-1), 'ready');
assert.equal(f.keyboard.host.ready(), true);
// The link dropping on its own ends it without a word to the firmware; coming back restores it.
@@ -398,7 +398,7 @@ test('a keyboard needs a G2: other glasses never bring the bridge up', async ()
const f = fixture();
await f.connect();
f.bridge.emitState('connected');
f.bridge.listeners.firmware({ leftVersion: 'g1v0 0.5.66', rightVersion: 'g1v0 0.5.66', extension: 'Faceclaw/39' });
f.bridge.listeners.firmware({ leftVersion: 'g1v0 0.5.66', rightVersion: 'g1v0 0.5.66', extension: 'Faceclaw/40' });
assert.ok(!f.keyboard.calls.includes('ready'), f.keyboard.calls.join());
} finally { glassesType = 'g2'; }
});
@@ -347,9 +347,9 @@ class DisplayListTest {
val gray = ByteArray(640 * 480) { 48 }; val app = BmpUtil.pack4bppFromGray8(gray, 640, 480)
fun layer(key: Int, y: Int, h: Int, nibble: Int, depth: Int = 0) =
ShellScene.Layer(key, 14, y, 612, h, 256, ByteArray(306 * h) { (nibble * 17).toByte() }, depth = depth)
// Each 612x214 layer is just under the 64 KiB resource cap; three exceed the arena on their own.
// Each 612x200 layer takes 60 KiB of the 320 KiB arena: five fit and six exceed it on their own.
fun chrome(depth: Int) = layer(1, 444, 36, 7, depth)
val modals = listOf(layer(2, 10, 214, 9), layer(3, 120, 214, 11), layer(4, 230, 214, 13, depth = 4))
val modals = (0..5).map { layer(2 + it, 10 + 50 * it, 200, 8 + it, depth = if (it == 5) 4 else 0) }
val overflow = ShellScene(listOf(chrome(6)) + modals)
val plan = planner.plan(app, 640, 480, null, overflow, 1)
assertEquals(2, plan.bakedLayers); assertFalse(plan.bakedSelections)
@@ -363,7 +363,7 @@ class DisplayListTest {
assertContentEquals(BmpUtil.pack4bppFromGray8(expected.preview(gray, 640, 480, glasses.right), 640, 480), glasses.composition)
}
// Once the shell fits again, the next frame is fully live and the screen is the app's again.
val fits = ShellScene(listOf(chrome(0), modals[2]))
val fits = ShellScene(listOf(chrome(0), modals.last()))
val next = planner.plan(app, 640, 480, null, fits, plan.nextFid)
assertEquals(0, next.bakedLayers)
for (glasses in lenses) {
@@ -372,13 +372,13 @@ class DisplayListTest {
assertContentEquals(BmpUtil.pack4bppFromGray8(fits.preview(gray, 640, 480, glasses.right), 640, 480), glasses.composition)
}
}
@Test fun noisyFramesRemainBoundedAndResourceBudgetIs192KiB() {
@Test fun noisyFramesRemainBoundedAndResourceBudgetIs322KiB() {
val cache=ResourceCacheState();val planner=ScenePlanner(cache);val glasses=Glasses()
val app=ByteArray(640*480/2){(it*37).toByte()}
val plan=planner.plan(app,640,480,null,ShellScene.EMPTY,1)
assertTrue(plan.commands.all { it.size<=65535 });glasses.apply(plan.commands)
assertContentEquals(app,glasses.screen);assertContentEquals(app,glasses.composition)
assertEquals(196608,ResourceCacheState.CACHE_SIZE)
assertEquals(2048+320*1024,ResourceCacheState.CACHE_SIZE)
}
/** Revision 35. Same calls and expectations as ClipTest in g2flash/tests/test_display_list.py. */
@Test fun clipRectsNarrowEveryOpNestThroughListsAndMoveWithDepth() {
@@ -64,10 +64,12 @@ class ResourceCacheTest {
@Test fun lruEvictsByBytesAndProtectsAllCurrentFrameHits() {
val cache = ResourceCacheState()
// Five of these fill the 320 KiB arena; a sixth needs an eviction.
val a = resource(60000, 1); val b = resource(60000, 2); val c = resource(60000, 3); val d = resource(60000, 4)
assertContentEquals(intArrayOf(0, 1, 2), cache.prepare(listOf(a, b, c)))
val e = resource(60000, 5); val f = resource(60000, 6)
assertContentEquals(intArrayOf(0, 1, 2, 3, 4), cache.prepare(listOf(a, b, c, e, f)))
cache.drainCommands(3600)
cache.prepare(listOf(a)); cache.drainCommands(3600) // b is oldest now.
cache.prepare(listOf(a, e, f)); cache.drainCommands(3600) // b is oldest now.
assertContentEquals(intArrayOf(1, 2), cache.prepare(listOf(d, c))) // protect later hit c before d.
val commands = cache.drainCommands(3600)
assertContentEquals(byteArrayOf(22, 1, 0, 1, 0), commands.first())
@@ -75,10 +77,10 @@ class ResourceCacheTest {
assertEquals(0, cache.resourceId(a)); assertEquals(2, cache.resourceId(c))
assertEquals(1, cache.resourceId(d))
assertContentEquals(d.bytes, uploaded(commands).getValue(1))
val tooLarge = cache.prepare(listOf(a, c, d, b))
val tooLarge = cache.prepare(listOf(a, c, d, e, f, b))
assertEquals(-1, tooLarge.last())
assertTrue(cache.drainCommands(3600).isEmpty())
assertEquals(3, cache.residentCount())
assertEquals(5, cache.residentCount())
}
@Test fun idPressureUsesLruEvenWhenBytesAreAvailable() {
@@ -96,15 +98,15 @@ class ResourceCacheTest {
@Test fun rejectedPlansRestoreResidencyAndLru() {
val cache = ResourceCacheState()
val resources = (0..3).map { resource(65536, it) }
cache.prepare(resources.take(3)); cache.drainCommands(3600)
val resources = (0..5).map { resource(60000, it) } // five fit, the sixth evicts
assertContentEquals(intArrayOf(0, 1, 2, 3, 4), cache.prepare(resources.take(5))); cache.drainCommands(3600)
val rollback = cache.checkpoint()
cache.prepare(listOf(resources[3]))
cache.prepare(listOf(resources[5]))
assertEquals(-1, cache.resourceId(resources[0]))
rollback()
assertEquals(0, cache.resourceId(resources[0])); assertEquals(-1, cache.resourceId(resources[3]))
assertEquals(0, cache.resourceId(resources[0])); assertEquals(-1, cache.resourceId(resources[5]))
assertTrue(cache.drainCommands(3600).isEmpty())
cache.prepare(listOf(resources[3]))
cache.prepare(listOf(resources[5]))
assertContentEquals(byteArrayOf(22, 1, 0, 0, 0), cache.drainCommands(3600).first())
}