diff --git a/drivers/gpu/drm/asahi/queue/compute.rs b/drivers/gpu/drm/asahi/queue/compute.rs index 1cd52f338d0583..4ca6fc9dc2d908 100644 --- a/drivers/gpu/drm/asahi/queue/compute.rs +++ b/drivers/gpu/drm/asahi/queue/compute.rs @@ -27,7 +27,7 @@ use kernel::user_ptr::UserSlicePtr; const DEBUG_CLASS: DebugFlags = DebugFlags::Compute; #[versions(AGX)] -impl super::Queue::ver { +impl super::QueueInner::ver { /// Submit work to a compute queue. pub(super) fn submit_compute( &self, diff --git a/drivers/gpu/drm/asahi/queue/mod.rs b/drivers/gpu/drm/asahi/queue/mod.rs index ffbacaee50a817..9d00a324f11d5a 100644 --- a/drivers/gpu/drm/asahi/queue/mod.rs +++ b/drivers/gpu/drm/asahi/queue/mod.rs @@ -98,16 +98,22 @@ pub(crate) struct Queue { _sched: sched::Scheduler, entity: sched::Entity, vm: mmu::Vm, - ualloc: Arc>, q_vtx: Option, q_frag: Option, q_comp: Option, + fence_ctx: FenceContexts, + inner: QueueInner::ver, +} + +#[versions(AGX)] +pub(crate) struct QueueInner { + dev: AsahiDevRef, + ualloc: Arc>, buffer: Option, gpu_context: Arc, notifier_list: Arc>, notifier: Arc>, id: u64, - fence_ctx: FenceContexts, #[ver(V >= V13_0B4)] counter: AtomicU64, } @@ -427,22 +433,26 @@ impl Queue::ver { _sched: sched, entity, vm, - ualloc, q_vtx: None, q_frag: None, q_comp: None, - gpu_context: Arc::try_new(workqueue::GpuContext::new( - dev, - alloc, - buffer.as_ref().map(|b| b.any_ref()), - )?)?, - buffer, - notifier_list: Arc::try_new(notifier_list)?, - notifier, - id, fence_ctx: FenceContexts::new(1, QUEUE_NAME, QUEUE_CLASS_KEY)?, - #[ver(V >= V13_0B4)] - counter: AtomicU64::new(0), + inner: QueueInner::ver { + dev: dev.into(), + ualloc, + gpu_context: Arc::try_new(workqueue::GpuContext::new( + dev, + alloc, + buffer.as_ref().map(|b| b.any_ref()), + )?)?, + + buffer, + notifier_list: Arc::try_new(notifier_list)?, + notifier, + id, + #[ver(V >= V13_0B4)] + counter: AtomicU64::new(0), + }, }; // Rendering structures @@ -452,15 +462,19 @@ impl Queue::ver { *crate::initial_tvb_size.read(&lock) }; - ret.buffer.as_ref().unwrap().ensure_blocks(tvb_blocks)?; + ret.inner + .buffer + .as_ref() + .unwrap() + .ensure_blocks(tvb_blocks)?; ret.q_vtx = Some(SubQueue::ver { wq: workqueue::WorkQueue::ver::new( dev, alloc, event_manager.clone(), - ret.gpu_context.clone(), - ret.notifier_list.clone(), + ret.inner.gpu_context.clone(), + ret.inner.notifier_list.clone(), channel::PipeType::Vertex, id, priority, @@ -480,8 +494,8 @@ impl Queue::ver { dev, alloc, event_manager.clone(), - ret.gpu_context.clone(), - ret.notifier_list.clone(), + ret.inner.gpu_context.clone(), + ret.inner.notifier_list.clone(), channel::PipeType::Fragment, id, priority, @@ -497,8 +511,8 @@ impl Queue::ver { dev, alloc, event_manager, - ret.gpu_context.clone(), - ret.notifier_list.clone(), + ret.inner.gpu_context.clone(), + ret.inner.notifier_list.clone(), channel::PipeType::Compute, id, priority, @@ -727,7 +741,7 @@ impl Queue for Queue::ver { match cmd.cmd_type { uapi::drm_asahi_cmd_type_DRM_ASAHI_CMD_RENDER => { - self.submit_render( + self.inner.submit_render( &mut job, &cmd, result_writer, @@ -745,7 +759,7 @@ impl Queue for Queue::ver { ))?; } uapi::drm_asahi_cmd_type_DRM_ASAHI_CMD_COMPUTE => { - self.submit_compute( + self.inner.submit_compute( &mut job, &cmd, result_writer, @@ -792,6 +806,6 @@ impl Queue for Queue::ver { #[versions(AGX)] impl Drop for Queue::ver { fn drop(&mut self) { - mod_dev_dbg!(self.dev, "[Queue {}] Dropping queue\n", self.id); + mod_dev_dbg!(self.dev, "[Queue {}] Dropping queue\n", self.inner.id); } } diff --git a/drivers/gpu/drm/asahi/queue/render.rs b/drivers/gpu/drm/asahi/queue/render.rs index 4dee12c72c747e..62cb259f15bdc6 100644 --- a/drivers/gpu/drm/asahi/queue/render.rs +++ b/drivers/gpu/drm/asahi/queue/render.rs @@ -68,7 +68,7 @@ impl RenderResult { } #[versions(AGX)] -impl super::Queue::ver { +impl super::QueueInner::ver { /// Get the appropriate tiling parameters for a given userspace command buffer. fn get_tiling_params( cmdbuf: &uapi::drm_asahi_cmd_render,