Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
85 commits
Select commit Hold shift + click to select a range
ee69dab
drm/asahi: prepare extended firmware queues and controller handoff
satchlj Oct 31, 2026
c5e1b35
drm/asahi: dispatch G15 compute through extended T8122 firmware
satchlj Oct 31, 2026
ec30b22
drm/asahi: enable J613 extended firmware render and retirement
satchlj Oct 31, 2026
efcd402
drm/asahi: admit authorized HIGH queues on Extended T8122
satchlj Nov 3, 2026
c1c0e23
drm/asahi: test the M3 host priority mapping alongside admission
satchlj Nov 3, 2026
ba872b9
ci: register the M3 queue priority admission tests
satchlj Nov 4, 2026
bd92c01
drm/asahi: back off interrupt-assisted M3 completion waits
satchlj Nov 3, 2026
9f3b310
drm/asahi: omit no-op M3 module pins without unload support
satchlj Nov 3, 2026
8f8374b
Merge branch 'satchlj/t8122-api-fixes-20261104' into satchlj/port-347…
satchlj Nov 5, 2026
40c0f57
selftests: asahi: match the 7.3 capability argument type
satchlj Nov 5, 2026
841394c
Merge branch 'satchlj/port-346-20261104' into satchlj/port-347-20261104
satchlj Nov 5, 2026
2284c4e
Merge branch 'satchlj/t8122-api-fixes-20261104' into satchlj/port-305…
satchlj Nov 5, 2026
c3910f7
Merge branch 'satchlj/t8122-api-fixes-20261104' into satchlj/port-306…
satchlj Nov 5, 2026
a64da66
Merge branch 'satchlj/t8122-api-fixes-20261104' into satchlj/port-307…
satchlj Nov 5, 2026
3822ecc
Merge branch 'satchlj/t8122-api-fixes-20261104' into satchlj/port-346…
satchlj Nov 5, 2026
82aaf1b
Merge branch 'satchlj/t8122-api-fixes-20261104' into satchlj/port-347…
satchlj Nov 5, 2026
167dcfe
Merge branch 'satchlj/t8122-api-fixes-20261104' into satchlj/port-305…
satchlj Nov 5, 2026
4425ded
Merge branch 'satchlj/t8122-api-fixes-20261104' into satchlj/port-306…
satchlj Nov 5, 2026
8363fbb
Merge branch 'satchlj/t8122-api-fixes-20261104' into satchlj/port-307…
satchlj Nov 5, 2026
ae10e3b
Merge branch 'satchlj/t8122-api-fixes-20261104' into satchlj/port-346…
satchlj Nov 5, 2026
a3cf48e
Merge branch 'satchlj/t8122-api-fixes-20261104' into satchlj/port-347…
satchlj Nov 5, 2026
9130710
Merge branch 'satchlj/t8122-api-fixes-20261104' into satchlj/port-305…
satchlj Nov 5, 2026
2cbb206
Merge branch 'satchlj/t8122-api-fixes-20261104' into satchlj/port-306…
satchlj Nov 5, 2026
7879118
Merge branch 'satchlj/t8122-api-fixes-20261104' into satchlj/port-307…
satchlj Nov 5, 2026
79d45bd
Merge branch 'satchlj/t8122-api-fixes-20261104' into satchlj/port-346…
satchlj Nov 5, 2026
d7be34e
Merge branch 'satchlj/t8122-api-fixes-20261104' into satchlj/port-347…
satchlj Nov 5, 2026
d5fcae0
Merge branch 'satchlj/port-304-20261104' into satchlj/port-305-20261104
satchlj Nov 5, 2026
e71fbb0
Merge branch 'satchlj/port-305-20261104' into satchlj/port-306-20261104
satchlj Nov 5, 2026
72b6142
Merge branch 'satchlj/port-306-20261104' into satchlj/port-307-20261104
satchlj Nov 5, 2026
66eb34e
Merge branch 'satchlj/port-307-20261104' into satchlj/port-346-20261104
satchlj Nov 5, 2026
03692e5
Merge branch 'satchlj/port-346-20261104' into satchlj/port-347-20261104
satchlj Nov 5, 2026
05524e2
Merge branch 'satchlj/t8122-api-fixes-20261104' into satchlj/port-305…
satchlj Nov 5, 2026
a0d0a49
Merge branch 'satchlj/t8122-api-fixes-20261104' into satchlj/port-306…
satchlj Nov 5, 2026
34de4e4
Merge branch 'satchlj/t8122-api-fixes-20261104' into satchlj/port-307…
satchlj Nov 5, 2026
119f1ea
Merge branch 'satchlj/t8122-api-fixes-20261104' into satchlj/port-346…
satchlj Nov 5, 2026
020e3f8
Merge branch 'satchlj/t8122-api-fixes-20261104' into satchlj/port-347…
satchlj Nov 5, 2026
44442b3
Merge branch 'satchlj/t8122-api-fixes-20261104' into satchlj/port-305…
satchlj Nov 5, 2026
032486e
Merge branch 'satchlj/t8122-api-fixes-20261104' into satchlj/port-306…
satchlj Nov 5, 2026
2436856
Merge branch 'satchlj/t8122-api-fixes-20261104' into satchlj/port-307…
satchlj Nov 5, 2026
49a678e
Merge branch 'satchlj/t8122-api-fixes-20261104' into satchlj/port-346…
satchlj Nov 5, 2026
523b9eb
Merge branch 'satchlj/t8122-api-fixes-20261104' into satchlj/port-347…
satchlj Nov 5, 2026
610a513
Merge branch 'satchlj/port-304-20261104' into satchlj/port-305-20261104
satchlj Nov 5, 2026
ea7c050
Merge branch 'satchlj/port-305-20261104' into satchlj/port-306-20261104
satchlj Nov 5, 2026
ef875a1
Merge branch 'satchlj/port-306-20261104' into satchlj/port-307-20261104
satchlj Nov 5, 2026
44c5989
Merge branch 'satchlj/port-307-20261104' into satchlj/port-346-20261104
satchlj Nov 5, 2026
c89fd6e
Merge branch 'satchlj/port-346-20261104' into satchlj/port-347-20261104
satchlj Nov 5, 2026
fc87ce0
Merge branch 'satchlj/t8122-api-fixes-20261104' into satchlj/port-305…
satchlj Nov 5, 2026
f163501
Merge branch 'satchlj/t8122-api-fixes-20261104' into satchlj/port-306…
satchlj Nov 5, 2026
57d2141
Merge branch 'satchlj/t8122-api-fixes-20261104' into satchlj/port-307…
satchlj Nov 5, 2026
9a28266
Merge branch 'satchlj/t8122-api-fixes-20261104' into satchlj/port-346…
satchlj Nov 5, 2026
d798e55
Merge branch 'satchlj/t8122-api-fixes-20261104' into satchlj/port-347…
satchlj Nov 5, 2026
07c5d35
Merge branch 'satchlj/port-304-20261104' into satchlj/port-305-20261104
satchlj Nov 5, 2026
b17b5ec
Merge branch 'satchlj/port-305-20261104' into satchlj/port-306-20261104
satchlj Nov 5, 2026
ea85d43
Merge branch 'satchlj/port-306-20261104' into satchlj/port-307-20261104
satchlj Nov 5, 2026
33dcc77
Merge branch 'satchlj/port-307-20261104' into satchlj/port-346-20261104
satchlj Nov 5, 2026
1ac0d6b
Merge branch 'satchlj/port-346-20261104' into satchlj/port-347-20261104
satchlj Nov 5, 2026
ae91e26
Merge commit '33313096c66f4afdff4ef7060d20fe9bedebc34c' into satchlj/…
satchlj Nov 5, 2026
368d1dc
Merge commit '33313096c66f4afdff4ef7060d20fe9bedebc34c' into satchlj/…
satchlj Nov 5, 2026
076b28b
Merge commit '33313096c66f4afdff4ef7060d20fe9bedebc34c' into satchlj/…
satchlj Nov 5, 2026
c34bce8
Merge commit '33313096c66f4afdff4ef7060d20fe9bedebc34c' into satchlj/…
satchlj Nov 5, 2026
bbf8435
Merge commit '33313096c66f4afdff4ef7060d20fe9bedebc34c' into satchlj/…
satchlj Nov 5, 2026
f13e806
Merge branch 'satchlj/port-304-20261104' into satchlj/port-305-20261104
satchlj Nov 5, 2026
0a7d334
Merge branch 'satchlj/port-305-20261104' into satchlj/port-306-20261104
satchlj Nov 5, 2026
0d31784
Merge branch 'satchlj/port-306-20261104' into satchlj/port-307-20261104
satchlj Nov 5, 2026
f1e8a99
Merge branch 'satchlj/port-307-20261104' into satchlj/port-346-20261104
satchlj Nov 5, 2026
b73d1f9
Merge branch 'satchlj/port-346-20261104' into satchlj/port-347-20261104
satchlj Nov 5, 2026
1d520b6
Merge commit 'b50066848322c6799c1433ee3a358aab2e9faabb' into satchlj/…
satchlj Nov 5, 2026
8d07b11
Merge commit 'b50066848322c6799c1433ee3a358aab2e9faabb' into satchlj/…
satchlj Nov 5, 2026
c81410e
Merge commit 'b50066848322c6799c1433ee3a358aab2e9faabb' into satchlj/…
satchlj Nov 5, 2026
cd9eac9
Merge commit 'b50066848322c6799c1433ee3a358aab2e9faabb' into satchlj/…
satchlj Nov 5, 2026
1f5c951
Merge commit 'b50066848322c6799c1433ee3a358aab2e9faabb' into satchlj/…
satchlj Nov 5, 2026
b166d93
Merge branch 'satchlj/port-304-20261104' into satchlj/port-305-20261104
satchlj Nov 5, 2026
58c89f5
Merge branch 'satchlj/port-305-20261104' into satchlj/port-306-20261104
satchlj Nov 5, 2026
9b2e8cf
Merge branch 'satchlj/port-306-20261104' into satchlj/port-307-20261104
satchlj Nov 5, 2026
e7936d8
Merge branch 'satchlj/port-307-20261104' into satchlj/port-346-20261104
satchlj Nov 5, 2026
7b88ebb
Merge branch 'satchlj/port-346-20261104' into satchlj/port-347-20261104
satchlj Nov 5, 2026
25afe62
Merge satchlj/port-304-20261104 into satchlj/port-305-20261104
DjDeveloperr Nov 7, 2026
bb25219
Merge satchlj/port-305-20261104 into satchlj/port-306-20261104
DjDeveloperr Nov 7, 2026
cc7dc16
Merge satchlj/port-306-20261104 into satchlj/port-307-20261104
DjDeveloperr Nov 7, 2026
b3a9f65
Merge satchlj/port-307-20261104 into satchlj/port-346-20261104
DjDeveloperr Nov 7, 2026
25f9051
Merge satchlj/port-346-20261104 into satchlj/port-347-20261104
DjDeveloperr Nov 7, 2026
9840daa
Merge pull request #977 from aurora-silicon/satchlj/port-347-20261104
RyanTheTide Nov 10, 2026
27d860d
Merge pull request #976 from aurora-silicon/satchlj/port-346-20261104
RyanTheTide Nov 10, 2026
fe20293
Merge pull request #969 from aurora-silicon/satchlj/port-307-20261104
RyanTheTide Nov 10, 2026
f8002c6
Merge pull request #968 from aurora-silicon/satchlj/port-306-20261104
RyanTheTide Nov 10, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions drivers/gpu/drm/asahi/file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1350,9 +1350,15 @@ impl File {
cls_pr_debug!(Errors, "queue_create: Invalid priority\n");
return Err(EINVAL);
}
// HIGH has only been run on G17; G13 and G14 keep refusing it.
// Keep support tied to a backend and admitted profile. G13/G14 and
// unqualified M3 profiles retain their previous rejection.
let high_supported = reg_data.gpu.as_any().is::<crate::g17::Gpu>();
#[cfg(CONFIG_DRM_ASAHI_M3_T8122)]
let high_supported = high_supported || reg_data.gpu.as_any()
.downcast_ref::<crate::m3::m3_drm::Backend>()
.is_some_and(|gpu| gpu.supports_high_priority());
if data.priority == uapi::drm_asahi_priority_DRM_ASAHI_PRIORITY_HIGH
&& !reg_data.gpu.as_any().is::<crate::g17::Gpu>()
&& !high_supported
{
cls_pr_debug!(
Errors,
Expand Down
57 changes: 55 additions & 2 deletions drivers/gpu/drm/asahi/m3/m3_adt_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,14 @@ impl PstatePolicy {

/// The runtime backend's InitData contents: the generated object images and the
/// performance-state policy.
pub(crate) struct ExtendedInputs {
pub(crate) power: hw::PwrConfig,
pub(crate) sram_uv: KVec<u32>,
pub(crate) bases: super::m3_mmio_26::RegisterBases,
}

pub(crate) struct Contents {
pub(crate) extended: Option<ExtendedInputs>,
/// Generated images, per owner; None for owners that stay zero. Only the three image
/// owners' images are uploaded; the records' are checked.
images: KVec<Option<KVVec<u8>>>,
Expand Down Expand Up @@ -304,6 +311,10 @@ impl Contents {
experiment: Option<&Experiment>,
) -> Result<Self> {
let dev = pdev.as_ref();
if firmware.profile() == super::m3_profile::Profile::Extended {
if experiment.is_some() { return Err(EINVAL); }
return Self::extended(dev, soc);
}
let param = m3_params::initdata_param();
check_version(dev, firmware, experiment)?;
let iomaps = match experiment {
Expand Down Expand Up @@ -370,12 +381,54 @@ impl Contents {
);
let read_only_slots = experiment.map(|e| e.read_only_slots()).unwrap_or(0);
let hwdata_object = soc.hwdata_object;
Ok(Contents { images, pstates, iomaps, table, read_only_slots, hwdata_object })
Ok(Contents { extended: None, images, pstates, iomaps, table, read_only_slots, hwdata_object })
}

fn extended(dev: &device::Device, soc: &Soc) -> Result<Self> {
let cfg = soc.hwcfg.ok_or(ENODEV)?;
if soc.chip_id != 0x8122 || cfg.chip_id != 0x8122 { return Err(ENODEV); }
let power = hw::PwrConfig::load(dev, cfg)?;
let tables = initdata::PStateTables::new(&power, true, None, false)?;
if tables.len != 9 || tables.max != 8 || tables.max_frequency_khz(&power) != 1_338_000 {
return Err(EINVAL);
}
let node = dev.of_node().ok_or(ENODEV)?;
let opps = node.parse_phandle(c_str!("operating-points-v2"), 0).ok_or(EINVAL)?;
let mut sram_uv = KVec::new();
for opp in opps.children() {
let values: KVec<u32> = opp.get_property(c_str!("opp-microvolt-sram"))?;
if values.len() != 1 { return Err(EINVAL); }
sram_uv.push(values[0], GFP_KERNEL)?;
}
if sram_uv.len() != power.perf_states.len() { return Err(EINVAL); }
let block = |index: usize| -> Result<u64> {
Ok(cfg.io_mappings.get(index).and_then(|value| value.as_ref()).ok_or(EINVAL)?.base as u64)
};
let bases = super::m3_mmio_26::RegisterBases {
gpu: soc.windows.sgx, interrupt: block(2)?,
memory: block(11)?.checked_add(0x1c4000).ok_or(EOVERFLOW)?,
telemetry_write: block(18)?, telemetry_read: block(19)?,
neural: block(25)?, metrology: block(26)?,
};
let mut freqs = [0; 16];
for (index, value) in freqs.iter_mut().enumerate().take(tables.len) {
*value = tables.primary_state(&power, index).freq_hz / 1_000_000;
}
// This profile enables the native firmware's thermal/PID controllers.
// The legacy host-only thermal governor must not replace those inputs.
let pstates = PstatePolicy { table_max: 8, table_max_mhz: 1338,
max: 8, safe: 8, boot: 1, max_mhz: 1338, safe_mhz: 1338,
boot_mhz: freqs[1], freqs, thermal: ThermalMode::Off };
let mut images = KVec::new();
for _ in 0..super::m3_init_26::COUNT { images.push(None, GFP_KERNEL)?; }
Ok(Self { extended: Some(ExtendedInputs { power, sram_uv, bases }),
images, pstates, iomaps: &[], table: (8, 1338), read_only_slots: 0, hwdata_object: None })
}

/// Check the contents before they are uploaded.
pub(crate) fn check_for_upload(&self) -> Result {
if self.images.len() == storage::COUNT {
let count = if self.extended.is_some() { super::m3_init_26::COUNT } else { storage::COUNT };
if self.images.len() == count {
Ok(())
} else {
Err(EINVAL)
Expand Down
2 changes: 1 addition & 1 deletion drivers/gpu/drm/asahi/m3/m3_board.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use crate::m3::m3_resources::{
use crate::m3::m3_soc::Soc;

/// Whether the root node's compatible list contains `compatible`.
fn board_is(compatible: &[u8]) -> bool {
pub(crate) fn board_is(compatible: &[u8]) -> bool {
let Some(root) = kernel::of::root() else {
return false;
};
Expand Down
26 changes: 11 additions & 15 deletions drivers/gpu/drm/asahi/m3/m3_completion.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,9 @@ impl WorkItem for Completion {
type Pointer = Arc<Self>;
fn run(owner: Arc<Self>) {
use crate::m3::m3_runtime::Service;
// Snapshots after a notification before sleeping for the next one: the completion
// stamps can trail the firmware's event message.
const TRAILING_POLLS: u32 = 4;
let (mut trailing, mut waited_at) = (0, u64::MAX);
// No deliberate spin: fsleep(5) selects udelay, not a scheduler sleep.
// Check immediately on IRQ, with backoff for trailing coherent witnesses.
let mut policy = super::m3_completion_policy::WaitPolicy::new();
loop {
let (outcome, events) = {
let mut guard = owner.shared.lock();
Expand All @@ -37,23 +36,20 @@ impl WorkItem for Completion {
// Preserve the root-only CPU-overlap diagnostic: disabled waits retain
// the runtime lock so VM/timestamp preparation cannot overlap the GPU.
if let Service::Waiting(messages)=outcome {
if !events.cpu_overlap() {events.wait_past(messages);continue;}
if !events.cpu_overlap() {
events.wait_past(messages, policy.next_wait_us(events.wait_ceiling_us()));
continue;
}
}
(outcome,events)
};
match outcome {
Service::Idle => break,
Service::Progress => { trailing = 0; waited_at = u64::MAX; }
Service::Progress => policy.progress(),
Service::Waiting(messages) => {
if messages != waited_at { waited_at = messages; trailing = 0; }
if trailing < TRAILING_POLLS {
trailing += 1;
kernel::time::delay::fsleep(kernel::time::Delta::from_micros(5));
} else {
// Until the next firmware event, or a bounded 100 us resnapshot.
events.wait_past(messages);
trailing = 0;
}
// IRQs and timer expiry alone are not retirement progress.
// Keep backing off until service publishes or retires work.
events.wait_past(messages, policy.next_wait_us(events.wait_ceiling_us()));
}
}
}
Expand Down
77 changes: 77 additions & 0 deletions drivers/gpu/drm/asahi/m3/m3_completion_policy.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
// SPDX-License-Identifier: GPL-2.0-only OR MIT

//! Bounded fallback for witnesses which can become visible after the last IRQ.
//!
//! Notifications request a fresh snapshot, but do not prove witness progress.
//! Only publication or retirement resets this policy. In particular, neither a
//! timer wake nor a stream of early firmware notifications renews a spin budget.

pub(crate) struct WaitPolicy {
next_us: u64,
}

impl WaitPolicy {
pub(crate) const fn new() -> Self {
Self { next_us: 25 }
}

pub(crate) fn progress(&mut self) {
self.next_us = 25;
}

/// No deliberate busy delay: IRQs still wake each sleep immediately.
/// The caller supplies the root-selected ceiling (25..=1000 us).
pub(crate) fn next_wait_us(&mut self, ceiling_us: u64) -> u64 {
let wait = self.next_us.min(ceiling_us.clamp(25, 1000));
self.next_us = (wait * 2).min(1000);
wait
}
}

#[cfg_attr(not(test), kernel::macros::kunit_tests(asahi_m3_completion_policy))]
mod tests {
use super::WaitPolicy;

#[test]
fn no_progress_backs_off_and_stays_bounded() {
let mut policy = WaitPolicy::new();
for expected in [25, 50, 100, 200, 400, 800, 1000, 1000] {
assert_eq!(policy.next_wait_us(1000), expected);
}
for _ in 0..100_000 {
assert_eq!(policy.next_wait_us(1000), 1000);
}
}

#[test]
fn publication_or_retirement_restarts_fast_detection() {
let mut policy = WaitPolicy::new();
for _ in 0..8 { policy.next_wait_us(1000); }
policy.progress();
assert_eq!(policy.next_wait_us(1000), 25);
assert_eq!(policy.next_wait_us(1000), 50);
}

#[test]
fn live_ceiling_changes_apply_to_the_next_wait() {
let mut policy = WaitPolicy::new();
for _ in 0..8 { policy.next_wait_us(1000); }
assert_eq!(policy.next_wait_us(25), 25);
assert_eq!(policy.next_wait_us(1000), 50);
assert_eq!(policy.next_wait_us(100), 100);
assert_eq!(policy.next_wait_us(100), 100);
}

#[test]
fn fallback_keeps_timeout_checks_frequent_without_any_irq() {
let mut policy = WaitPolicy::new();
let mut elapsed_us = 0;
while elapsed_us < 2_000_000 {
let wait = policy.next_wait_us(1000);
assert!(wait <= 1000);
elapsed_us += wait;
}
// This bounds the requested delay, not scheduler dispatch latency.
assert!(elapsed_us < 2_001_000);
}
}
Loading