[PATCH] Introduce Tyr
Boqun Feng
boqun.feng at gmail.com
Fri Jun 27 22:56:39 UTC 2025
On Fri, Jun 27, 2025 at 07:34:04PM -0300, Daniel Almeida wrote:
[...]
> +#[pin_data]
> +pub(crate) struct TyrData {
> + pub(crate) pdev: ARef<platform::Device>,
> +
> + #[pin]
> + clks: Mutex<Clocks>,
> +
> + #[pin]
> + regulators: Mutex<Regulators>,
> +
> + // Some inforation on the GPU. This is mainly queried by userspace (mesa).
> + pub(crate) gpu_info: GpuInfo,
> +}
> +
> +unsafe impl Send for TyrData {}
> +unsafe impl Sync for TyrData {}
I think you better just mark Clk (which is just a refcount to `struct
clk`) and Regulator `Send` and `Sync`?
Then `TyrData` will be `Send` and `Sync` automatically. And the total
number of `unsafe` in this patch goes down to 1.
Regards,
Boqun
> +
[...]
> +// This can be queried by userspace to get information about the GPU.
> +#[repr(C)]
> +pub(crate) struct GpuInfo {
> + pub(crate) gpu_id: u32,
> + pub(crate) csf_id: u32,
> + pub(crate) gpu_rev: u32,
> + pub(crate) core_features: u32,
> + pub(crate) l2_features: u32,
> + pub(crate) tiler_features: u32,
> + pub(crate) mem_features: u32,
> + pub(crate) mmu_features: u32,
> + pub(crate) thread_features: u32,
> + pub(crate) max_threads: u32,
> + pub(crate) thread_max_workgroup_size: u32,
> + pub(crate) thread_max_barrier_size: u32,
> + pub(crate) coherency_features: u32,
> + pub(crate) texture_features: [u32; 4],
> + pub(crate) as_present: u32,
> + pub(crate) shader_present: u64,
> + pub(crate) tiler_present: u64,
> + pub(crate) l2_present: u64,
> +}
> +
[...]
More information about the dri-devel
mailing list