udma_get_tr_counters(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ‘‘ udma_get_tr_counters(9) β€” calculate TR counters for a given length

okay so this page is from the Kernel API Manual, section 9, bestie. today's main character is udma_get_tr_counters, and it is literally here to calculate TR counters for a given length. it's giving β€œlet me do the math so you don't have to” energy fr fr. πŸ¦‹

🌸 NAME 🌸

udma_get_tr_counters β€” calculate TR counters for a given length. periodt. πŸ’…

✨ SYNOPSIS ✨

int udma_get_tr_counters (size_t len , unsigned long align_to , u16
       *tr0_cnt0 , u16 *tr0_cnt1 , u16 *tr1_cnt0 );

πŸŽ€ ARGUMENTS πŸŽ€

  • len β€” Length of the trasnfer. yes, that spelling is in the page, not me, iykyk πŸ™ˆ
  • align_to β€” Preferred alignment. the alignment you want it to vibe with.
  • tr0_cnt0 β€” First TR icnt0. first TR counter slot, iconic.
  • tr0_cnt1 β€” First TR icnt1. second counter for the first TR.
  • tr1_cnt0 β€” Second (if used) TR icnt0. only relevant when the second TR actually gets used.

πŸ’… DESCRIPTION πŸ’…

For len < SZ_64K only one TR is enough, and tr1_cnt0 is not updated. that's the lowkey simple case πŸŽ€

For len >= SZ_64K two TRs are used in a simple way:

  • First TR: SZ_64K-alignment blocks (tr0_cnt0, tr0_cnt1)
  • Second TR: the remaining length (tr1_cnt0)

Returns the number of TRs the length needs (1 or 2). If the length can not be supported, it returns -EINVAL. no cap, that's the whole vibe check πŸ”₯

🌈 SEE ALSO 🌈

Kernel file ./drivers/dma/ti/k3-udma.c β€” and also __udma_alloc_gp_rflow_range(9). go read those if you're obsessed like me 🫢


mwah πŸ’– β€” source/version: ./drivers/dma/ti; date: October 2026. periodt, bestie. slay ✨

πŸ“¦ where this page comes from