Skip to content

Commit 1bbe2a3

Browse files
committed
drm/asahi: HACK: Disable compute preemption for now
Possibly because we don't have support in the helper program, this is broken and causes channel errors. Hack in high priority for now, which works around it. Use debug_flags 0x1000000000000 to re-enable for testing. Signed-off-by: Asahi Lina <lina@asahilina.net>
1 parent d025ffc commit 1bbe2a3

File tree

3 files changed

+18
-3
lines changed

3 files changed

+18
-3
lines changed

drivers/gpu/drm/asahi/fw/channels.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ impl TxChannelState for FwCtlChannelState {
113113
}
114114
}
115115

116-
#[derive(Debug, Copy, Clone, Default)]
116+
#[derive(Debug, Copy, Clone, Default, PartialEq, Eq)]
117117
#[repr(u32)]
118118
pub(crate) enum PipeType {
119119
#[default]

drivers/gpu/drm/asahi/fw/workqueue.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,14 @@ pub(crate) mod raw {
9898

9999
#[derive(Debug, Clone, Copy)]
100100
#[repr(C)]
101-
pub(crate) struct Priority(u32, u32, U64, u32, u32, u32);
101+
pub(crate) struct Priority(
102+
pub(crate) u32,
103+
pub(crate) u32,
104+
pub(crate) U64,
105+
pub(crate) u32,
106+
pub(crate) u32,
107+
pub(crate) u32,
108+
);
102109

103110
pub(crate) const PRIORITY: [Priority; 4] = [
104111
Priority(0, 0, U64(0xffff_ffff_ffff_0000), 1, 0, 1),

drivers/gpu/drm/asahi/workqueue.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -662,6 +662,14 @@ impl WorkQueue::ver {
662662
let gpu_buf = alloc.private.array_empty_tagged(0x2c18, b"GPBF")?;
663663
let mut state = alloc.shared.new_default::<RingState>()?;
664664
let ring = alloc.shared.array_empty(size as usize)?;
665+
let mut prio = *raw::PRIORITY.get(priority as usize).ok_or(EINVAL)?;
666+
667+
if pipe_type == PipeType::Compute && !debug_enabled(DebugFlags::Debug0) {
668+
// Hack to disable compute preemption until we fix it
669+
prio.0 = 0;
670+
prio.5 = 1;
671+
}
672+
665673
let inner = WorkQueueInner::ver {
666674
dev: dev.into(),
667675
event_manager,
@@ -694,7 +702,7 @@ impl WorkQueue::ver {
694702
gpu_rptr2: Default::default(),
695703
gpu_rptr3: Default::default(),
696704
event_id: AtomicI32::new(-1),
697-
priority: *raw::PRIORITY.get(priority as usize).ok_or(EINVAL)?,
705+
priority: prio,
698706
unk_4c: -1,
699707
uuid: id as u32,
700708
unk_54: -1,

0 commit comments

Comments
 (0)