Page MenuHomeFreeBSD

linuxkpi: Add more `struct folio`-related functions
ClosedPublic

Authored by dumbbell on Apr 16 2026, 8:58 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, May 18, 9:28 AM
Unknown Object (File)
Mon, May 18, 9:22 AM
Unknown Object (File)
Sun, May 17, 3:02 PM
Unknown Object (File)
Sun, May 17, 8:36 AM
Unknown Object (File)
Sun, May 17, 3:33 AM
Unknown Object (File)
Sun, May 17, 3:23 AM
Unknown Object (File)
Sun, May 17, 12:53 AM
Unknown Object (File)
Sat, May 16, 9:50 PM
Subscribers

Details

Summary

The i915 DRM driver started to replace the use of struct page by struct folio in its GEM shmem code in Linux 6.12. linuxkpi were missing a few more functions: kmap_local_folio(), memcpy_to_folio() and offset_in_folio(). They are equivalent of their struct page counterparts.

One difference is that kmap_local_folio() takes an offset argument and the returned address takes this offset into account.

This is part of the update of DRM drivers to Linux 6.12.

Sponsored by: The FreeBSD Foundation

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

bz requested changes to this revision.Apr 20 2026, 9:51 PM
bz added a subscriber: bz.

I wonder when it'll bite us that we implement folio using page and not page using folio...

sys/compat/linuxkpi/common/include/linux/highmem.h
106
110

I'd also remove the empty line.

This revision now requires changes to proceed.Apr 20 2026, 9:51 PM
In D56438#1294101, @bz wrote:

I wonder when it'll bite us that we implement folio using page and not page using folio...

Perhaps this is something that we can revisit with your work on FreeBSD vs. Linux pages? I’m not telling you to do it of course, but I could improve that as part of this task.

This revision is now accepted and ready to land.Apr 22 2026, 1:38 PM