[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 3/3] display/stdvga: add edid support.
From: |
Gerd Hoffmann |
Subject: |
Re: [Qemu-devel] [PATCH 3/3] display/stdvga: add edid support. |
Date: |
Thu, 13 Sep 2018 09:19:13 +0200 |
User-agent: |
NeoMutt/20180716 |
> > --- a/docs/specs/standard-vga.txt
> > +++ b/docs/specs/standard-vga.txt
> > @@ -61,7 +61,7 @@ MMIO area spec
> > Likewise applies to the pci variant only for obvious reasons.
> > -0000 - 03ff : reserved, for possible virtio extension.
> > +0000 - 03ff : edid data blob.
>
>
> > + if (edid) {
> > + qemu_edid_info info = {
> > + .prefx = d->xres,
> > + .prefy = d->yres,
> > + };
> > + qemu_edid_generate(d->edid, sizeof(d->edid), &info);
> > + qemu_edid_region_io(&subs[3], owner, d->edid, sizeof(d->edid));
> > + memory_region_add_subregion(parent, 0, &subs[3]);
>
> Is there ever a risk that this could overflow? Or, if the blob is always
> smaller than 0x3ff, should we still leave reserved bytes?
It's 128 bytes long. There can be (multiple) extensions, each 128 bytes
long too. Current generator doesn't create any extensions. So, only a
fraction of the space is actually used right now.
I'd leave the room reserved for edid nevertheless. There is still
plenty of unused address space should we need something at some point in
the future. The mmio bar is one page (4k), with more than 2k at the end
being not used (from info mtree):
00000000febf0000-00000000febf0fff (prio 1, i/o): vga.mmio
00000000febf0000-00000000febf007f (prio 0, i/o): edid
00000000febf0400-00000000febf041f (prio 0, i/o): vga ioports remapped
00000000febf0500-00000000febf0515 (prio 0, i/o): bochs dispi interface
00000000febf0600-00000000febf0607 (prio 0, i/o): qemu extended regs
cheers,
Gerd