vmw_find_first_diff(9)
π vmw_find_first_diff β find the first difference between dst and src
okay so bestie, welcome to the Kernel API Manual π«Ά β yes, that Kernel API Manual, the one that lives in vmw_find_first_diff(9). today's main character is a little function that literally just tells you where two blobs of memory stop matching. it's giving "spot the difference" but make it kernel. π₯
β¨ SYNOPSIS β¨
size_t vmw_find_first_diff (const u8 *dst , const u8 *src , size_t size
, size_t granularity );
that's it. that's the whole vibe check. four args, one size_t back out. no cap. π
πΈ ARGUMENTS πΈ
dstβ the destination address π like, the place we're comparing to, bestie.srcβ the source address β¨ the other one in the comparison. the original. the blueprint.sizeβ number of bytes to compare π so how much of this we're actually staring at.granularityβ the granularity needed for the return value in bytes π¦ iykyk β it's the unit the answer comes back in.
π RETURN π
the offset from find start where the first difference was encountered, in bytes β like, "hey bestie, they stopped matching right here."
and if no difference was found? the function returns a value >= size π yep, greater than or equal to size β that's your signal that everything matched, no notes, periodt.
ngl, that's the whole trick: a real hit is always< size, and "nothing to report" is>= size. so don't go treating a "no diff" return like an actual index, okay? π
π SEE ALSO π
- Kernel file
./drivers/gpu/drm/vmwgfx/vmwgfx_blit.cπ vmw_find_last_diff(9)vmw_memcpy(9)vmw_adjust_rect(9)vmw_diff_memcpy(9)struct vmw_bo_blit_line_data(9)vmw_bo_cpu_blit_line(9)vmw_bo_cpu_blit(9)
the whole friend group fr fr π§ go read their pages too, they're iconic.
mwah π that's a wrap! this little beauty comes to you from ./drivers/gpu/drm/vmwgfx, dated October 2026, and it goes by vmw_find_first_diff(9) β same as always, no rebranding, slay. πβ¨
π¦ 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