R5e: carried Linux helpers (drm_mm, drm_cache) in misc/drm_helpers #14
Loading…
Reference in a new issue
No description provided.
Delete branch "r5e-helpers"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Anima work item: R5e
01a0f883-6620-7de1-a462-ffdadb97dc82Carries the Linux DRM helper code that modern i915's headless build needs and that the Rust core's facade does not provide, as Linux C in one illumos kernel module,
misc/drm_helpers, with its self-tests in the kernel and on the host, an IPS manifest and CI steps. Stacked on #13 (r5b-layouts,501c309).Inventory and classification
Source: R5c's measurement of i915's headless build (Linux v7.2
8d3ae59288, R5c's configuration, 163 translation units, 113,093 lines:i915.modminusdisplay/, the display glue and the excludedi915_pmu.o,gt/intel_ggtt_gmch.o). Non-kernel imports by provider:drm.kodrm_mm, 2drm_cache); 31 core-owned (files, ioctls, GEM, PRIME, syncobj, mmap offsets, printing, managed: facade gaps for R5c's inventory / the i915 port); 1 display (drm_mode_config_reset)sync_file_create)ttm_device_init/finifromi915_driver_early_probe(); R5c excludes and stubs i915's TTM backendgpu_buddy/drm_buddyi915_ttm_buddy_manager.ouses them, for local memory (IS_DGFX); it also imports TTM, so the TTM decision governs it (R5c stubs it). MIT, carryable for amdgpudrm_kms_helperHAS_DISPLAY)drm_suballoc,drm_exec,gpu-sched,drm_gpuvmintel-gtt(drivers/char/agp)intel_ggtt_gmch.ooutdrm_rect,drm_fourcc, DP/DSC/HDCPdrm.koby file:drm_mm.c10 (carried),drm_cache.c2 (carried),drm_vma_manager.c6 (core-owned: offsets live in the core's devmap path),drm_print.c8 (5 facade),drm_drv.c9 (4),drm_file.c6 (2),drm_gem.c4 (2),drm_prime.c5 (0),drm_syncobj.c5 (3),drm_ioctl.c3 (1),drm_managed.c3 (2),drm_auth.c1 (0),drm_mode_config.c1 (display).Licences
drivers/gpu/drm/drm_mm.c,include/drm/drm_mm.hdrivers/gpu/drm/drm_cache.c,include/drm/drm_cache.hdrivers/gpu/drm/tests/drm_mm_test.clib/rbtree.c,rbtree*.h,interval_tree_generic.hlinuxkpi/(D7)include/linux/*.h,arch/x86/include/asm/*.husedlinuxkpi/(D7)lib/stackdepot.cCONFIG_DRM_DEBUG_MMoff)carried/fetch-and-patchvendors only MIT or dual-MIT files listed in<helper>/SOURCESwith their SHA-256, refuses anything else,-fcompares them with git.kernel.org at the pin (done: identical),-urefreshes them for a new pin.Module decision
One
misc/drm_helpersfor the C helpers Linux builds intodrm.ko(ourdrm.kois the Rustmisc/drm_core, which should not depend on the compatibility layer); laterdrm_rect/drm_fourccjoin it. Helpers that are separate Linux modules (buddy,drm_exec,drm_suballoc_helper,gpu-sched, TTM, display helpers) get a module each when a driver needs them.-ztype=kmod -z defs -B reducewithcarried/drm_helpers/drm_helpers_scope.mapfile: the globals are exactly_init,_fini,_info, the tendrm_mmfunctions i915 imports anddrm_clflush_virt_range;build.shfails otherwise. Dependents link-N misc/drm_helpers -M carried/drm_helpers/drm_helpers.mapfile._initbeforemod_install;_initrefuses a processor without CLFLUSH. No guard against the legacy stack is needed: gfx-drm'smisc/drmexportsdrm_mm_*too, and krtld resolves each module against its own dependencies.drm_cachepatch 0001:drm_clflush_pages/drm_clflush_sgunderCONFIG_LKPI_STRUCT_PAGE(R5c'sstruct page/sg_table; thendrm_clflush_sg, which i915 imports, builds unchanged and joins the mapfiles);drm_need_swiotlband the WC-copy functions underCONFIG_LKPI_IOSYS_MAP(not used by i915 headless).wbinvd_on_all_cpus()has no definition on purpose: the-z defslink proves the no-CLFLUSH path is compiled out.Tests and evidence
tools/test/run-r5e-test.sh, hephaistos guestr5e-run4, fresh overlay ofgolden-20260930, illumos7e802e88a3, build of65afae7on oibuild with gcc 14.3 and the gate's flags): PASS, 27 checks. The module loads and unloads alone. The test driverdrm_helpers_test(rselftest style; linked-N misc/drm_helpersagainst the exported functions only; kstatdrm_helpers_test:0:selftestplus syslog) runs 16 tests at attach (14drm_mm, 2drm_cache) for five seeds up to scale 50: 130,876 to 6,464,544 checks, none failed.misc/drm_helpersrefuses to unload under its dependent and unloads afterrem_drv.inject_failure=1is counted (1 test, 1 check) and logged, and the attach still succeeds./etcand/devices/pseudoare unchanged afterwards. The package installs, verifies and uninstalls with the tested module (same SHA-256) in a scratch boot environment. The guest was stopped and its overlay deleted.carried/host-test.sh):drm_cachethere).drm_mmcounts on both compilers and in the kernel.drm_mmtests cover what i915 relies on: reservations, the four insertion modes and ONCE, ranges, non-power-of-two alignment, colour adjustment with guard gaps, interval queries, and the eviction scan with colour eviction asi915_gem_evict_something()drives it. Random walks run against an exhaustive feasibility oracle, and four allocators run on four threads. After every change the whole allocator (list, holes, three trees) is verified.packaging/drm-helpers.p5mpublished into a scratch repository, pkglint clean, archived as a p5p.carried/build.shandcarried/host-test.sh.Compatibility files to reconcile with R5c
Written for R5e before R5c's layer existed, at R5c's paths, each marked "to be reconciled with R5c". The merge replaces them;
misc/drm_helpersthen links R5c's trees instead of its local copy, andcarried/test/host/rbtree_test.ccan test R5c's.linuxkpi/include/linux/:types.h,compiler.h(definestypeof: the gate's-fno-asmremoves the keyword),limits.h,bug.h,math64.h,log2.h,bitops.h,kernel.h,list.h(nolist_move_tail: illumos'sys/list.hhas its own),errno.h,export.h,slab.h,seq_file.h,stacktrace.h,mm_types.h,spinlock.h,scatterlist.h,rbtree_types.h,rbtree.h,rbtree_augmented.h,interval_tree_generic.hlinuxkpi/include/asm/:barrier.h,processor.h,cpufeature.h,special_insns.h,smp.hlinuxkpi/lib/:rbtree.c,x86_cpu.cCONFIG_LKPI_STRUCT_PAGEoncestruct page/sg_tableexist, and adddrm_clflush_sgto bothcarried/drm_helpers/*.mapfile.Reviews
fetch-and-patchwith a relative output directory, and unlisted files;drm_cacheis now carried instead of handed off;65afae7:drm_cachetest now keeps slack before its buffer, because Linux flushesaddr + len - 1;Open issues
drm.kogaps and the dma-buf gaps are not provided anywhere yet (R5c's inventory, a facade follow-up, the i915 port).drm_clflush_sgwaits for R5c's page model.ttm_device_initon integrated GPUs needs the i915 port's TTM stubs.intel_graphics_stolen_res(x86 early quirks) is an R5c kernel symbol.Per the owner's rule of 2026-10-05, this is not to be merged until the stack is tested on the X230; the branch stays pushed for
graphics-dev.65afae7