All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kuan-Wei Chiu <visitorckw@gmail.com>
To: Daniel Palmer <daniel@thingy.jp>
Cc: bmeng.cn@gmail.com, sjg@chromium.org, u-boot@lists.denx.de
Subject: Re: [RFC PATCH] virtio: Add driver for virtio gpu
Date: Tue, 26 May 2026 14:10:32 +0800	[thread overview]
Message-ID: <ahU5WIYwWLxeM9oY@google.com> (raw)
In-Reply-To: <20260523055000.1059981-1-daniel@thingy.jp>

Hi Daniel,

On Sat, May 23, 2026 at 02:50:00PM +0900, Daniel Palmer wrote:
> Add a basic driver for virtio gpu. This allows for a video on
> qemu virt machines.

Cool! Thanks for doing this.

I was also planning to look into adding support for some other virtio
drivers, but I've been traveling recently and haven't had the time to
finish them up.

Video drivers aren't really my area of expertise, so my feedback is a
bit limited. I just have one minor comment below:

> 
> Signed-off-by: Daniel Palmer <daniel@thingy.jp>
> ---
> 
> Since the m68k virtio stuff is now in next I thought I'd send this.
> This patch is based on next.
> 
> This is a very simple driver for virtio gpu that works just enough
> to create a framebuffer that u-boot can use.
> 
> I've been playing with this on m68k and its shown that some of the
> framebuffer code has some endian issues.
> 
> I think this is useful for testing the framebuffer code on other
> arches like arm, riscv and so on.
> 
> Open to comments, ideas etc.
> 
> +static int virtio_gpu_resource_create_2d(struct virtqueue *vq,
> +					 u32 resource_id,
> +					 u32 format,
> +					 u32 width,
> +					 u32 height)
> +{
> +	struct virtio_gpu_resource_create_2d req = {
> +		.hdr.type = cpu_to_le32(VIRTIO_GPU_CMD_RESOURCE_CREATE_2D),
> +		.resource_id = cpu_to_le32(resource_id),
> +		.format	= cpu_to_le32(format),
> +		.width = cpu_to_le32(width),
> +		.height = cpu_to_le32(height),
> +	};
> +	struct virtio_gpu_ctrl_hdr resp;
> +
> +	return virtio_gpu_cmd(vq, &req, sizeof(req), &resp, sizeof(resp));

IIUC, req and resp here are used as dma buffers. I'm not sure if it's
safe to allocate them on the stack. Are there alignment requirements
for them?

Regards,
Kuan-Wei


  parent reply	other threads:[~2026-05-26  6:10 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-23  5:50 [RFC PATCH] virtio: Add driver for virtio gpu Daniel Palmer
2026-05-23  9:31 ` Simon Glass
2026-05-26  6:10 ` Kuan-Wei Chiu [this message]
2026-06-01 14:59   ` Simon Glass

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=ahU5WIYwWLxeM9oY@google.com \
    --to=visitorckw@gmail.com \
    --cc=bmeng.cn@gmail.com \
    --cc=daniel@thingy.jp \
    --cc=sjg@chromium.org \
    --cc=u-boot@lists.denx.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.