clamp_line_coordinates(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… clamp_line_coordinates β€” the kernel API manual, bestie edition

okay so this page is from the Kernel API Manual, section 9, and it's all about clamp_line_coordinates. buckle up πŸŽ€


✨ NAME ✨

clamp_line_coordinates β€” compute and clamp the coordinate to read and write during the blend process. that's it, that's the whole vibe πŸ¦‹


🌸 SYNOPSIS 🌸

void clamp_line_coordinates (enum pixel_read_direction direction , const
struct vkms_plane_state *current_plane , const struct drm_rect *src_line
, int *src_x_start , int *src_y_start , int *dst_x_start , int
*pixel_count );

like, yes, it's a lot of parameters. no, we're not skipping any of them. periodt πŸ’…


🫢 ARGUMENTS 🫢

  • direction β€” the direction of the reading. which way are we going, bestie πŸ‘€
  • current_plane β€” the current plane being blended. main character energy fr ✨
  • src_line β€” the source line of the reading. only the top-left coordinate is used ⭐ β€” and heads up, this rectangle must be rotated and have a shape of 1*pixel_count if direction is vertical, and a shape of pixel_count*1 if direction is horizontal. like, that's not optional, that's the assignment 😭
  • src_x_start β€” the x start coordinate for the line reading πŸ“
  • src_y_start β€” the y start coordinate for the line reading πŸ“
  • dst_x_start β€” the x coordinate to blend the read line onto 🎯
  • pixel_count β€” how many pixels we're blending. the count. the amount. the whole squad 🌈

πŸ’– DESCRIPTION πŸ’–

so what does this function actually do? it's mainly a safety net to avoid reading outside the source buffer πŸ›Ÿ β€” very "don't step off the curb" of it honestly.

and here's the tea β˜•: because userspace should never ask to read outside the source plane, all the cases covered here should be dead code. like... it's there just in case, but ideally nobody ever triggers it πŸ™ˆ


πŸ”₯ SEE ALSO πŸ”₯


ngl bestie, if you're actually in here reading the vkms_composer.c file, you're built different and i respect it πŸ«‘πŸ’œ

okay bye ily, this page lives in ./drivers/gpu/drm/vkms, dated October 2026, and it was clamp_line_coordinates(9) the whole time πŸ§šβ€β™€οΈβ­πŸ’–

πŸ“¦ where this page comes from