clamp_line_coordinates(9)
π 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 of1*pixel_countifdirectionis vertical, and a shape ofpixel_count*1ifdirectionis 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 π₯
- Kernel file
./drivers/gpu/drm/vkms/vkms_composer.c pre_mul_alpha_blend(9)direction_for_rotation(9)blend_line(9)blend(9)vkms_composer_worker(9)
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
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms