READ_LINE_YUV_SEMIPLANAR(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… READ_LINE_YUV_SEMIPLANAR πŸ’…

okay so first things first, bestie: this is from the kernel API manual, section 9 (iykyk), and it's genuinely one of those "macro that writes code for you" situations that sounds scary but is actually kind of iconic once it clicks ✨

It's a generic generator for a read_line function β€” like, it builds the function for you 🫢 β€” and it's the one you reach for when you're dealing with yuv formats with two planes where block_w == block_h == 1. No cap, that's the whole vibe check for when this applies.


✨ SYNOPSIS ✨

READ_LINE_YUV_SEMIPLANAR (function_name , pixel_1_name , pixel_2_name ,
pixel_1_type , pixel_2_type , callback , ... );

literally just pass the args and let the preprocessor do her main character thing πŸ’…


πŸŽ€ ARGUMENTS πŸŽ€

  • function_name β€” the name of the function you want generated. yeah. it names itself. slay.
  • pixel_1_name β€” a temporary pixel name for the first plane, used inside the __VA_ARGS__ parameters πŸ¦‹
  • pixel_2_name β€” same deal but for the second plane, also used in the __VA_ARGS__ parameters 🌸
  • pixel_1_type β€” here's where you say what type you want the pixel pointer cast to on plane 1 ✨
  • pixel_2_type β€” and what type to cast the pixel pointer to on plane 2 πŸ’œ
  • callback β€” the callback that gets called for each pixels. this function should take (struct conversion_matrix*, __VA_ARGS__) as parameter and return a pixel_argb_u16 πŸ”₯
  • ... β€” variable arguments. these are the arguments to pass inside the callback β€” and you can use pixel_1_name and pixel_2_name to access the current pixel values πŸ‘‘
the callback contract is lowkey the whole point: (struct conversion_matrix*, __VA_ARGS__) in, pixel_argb_u16 out. don't fumble it πŸ™ˆ

🌈 SEE ALSO 🌈

Kernel file ./drivers/gpu/drm/vkms/vkms_formats.c β€” that's the home base, go look at her πŸ’–

And the whole friend group:


that's the page, bestie 🫢 this one lives at ./drivers/gpu/drm/vkms, dated October 2026 β€” go read the source, it ate πŸ’€βœ¨

πŸ“¦ where this page comes from