Commit Graph

11 Commits

  • refactor: drop the sheng- prefix from boot arguments
    Every boot argument loses its sheng- prefix (sheng-touch=4 is now
    touch=4). No XNU or Apple kext boot argument of iPadOS 27 or macOS 27.3
    uses any of the new names.
  • feat(gpu): CP preemption between two rings (A1)
    Add hardware CP context switch via CP_CONTEXT_SWITCH_CNTL on a second
    ring. Use a conservative BO-disjoint rule: only allow a queued job to
    preempt the running ring when their buffer sets share no handle. Two
    4192 KiB preemption records and two a7xx_cp_smmu_info pages are mapped
    at fixed IOVAs. Ring priority comes from the kernel GPU role of the
    submitting task (BACKGROUND/UTILITY → ring 1, UI/focal/realtime → ring 0).
    Diagnostics gated on sheng-diag=1; feature gated on sheng-gpu-preempt=1.
  • fix(adreno): the timeline stamps are on unless sheng-gpu-timeline=0
    The run with the default read the boot argument as off (ring status 5: no stamps); only a given value of 0 turns the stamps off now.
  • feat(adreno): job timeline, stall ring and CP counter stamps
    Framed submissions stamp the CP always-on counter before and after their buffers (sheng-gpu-timeline, default on); the retired jobs, the stall handler's actions and a ring status word are kept for the boot export. Drops the large-import record. Host tests cover the stamps and the shim symbols.
  • perf(memory): user BOs from system memory, no fixed BO pool
    User BOs are pageable IOBufferMemoryDescriptors with no task and no
    kernel mapping, wired by prepare(), as Metal resources are system
    memory. The VM zero-fills them and sets the write-combined attribute in
    one batch while wiring, and restores it when the object is reaped.
    Client views map the descriptor itself, so no device-pager view resets
    the page attribute and submissions no longer re-assert it.
    
    The 1536 MiB boot-time pool is gone. In untagged-ed1611b1 it filled
    with the runtime's blocks, 404 BOs fell back to scattered kernel memory,
    96 allocations of 96 MiB failed and the pressure flag stayed set.
    Memory pressure is now reported when the system refuses a BO.
    Imports are proven exclusive through a page bitmap of the driver's own
    BOs instead of a pairwise span check.
  • 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.
  • fix(ring): write WPTR as a fenced register and keep the ring's register window alive
    The ring kept a pointer to a register window on the stack of the service's
    start routine. The window is a service member now. WPTR writes check the
    GMU AHB fence status and are given again while it reports the write
    dropped.
  • fix(service): default the BO pool to 1536 MiB
    At 384 MiB large BOs fell back to scattered pages; 1536 MiB had none
    and peaked at 782 MiB in use.
  • fix(vm): read fewer SMMU registers per map, unmap and submission
    Owned routes are observed in full every 64th table operation only, and
    the TLBIALL before a submission skips the image observation once a
    table update has recorded the bank offset.
  • Import NativeAdreno
    Co-authored-by: rpone <rponeawa@qq.com>