intel: implement CS submit — Mesa winsys integration (Phase 4 complete)
Implement redox_private_cs_submit() in the Intel GpuDriver, completing Phase 4 (Render Path). This is the userspace GPU command submission interface used by Mesa. - redox_private_cs_submit(): map source GEM buffer to GPU address, extract batch commands as u32 slice from src_offset with byte_count dwords, submit to render ring via ring.submit_batch() - Returns RedoxPrivateCsSubmitResult with seqno (0 for now — fence integration deferred) This completes all 4 modules of Phase 4: batch.rs ✅ fence.rs ✅ execlists.rs ✅ Mesa winsys ✅ Remaining across all phases: Phase 2: DBUF detailed programming Phase 3: Atomic modesetting (requires scheme.rs changes)
This commit is contained in:
@@ -32,7 +32,7 @@ use redox_driver_sys::memory::MmioRegion;
|
||||
use redox_driver_sys::pci::{PciBarInfo, PciDevice, PciDeviceInfo};
|
||||
use redox_driver_sys::quirks::PciQuirkFlags;
|
||||
|
||||
use crate::driver::{DriverError, DriverEvent, GpuDriver, Result};
|
||||
use crate::driver::{DriverError, DriverEvent, GpuDriver, Result, RedoxPrivateCsSubmit, RedoxPrivateCsSubmitResult};
|
||||
use crate::drivers::interrupt::InterruptHandle;
|
||||
use crate::gem::{GemHandle, GemManager};
|
||||
use crate::kms::connector::{synthetic_edid, Connector};
|
||||
@@ -758,6 +758,23 @@ impl GpuDriver for IntelDriver {
|
||||
|
||||
self.process_irq()
|
||||
}
|
||||
|
||||
fn redox_private_cs_submit(
|
||||
&self,
|
||||
submit: &RedoxPrivateCsSubmit,
|
||||
) -> Result<RedoxPrivateCsSubmitResult> {
|
||||
let src_addr = self.ensure_gem_gpu_mapping(submit.src_handle)?;
|
||||
|
||||
let cmds_ptr = (src_addr + submit.src_offset) as *const u32;
|
||||
let dword_count = (submit.byte_count / 4) as usize;
|
||||
let cmds = unsafe { std::slice::from_raw_parts(cmds_ptr, dword_count) };
|
||||
|
||||
let mut ring = self.ring.lock()
|
||||
.map_err(|_| DriverError::Initialization("Intel ring state poisoned".into()))?;
|
||||
ring.submit_batch(cmds)?;
|
||||
|
||||
Ok(RedoxPrivateCsSubmitResult { seqno: 0 })
|
||||
}
|
||||
}
|
||||
|
||||
fn detect_display_topology(display: &IntelDisplay, edid_source: Option<&[DpAux]>) -> Result<(Vec<Connector>, Vec<Encoder>)> {
|
||||
|
||||
Reference in New Issue
Block a user