* [PATCH] hw/display/virtio-vga: made vga memory size configurable
@ 2021-03-14 12:23 vitaly
2021-03-14 12:45 ` BALATON Zoltan
2021-03-15 7:21 ` Gerd Hoffmann
0 siblings, 2 replies; 8+ messages in thread
From: vitaly @ 2021-03-14 12:23 UTC (permalink / raw)
To: qemu-devel; +Cc: Vitaly Chipounov, kraxel
From: Vitaly Chipounov <vitaly@cyberhaven.com>
This enables higher resolutions. The default is still 8MB for
backwards compatibility with existing snapshots.
The property name "vgamem_fb" is similar to that of the other
graphic adapters.
seabios/vgasrc/svgamodes.c needs to be updated as well.
For example, adding the following line would expose
a 3840x2160 resolution to the guest.
{ 0x199, { MM_DIRECT, 3840, 2160, 32, 8, 16, SEG_GRAPH } },
Signed-off-by: Vitaly Chipounov <vitaly@cyberhaven.com>
---
hw/display/virtio-vga.c | 3 ++-
hw/virtio/virtio-pci.h | 2 ++
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/hw/display/virtio-vga.c b/hw/display/virtio-vga.c
index d3c6404061..657fafc48f 100644
--- a/hw/display/virtio-vga.c
+++ b/hw/display/virtio-vga.c
@@ -118,7 +118,7 @@ static void virtio_vga_base_realize(VirtIOPCIProxy *vpci_dev, Error **errp)
int i;
/* init vga compat bits */
- vga->vram_size_mb = 8;
+ vga->vram_size_mb = vpci_dev->vgamem_size_mb;
vga_common_init(vga, OBJECT(vpci_dev));
vga_init(vga, OBJECT(vpci_dev), pci_address_space(&vpci_dev->pci_dev),
pci_address_space_io(&vpci_dev->pci_dev), true);
@@ -204,6 +204,7 @@ static void virtio_vga_set_big_endian_fb(Object *obj, bool value, Error **errp)
static Property virtio_vga_base_properties[] = {
DEFINE_VIRTIO_GPU_PCI_PROPERTIES(VirtIOPCIProxy),
+ DEFINE_PROP_UINT32("vgamem_mb", VirtIOPCIProxy, vgamem_size_mb, 8),
DEFINE_PROP_END_OF_LIST(),
};
diff --git a/hw/virtio/virtio-pci.h b/hw/virtio/virtio-pci.h
index d7d5d403a9..8684311a8d 100644
--- a/hw/virtio/virtio-pci.h
+++ b/hw/virtio/virtio-pci.h
@@ -151,6 +151,8 @@ struct VirtIOPCIProxy {
VirtIOIRQFD *vector_irqfd;
int nvqs_with_notifiers;
VirtioBusState bus;
+
+ uint32_t vgamem_size_mb;
};
static inline bool virtio_pci_modern(VirtIOPCIProxy *proxy)
--
2.25.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH] hw/display/virtio-vga: made vga memory size configurable
2021-03-14 12:23 [PATCH] hw/display/virtio-vga: made vga memory size configurable vitaly
@ 2021-03-14 12:45 ` BALATON Zoltan
2021-03-14 12:50 ` Vitaly Chipounov
2021-03-15 7:21 ` Gerd Hoffmann
1 sibling, 1 reply; 8+ messages in thread
From: BALATON Zoltan @ 2021-03-14 12:45 UTC (permalink / raw)
To: Vitaly Chipounov; +Cc: qemu-devel, kraxel
On Sun, 14 Mar 2021, vitaly@cyberhaven.com wrote:
> From: Vitaly Chipounov <vitaly@cyberhaven.com>
>
> This enables higher resolutions. The default is still 8MB for
> backwards compatibility with existing snapshots.
>
> The property name "vgamem_fb" is similar to that of the other
Isn't that vgamem_mb? Code has that so it's just a typo in commit message.
Regards,
BALATON Zoltan
> graphic adapters.
>
> seabios/vgasrc/svgamodes.c needs to be updated as well.
> For example, adding the following line would expose
> a 3840x2160 resolution to the guest.
>
> { 0x199, { MM_DIRECT, 3840, 2160, 32, 8, 16, SEG_GRAPH } },
>
> Signed-off-by: Vitaly Chipounov <vitaly@cyberhaven.com>
> ---
> hw/display/virtio-vga.c | 3 ++-
> hw/virtio/virtio-pci.h | 2 ++
> 2 files changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/hw/display/virtio-vga.c b/hw/display/virtio-vga.c
> index d3c6404061..657fafc48f 100644
> --- a/hw/display/virtio-vga.c
> +++ b/hw/display/virtio-vga.c
> @@ -118,7 +118,7 @@ static void virtio_vga_base_realize(VirtIOPCIProxy *vpci_dev, Error **errp)
> int i;
>
> /* init vga compat bits */
> - vga->vram_size_mb = 8;
> + vga->vram_size_mb = vpci_dev->vgamem_size_mb;
> vga_common_init(vga, OBJECT(vpci_dev));
> vga_init(vga, OBJECT(vpci_dev), pci_address_space(&vpci_dev->pci_dev),
> pci_address_space_io(&vpci_dev->pci_dev), true);
> @@ -204,6 +204,7 @@ static void virtio_vga_set_big_endian_fb(Object *obj, bool value, Error **errp)
>
> static Property virtio_vga_base_properties[] = {
> DEFINE_VIRTIO_GPU_PCI_PROPERTIES(VirtIOPCIProxy),
> + DEFINE_PROP_UINT32("vgamem_mb", VirtIOPCIProxy, vgamem_size_mb, 8),
> DEFINE_PROP_END_OF_LIST(),
> };
>
> diff --git a/hw/virtio/virtio-pci.h b/hw/virtio/virtio-pci.h
> index d7d5d403a9..8684311a8d 100644
> --- a/hw/virtio/virtio-pci.h
> +++ b/hw/virtio/virtio-pci.h
> @@ -151,6 +151,8 @@ struct VirtIOPCIProxy {
> VirtIOIRQFD *vector_irqfd;
> int nvqs_with_notifiers;
> VirtioBusState bus;
> +
> + uint32_t vgamem_size_mb;
> };
>
> static inline bool virtio_pci_modern(VirtIOPCIProxy *proxy)
>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] hw/display/virtio-vga: made vga memory size configurable
2021-03-14 12:45 ` BALATON Zoltan
@ 2021-03-14 12:50 ` Vitaly Chipounov
0 siblings, 0 replies; 8+ messages in thread
From: Vitaly Chipounov @ 2021-03-14 12:50 UTC (permalink / raw)
To: BALATON Zoltan; +Cc: qemu-devel, kraxel
Yes, it's a typo in the commit message, sorry.
Vitaly
On 3/14/21 1:45 PM, BALATON Zoltan wrote:
> On Sun, 14 Mar 2021, vitaly@cyberhaven.com wrote:
>> From: Vitaly Chipounov <vitaly@cyberhaven.com>
>>
>> This enables higher resolutions. The default is still 8MB for
>> backwards compatibility with existing snapshots.
>>
>> The property name "vgamem_fb" is similar to that of the other
>
> Isn't that vgamem_mb? Code has that so it's just a typo in commit
> message.
>
> Regards,
> BALATON Zoltan
>
>> graphic adapters.
>>
>> seabios/vgasrc/svgamodes.c needs to be updated as well.
>> For example, adding the following line would expose
>> a 3840x2160 resolution to the guest.
>>
>> { 0x199, { MM_DIRECT, 3840, 2160, 32, 8, 16, SEG_GRAPH } },
>>
>> Signed-off-by: Vitaly Chipounov <vitaly@cyberhaven.com>
>> ---
>> hw/display/virtio-vga.c | 3 ++-
>> hw/virtio/virtio-pci.h | 2 ++
>> 2 files changed, 4 insertions(+), 1 deletion(-)
>>
>> diff --git a/hw/display/virtio-vga.c b/hw/display/virtio-vga.c
>> index d3c6404061..657fafc48f 100644
>> --- a/hw/display/virtio-vga.c
>> +++ b/hw/display/virtio-vga.c
>> @@ -118,7 +118,7 @@ static void
>> virtio_vga_base_realize(VirtIOPCIProxy *vpci_dev, Error **errp)
>> int i;
>>
>> /* init vga compat bits */
>> - vga->vram_size_mb = 8;
>> + vga->vram_size_mb = vpci_dev->vgamem_size_mb;
>> vga_common_init(vga, OBJECT(vpci_dev));
>> vga_init(vga, OBJECT(vpci_dev),
>> pci_address_space(&vpci_dev->pci_dev),
>> pci_address_space_io(&vpci_dev->pci_dev), true);
>> @@ -204,6 +204,7 @@ static void virtio_vga_set_big_endian_fb(Object
>> *obj, bool value, Error **errp)
>>
>> static Property virtio_vga_base_properties[] = {
>> DEFINE_VIRTIO_GPU_PCI_PROPERTIES(VirtIOPCIProxy),
>> + DEFINE_PROP_UINT32("vgamem_mb", VirtIOPCIProxy, vgamem_size_mb, 8),
>> DEFINE_PROP_END_OF_LIST(),
>> };
>>
>> diff --git a/hw/virtio/virtio-pci.h b/hw/virtio/virtio-pci.h
>> index d7d5d403a9..8684311a8d 100644
>> --- a/hw/virtio/virtio-pci.h
>> +++ b/hw/virtio/virtio-pci.h
>> @@ -151,6 +151,8 @@ struct VirtIOPCIProxy {
>> VirtIOIRQFD *vector_irqfd;
>> int nvqs_with_notifiers;
>> VirtioBusState bus;
>> +
>> + uint32_t vgamem_size_mb;
>> };
>>
>> static inline bool virtio_pci_modern(VirtIOPCIProxy *proxy)
>>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] hw/display/virtio-vga: made vga memory size configurable
2021-03-14 12:23 [PATCH] hw/display/virtio-vga: made vga memory size configurable vitaly
2021-03-14 12:45 ` BALATON Zoltan
@ 2021-03-15 7:21 ` Gerd Hoffmann
2021-03-15 11:29 ` Vitaly Chipounov
1 sibling, 1 reply; 8+ messages in thread
From: Gerd Hoffmann @ 2021-03-15 7:21 UTC (permalink / raw)
To: vitaly; +Cc: qemu-devel
On Sun, Mar 14, 2021 at 01:23:14PM +0100, vitaly@cyberhaven.com wrote:
> From: Vitaly Chipounov <vitaly@cyberhaven.com>
>
> This enables higher resolutions.
No. virtio-vga supports higher resolutions just fine once the guest
driver is loaded. The video memory is used at boot only, before the
guest driver is loaded, and 8MB just for a boot display is more than
generous.
If your guest has no virtio driver use stdvga instead of running
virtio-vga permanently in vga compatibility mode.
take care,
Gerd
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] hw/display/virtio-vga: made vga memory size configurable
2021-03-15 7:21 ` Gerd Hoffmann
@ 2021-03-15 11:29 ` Vitaly Chipounov
2021-03-15 15:24 ` Gerd Hoffmann
0 siblings, 1 reply; 8+ messages in thread
From: Vitaly Chipounov @ 2021-03-15 11:29 UTC (permalink / raw)
To: Gerd Hoffmann; +Cc: qemu-devel
On Mon, Mar 15, 2021 at 8:21 AM Gerd Hoffmann <kraxel@redhat.com> wrote:
>
> On Sun, Mar 14, 2021 at 01:23:14PM +0100, vitaly@cyberhaven.com wrote:
> > From: Vitaly Chipounov <vitaly@cyberhaven.com>
> >
> > This enables higher resolutions.
>
> No. virtio-vga supports higher resolutions just fine once the guest
> driver is loaded. The video memory is used at boot only, before the
> guest driver is loaded, and 8MB just for a boot display is more than
> generous.
>
> If your guest has no virtio driver use stdvga instead of running
> virtio-vga permanently in vga compatibility mode.
I tried -device VGA,vgamem_mb=32. I did not see any resolution above
1080p on a Windows 10 guest.
virtio-vga has many more resolutions available, it was just missing 4k.
I have the virtio-win-0.1.190 driver pack installed.
I don't use qxl, because it makes the Windows GUI sluggish for me. I
don't have problems with VGA or virtio-vga.
Best regards,
Vitaly
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] hw/display/virtio-vga: made vga memory size configurable
2021-03-15 11:29 ` Vitaly Chipounov
@ 2021-03-15 15:24 ` Gerd Hoffmann
2021-03-16 19:51 ` Vitaly Chipounov
0 siblings, 1 reply; 8+ messages in thread
From: Gerd Hoffmann @ 2021-03-15 15:24 UTC (permalink / raw)
To: Vitaly Chipounov; +Cc: qemu-devel
On Mon, Mar 15, 2021 at 12:29:16PM +0100, Vitaly Chipounov wrote:
> On Mon, Mar 15, 2021 at 8:21 AM Gerd Hoffmann <kraxel@redhat.com> wrote:
> >
> > On Sun, Mar 14, 2021 at 01:23:14PM +0100, vitaly@cyberhaven.com wrote:
> > > From: Vitaly Chipounov <vitaly@cyberhaven.com>
> > >
> > > This enables higher resolutions.
> >
> > No. virtio-vga supports higher resolutions just fine once the guest
> > driver is loaded. The video memory is used at boot only, before the
> > guest driver is loaded, and 8MB just for a boot display is more than
> > generous.
> >
> > If your guest has no virtio driver use stdvga instead of running
> > virtio-vga permanently in vga compatibility mode.
>
> I tried -device VGA,vgamem_mb=32. I did not see any resolution above
> 1080p on a Windows 10 guest.
Try "-device VGA,vgamem_mb=32,edid=off". Windows seems to not like our
edid block for some reason.
take care,
Gerd
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] hw/display/virtio-vga: made vga memory size configurable
2021-03-15 15:24 ` Gerd Hoffmann
@ 2021-03-16 19:51 ` Vitaly Chipounov
2021-03-17 6:45 ` Gerd Hoffmann
0 siblings, 1 reply; 8+ messages in thread
From: Vitaly Chipounov @ 2021-03-16 19:51 UTC (permalink / raw)
To: Gerd Hoffmann; +Cc: qemu-devel
On Mon, Mar 15, 2021 at 4:24 PM Gerd Hoffmann <kraxel@redhat.com> wrote:
>
> On Mon, Mar 15, 2021 at 12:29:16PM +0100, Vitaly Chipounov wrote:
> > On Mon, Mar 15, 2021 at 8:21 AM Gerd Hoffmann <kraxel@redhat.com> wrote:
> > >
> > > If your guest has no virtio driver use stdvga instead of running
> > > virtio-vga permanently in vga compatibility mode.
> >
> > I tried -device VGA,vgamem_mb=32. I did not see any resolution above
> > 1080p on a Windows 10 guest.
>
> Try "-device VGA,vgamem_mb=32,edid=off". Windows seems to not like our
> edid block for some reason.
>
This worked, thanks for the tip. Regarding the patch, I can resubmit
it with an amended commit message if people think it's still better to
have a configurable memory size here.
Vitaly
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] hw/display/virtio-vga: made vga memory size configurable
2021-03-16 19:51 ` Vitaly Chipounov
@ 2021-03-17 6:45 ` Gerd Hoffmann
0 siblings, 0 replies; 8+ messages in thread
From: Gerd Hoffmann @ 2021-03-17 6:45 UTC (permalink / raw)
To: Vitaly Chipounov; +Cc: qemu-devel
On Tue, Mar 16, 2021 at 08:51:21PM +0100, Vitaly Chipounov wrote:
> On Mon, Mar 15, 2021 at 4:24 PM Gerd Hoffmann <kraxel@redhat.com> wrote:
> >
> > On Mon, Mar 15, 2021 at 12:29:16PM +0100, Vitaly Chipounov wrote:
> > > On Mon, Mar 15, 2021 at 8:21 AM Gerd Hoffmann <kraxel@redhat.com> wrote:
> > > >
> > > > If your guest has no virtio driver use stdvga instead of running
> > > > virtio-vga permanently in vga compatibility mode.
> > >
> > > I tried -device VGA,vgamem_mb=32. I did not see any resolution above
> > > 1080p on a Windows 10 guest.
> >
> > Try "-device VGA,vgamem_mb=32,edid=off". Windows seems to not like our
> > edid block for some reason.
> >
>
> This worked, thanks for the tip. Regarding the patch, I can resubmit
> it with an amended commit message if people think it's still better to
> have a configurable memory size here.
Given that the vram is used for vga compatibility only and not used any
more once the virtio-gpu driver initialized the device I don't think
this should be configurable.
take care,
Gerd
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2021-03-17 6:46 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-14 12:23 [PATCH] hw/display/virtio-vga: made vga memory size configurable vitaly
2021-03-14 12:45 ` BALATON Zoltan
2021-03-14 12:50 ` Vitaly Chipounov
2021-03-15 7:21 ` Gerd Hoffmann
2021-03-15 11:29 ` Vitaly Chipounov
2021-03-15 15:24 ` Gerd Hoffmann
2021-03-16 19:51 ` Vitaly Chipounov
2021-03-17 6:45 ` Gerd Hoffmann
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).