edith_codecs
Clone
https://git.tahinli.com/Tahinli/edith_codecs.git
0 watching0 forksRust370.3 MiB9b67700Tahinli3 days ago4021 commits
| 1 | //! Which cache lines a CPU write-back of a mapped DMA-BUF has to visit. |
| 2 | //! |
| 3 | //! `CLFLUSH` takes an address and writes back the whole cache line holding it, |
| 4 | //! so a buffer needs one flush per line, not one per byte. The incumbent |
| 5 | //! stack flushed every byte (64 instructions per line, 6.2 ms per 1080p |
| 6 | //! picture on radeonsi). The base of a mapping is not guaranteed to be cache |
| 7 | //! aligned, so the last byte's line is flushed too: a range that starts |
| 8 | //! mid-line can straddle one more line than its length suggests. |
| 9 | |
| 10 | /// Bytes per cache line on every x86-64 part this crate targets. |
| 11 | pub const CACHE_LINE: usize = 64; |
| 12 | |
| 13 | /// Offsets from a mapping's base at which to issue a flush for a buffer of |
| 14 | /// `len` bytes: one per [`CACHE_LINE`], plus the last byte when the stride |
| 15 | /// does not land on it. Empty for `len == 0`, which has no line to flush. |
| 16 | |
| 17 | |
| 18 | |
| 19 | |
| 20 | |
| 21 | |
| 22 | |
| 23 | |
| 24 | |
| 25 | |
| 26 | |
| 27 | |
| 28 | |
| 29 | |
| 30 | |
| 31 | |
| 32 | |
| 33 | |
| 34 | |
| 35 | |
| 36 | |
| 37 | |
| 38 | |
| 39 | |
| 40 | |
| 41 | |
| 42 | |
| 43 | |
| 44 | |
| 45 | |
| 46 | |
| 47 | |
| 48 | |
| 49 | |
| 50 | |
| 51 | |
| 52 | |
| 53 | |
| 54 | |
| 55 | |
| 56 | |
| 57 | |
| 58 | |
| 59 | |
| 60 | |
| 61 | |
| 62 | |
| 63 | |
| 64 | |
| 65 | |
| 66 | |
| 67 | |
| 68 | |
| 69 | |
| 70 | |
| 71 | |
| 72 | |
| 73 | |
| 74 | |
| 75 | |
| 76 | |
| 77 | |
| 78 |