get_block_step_bytes(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ get_block_step_bytes(9) ✨

okay so bestie, this one lives in the Kernel API Manual and it's literally the little helper that figures out the correct step value between each pixel block when you're reading in a certain direction πŸ’… no cap, it's giving "glue code that saves your whole render" energy.


🌸 SYNOPSIS 🌸

int get_block_step_bytes (struct drm_framebuffer *fb , enum pixel_read_direction direction , int plane_index );

like, three args, one int back, we love a low-drama signature 🫢


πŸŽ€ ARGUMENTS πŸŽ€

  • fb β€” the framebuffer you're iterating on, bestie. that's the thing you're walking through πŸ’–
  • direction β€” the direction of the reading. which way are we going, queen? πŸ‘‘
  • plane_index β€” the plane you want the step from ✨

πŸ’œ DESCRIPTION πŸ’œ

so here's the vibe check: the number that comes back is the number of bytes between two consecutive blocks in a direction. that's it, that's the whole thing πŸ¦‹

but bestie, listen β€” because of that, the caller may have to read multiple pixels before using the next one. like, the step isn't a per-pixel thing, it's a per-block thing, and those are not the same iykyk 😭

the example the page gives is iconic: to read from left to right in a DRM_FORMAT_R1 plane, each block contains 8 pixels, so the step must be used only every 8 pixels. the way that math math-ing 🧚 periodt.

fr fr do not just add the step after every single pixel or it's gonna be a whole mess πŸ’€

πŸ”₯ SEE ALSO πŸ”₯

like, the whole squad is here, go read them too πŸ’–


🌈 sign-off 🌈

this gem comes to you from ./drivers/gpu/drm/vkms, dated October 2026 β€” and yeah, the page header is get_block_step_bytes(9) and the footer says the same thing, so we're full circle, main character energy only β­πŸ’…πŸŽ€

go forth and step correctly, bestie πŸ«ΆπŸ’œ

πŸ“¦ where this page comes from