Re: [PATCH 4/5] gpu: nova-core: use pointer projection for command queue code

Alexandre Courbot
2026-04-29T11:24:07Z

On Thu Apr 16, 2026 at 4:57 AM JST, Gary Guo wrote:
<snip>
> @@ -318,39 +331,40 @@ fn driver_write_area_size(&self) -> usize {
> /// As the message queue is a circular buffer, the region may be discontiguous in memory. In
> /// that case the second slice will have a non-zero length.
> fn driver_read_area(&self) -> (&[[u8; GSP_PAGE_SIZE]], &[[u8; GSP_PAGE_SIZE]]) {
> - let tx = self.gsp_write_ptr();
> - let rx = self.cpu_read_ptr();
> + let tx = num::u32_as_usize(self.gsp_write_ptr());
> + let rx = num::u32_as_usize(self.cpu_read_ptr());
>
> // Pointer to the first entry of the GSP message queue.
> - let data = ptr::project!(self.0.as_ptr(), .gspq.msgq.data[build: 0]);
> + let data = ptr::project!(self.0.as_ptr(), .gspq.msgq.data);
>
> - let (tail_end, wrap_end) = if rx <= tx {
> - // Read area is non-wrapping and stops right before `tx`.

I find these comments helpful since the logic is a bit convulated - can
we keep them, or at least have something in the same spirit?