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 <[email protected]> > --- > > 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

