mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Dmitry Osipenko <dmitry.osipenko@collabora.com>
To: fnkl.kernel@gmail.com, David Airlie <airlied@redhat.com>,
	Gerd Hoffmann <kraxel@redhat.com>,
	Gurchetan Singh <gurchetansingh@chromium.org>,
	Chia-I Wu <olvaffe@gmail.com>,
	Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
	Maxime Ripard <mripard@kernel.org>,
	Thomas Zimmermann <tzimmermann@suse.de>,
	Simona Vetter <simona@ffwll.ch>
Cc: dri-devel@lists.freedesktop.org, virtualization@lists.linux.dev,
	linux-kernel@vger.kernel.org, asahi@lists.linux.dev
Subject: Re: [PATCH v2] drm/virtio: Align host mapping request to maximum platform page size
Date: Wed, 29 Jan 2025 17:39:51 +0300	[thread overview]
Message-ID: <2f3394a5-0c63-49bf-bc85-f43388050ab8@collabora.com> (raw)
In-Reply-To: <20250125-virtgpu-mixed-page-size-v2-1-c40c555cf276@gmail.com>

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


  parent reply	other threads:[~2025-01-29 14:40 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-25 21:08 Sasha Finkelstein via B4 Relay
2025-01-27  7:31 ` Thomas Zimmermann
2025-01-27  9:05   ` Sasha Finkelstein
2025-01-29 14:39 ` Dmitry Osipenko [this message]
2025-02-06 15:17   ` Sasha Finkelstein
2025-02-07 15:38     ` Dmitry Osipenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2f3394a5-0c63-49bf-bc85-f43388050ab8@collabora.com \
    --to=dmitry.osipenko@collabora.com \
    --cc=airlied@redhat.com \
    --cc=asahi@lists.linux.dev \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=fnkl.kernel@gmail.com \
    --cc=gurchetansingh@chromium.org \
    --cc=kraxel@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=mripard@kernel.org \
    --cc=olvaffe@gmail.com \
    --cc=simona@ffwll.ch \
    --cc=tzimmermann@suse.de \
    --cc=virtualization@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®