Re: [PATCH 7/9] drm/tyr: refactor new_dummy_object to use new_object

From: Daniel Almeida

Date: Thu Sep 03 2026 - 18:22:39 EST




> On 1 Sep 2026, at 13:09, Ke Sun via B4 Relay <devnull+sunke.kylinos.cn@xxxxxxxxxx> wrote:
>
> From: Alvin Sun <alvin.sun@xxxxxxxxx>
>
> new_dummy_object() duplicated the BO creation code that new_object()
> now provides; call new_object() instead.
>
> Signed-off-by: Alvin Sun <alvin.sun@xxxxxxxxx>
> ---
> drivers/gpu/drm/tyr/gem.rs | 13 ++-----------
> 1 file changed, 2 insertions(+), 11 deletions(-)
>
> diff --git a/drivers/gpu/drm/tyr/gem.rs b/drivers/gpu/drm/tyr/gem.rs
> index be1affe80db1a..d9ddcb287f52b 100644
> --- a/drivers/gpu/drm/tyr/gem.rs
> +++ b/drivers/gpu/drm/tyr/gem.rs
> @@ -82,17 +82,8 @@ pub(crate) fn lookup_handle(file: &TyrDrmFile, handle: u32) -> Result<ARef<Bo>>
>
> /// Creates a dummy GEM object to serve as the root of a GPUVM.
> pub(crate) fn new_dummy_object(ddev: &TyrDrmDevice) -> Result<ARef<Bo>> {
> - let bo = Bo::new(
> - ddev,
> - 4096,
> - shmem::ObjectConfig {
> - map_wc: true,
> - parent_resv_obj: None,
> - },
> - BoCreateArgs { flags: 0 },
> - )?;
> -
> - Ok(bo)
> + // FIXME: use a Rust resv-object abstraction once available, rather than a real BO.
> + new_object(ddev, 4096, 0)

For the same reason as the previous patch, I think this needs to be PAGE_SIZE too.

Feel free to work on the FIXME itself separately, if you want.

> }
>
> /// Specifies how to choose a GPU virtual address for a [`KernelBo`].
>
> --
> 2.43.0
>
>
>

With the change above,

Reviewed-by: Daniel Almeida <daniel.almeida@xxxxxxxxxxxxx>