Skip to content

Commit fcbd640

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 f8829b2 commit fcbd640

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
@@ -661,6 +661,14 @@ impl WorkQueue::ver {
661661
let gpu_buf = alloc.private.array_empty_tagged(0x2c18, b"GPBF")?;
662662
let mut state = alloc.shared.new_default::<RingState>()?;
663663
let ring = alloc.shared.array_empty(size as usize)?;
664+
let mut prio = *raw::PRIORITY.get(priority as usize).ok_or(EINVAL)?;
665+
666+
if pipe_type == PipeType::Compute && !debug_enabled(DebugFlags::Debug0) {
667+
// Hack to disable compute preemption until we fix it
668+
prio.0 = 0;
669+
prio.5 = 1;
670+
}
671+
664672
let inner = WorkQueueInner::ver {
665673
dev: dev.into(),
666674
event_manager,
@@ -693,7 +701,7 @@ impl WorkQueue::ver {
693701
gpu_rptr2: Default::default(),
694702
gpu_rptr3: Default::default(),
695703
event_id: AtomicI32::new(-1),
696-
priority: *raw::PRIORITY.get(priority as usize).ok_or(EINVAL)?,
704+
priority: prio,
697705
unk_4c: -1,
698706
uuid: id as u32,
699707
unk_54: -1,

0 commit comments

Comments
 (0)