Skip to content

Commit 3c4eddf

Browse files
hoshinolinajannau
authored andcommitted
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 e8bed77 commit 3c4eddf

3 files changed

Lines changed: 18 additions & 3 deletions

File tree

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
@@ -664,6 +664,14 @@ impl WorkQueue::ver {
664664
let gpu_buf = alloc.private.array_empty_tagged(0x2c18, b"GPBF")?;
665665
let mut state = alloc.shared.new_default::<RingState>()?;
666666
let ring = alloc.shared.array_empty(size as usize)?;
667+
let mut prio = *raw::PRIORITY.get(priority as usize).ok_or(EINVAL)?;
668+
669+
if pipe_type == PipeType::Compute && !debug_enabled(DebugFlags::Debug0) {
670+
// Hack to disable compute preemption until we fix it
671+
prio.0 = 0;
672+
prio.5 = 1;
673+
}
674+
667675
let inner = WorkQueueInner::ver {
668676
dev: dev.into(),
669677
event_manager,
@@ -696,7 +704,7 @@ impl WorkQueue::ver {
696704
gpu_rptr2: Default::default(),
697705
gpu_rptr3: Default::default(),
698706
event_id: AtomicI32::new(-1),
699-
priority: *raw::PRIORITY.get(priority as usize).ok_or(EINVAL)?,
707+
priority: prio,
700708
unk_4c: -1,
701709
uuid: id as u32,
702710
unk_54: -1,

0 commit comments

Comments
 (0)