[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <2f3394a5-0c63-49bf-bc85-f43388050ab8@collabora.com>
Date: Wed, 29 Jan 2025 17:39:51 +0300
From: Dmitry Osipenko <dmitry.osipenko@...labora.com>
To: fnkl.kernel@...il.com, David Airlie <airlied@...hat.com>,
Gerd Hoffmann <kraxel@...hat.com>,
Gurchetan Singh <gurchetansingh@...omium.org>, Chia-I Wu
<olvaffe@...il.com>, Maarten Lankhorst <maarten.lankhorst@...ux.intel.com>,
Maxime Ripard <mripard@...nel.org>, Thomas Zimmermann <tzimmermann@...e.de>,
Simona Vetter <simona@...ll.ch>
Cc: dri-devel@...ts.freedesktop.org, virtualization@...ts.linux.dev,
linux-kernel@...r.kernel.org, asahi@...ts.linux.dev
Subject: Re: [PATCH v2] drm/virtio: Align host mapping request to maximum
platform page size
On 1/26/25 00:08, Sasha Finkelstein via B4 Relay wrote:
> --- a/drivers/gpu/drm/virtio/virtgpu_vram.c
> +++ b/drivers/gpu/drm/virtio/virtgpu_vram.c
> @@ -150,8 +150,8 @@ static int virtio_gpu_vram_map(struct virtio_gpu_object *bo)
> return -EINVAL;
>
> spin_lock(&vgdev->host_visible_lock);
> - ret = drm_mm_insert_node(&vgdev->host_visible_mm, &vram->vram_node,
> - bo->base.base.size);
> + ret = drm_mm_insert_node_generic(&vgdev->host_visible_mm, &vram->vram_node,
> + bo->base.base.size, MAX_PAGE_SIZE, 0, 0);
> spin_unlock(&vgdev->host_visible_lock);
The BO size is already aligned, no need to align it second time.
Anyways, we first should wait for a reply from Rob RE potential impact
of this change on Freedreno and other non-x86 drivers and non-nctx contexts.
Otherwise, the proper solution would be to pass info about host's page
size to guest using extended virtio protocol. This is very doable if you
have time to work on this useful feature and want to contribute/learn more.
--
Best regards,
Dmitry
Powered by blists - more mailing lists