Commit Graph

5 Commits

  • feat(memory): treat memory the kernel adopted outside its range as kernel memory
    A kernel may manage DRAM below its own physical range (a second bank it
    adopts as VM memory). Cache maintenance, the write-combined attribute,
    the sampled readers and the owned-page bitmap now ask the pmap whether a
    page is managed instead of comparing against gPhysBase and gPhysSize, so
    a buffer object with such pages is maintained like any other. The first
    failed kernel allocation is recorded (where, status, size, address bits,
    contiguous), and each CPU records the pool run it is zero-filling.
    
    Run on hardware: the GPU starts and runs with 458 MiB of adopted memory.
  • fix(pool): map a pool run only while it is zero-filled
    Registering the pool mapped every range whole, write-combined, into the
    kernel map before the GPU's own windows were mapped, and on sheng the
    GPU then did not power up (GMU start stalled, no SMMU window). The
    kernel keeps no mapping of a range now: the value the allocator carries
    for a range is its physical address, and each scrub maps just the run
    it fills for the call.
    
    Host tests pass; not yet run on hardware.
  • feat(memory): take write-combined system BOs from a pool of DRAM outside the kernel's
    The board registers free DRAM the kernel does not manage with native_adreno_pool_add. A write-combined system BO first asks the pool (NativeAdrenoPool.cpp: a bitmap a range, best single run, else the longest runs first, zero fill through the range's own write-combined kernel mapping before a grant is handed out); whatever the pool does not serve takes the descriptor path unchanged. A pool BO has a grant and no descriptor: its spans are the grant's runs, nothing of it is cleaned, audited or read through the cacheable aperture, its client view maps its physical runs write-combined and holds the grant until IOKit frees the view, and an import of pool pages is refused. Pages a client had a view of are retired unless gpu-pool=2; gpu-pool=0 turns the pool off. Counters: native_adreno_pool_state, native_adreno_pool_fallbacks, native_adreno_pool_zero.
    
    Host tests: test_pool (allocator against a page model) and test_pool_memory (BO paths); the existing 23 pass as before, test_client and test_gmuconfig fail as at the base. Every changed kernel source passes the kernel's compile recipe as a syntax check. Not built into an image and not run on hardware.
  • perf(adreno): count cache maintenance per phase and skip uncached imports
    Phase counters for the pool, allocate, map, submit, unmap, complete and table passes. Imports the owner maps uncached need no maintenance. Process page tables come from cacheable blocks with the walk coherence proved at board start, so a table page is ordered instead of cleaned. A freed BO whose first pages a user task still maps is counted. Submit records, handle index and user client changes of the iPadOS 27 bring-up are included.
  • Import NativeAdreno
    Co-authored-by: rpone <rponeawa@qq.com>