* [Qemu-devel] [PATCH 1.0] qxl: fix vga port initialization.
@ 2011-11-03 17:21 Gerd Hoffmann
2011-11-07 13:02 ` Alon Levy
2011-11-08 17:24 ` Anthony Liguori
0 siblings, 2 replies; 3+ messages in thread
From: Gerd Hoffmann @ 2011-11-03 17:21 UTC (permalink / raw)
To: qemu-devel; +Cc: Hans de Goede, Gerd Hoffmann
Commit 0a039dc70096b768d3810afa50ba1d214768aaf4 broke vga modes for
qxl-vga by loosing vga_ioport_read windup. qxl needs to hook into
vga port writes only and used to realize that by letting vga_init() do
the work for both reads and writes, then overwrite the write function.
That little detail was missed while doing the conversion ...
This patch fixes it. It also switch qxl vga ioport registration to
portio lists while being at it.
Cc: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
hw/qxl.c | 22 +++++++++++++++++-----
1 files changed, 17 insertions(+), 5 deletions(-)
diff --git a/hw/qxl.c b/hw/qxl.c
index 84ffd45..41500e9 100644
--- a/hw/qxl.c
+++ b/hw/qxl.c
@@ -896,6 +896,20 @@ static void qxl_vga_ioport_write(void *opaque, uint32_t addr, uint32_t val)
vga_ioport_write(opaque, addr, val);
}
+static const MemoryRegionPortio qxl_vga_portio_list[] = {
+ { 0x04, 2, 1, .read = vga_ioport_read,
+ .write = qxl_vga_ioport_write }, /* 3b4 */
+ { 0x0a, 1, 1, .read = vga_ioport_read,
+ .write = qxl_vga_ioport_write }, /* 3ba */
+ { 0x10, 16, 1, .read = vga_ioport_read,
+ .write = qxl_vga_ioport_write }, /* 3c0 */
+ { 0x24, 2, 1, .read = vga_ioport_read,
+ .write = qxl_vga_ioport_write }, /* 3d4 */
+ { 0x2a, 1, 1, .read = vga_ioport_read,
+ .write = qxl_vga_ioport_write }, /* 3da */
+ PORTIO_END_OF_LIST(),
+};
+
static void qxl_add_memslot(PCIQXLDevice *d, uint32_t slot_id, uint64_t delta,
qxl_async_io async)
{
@@ -1595,6 +1609,7 @@ static int qxl_init_primary(PCIDevice *dev)
PCIQXLDevice *qxl = DO_UPCAST(PCIQXLDevice, pci, dev);
VGACommonState *vga = &qxl->vga;
ram_addr_t ram_size = msb_mask(qxl->vga.vram_size * 2 - 1);
+ PortioList *qxl_vga_port_list = g_new(PortioList, 1);
qxl->id = 0;
@@ -1603,11 +1618,8 @@ static int qxl_init_primary(PCIDevice *dev)
}
vga_common_init(vga, ram_size);
vga_init(vga, pci_address_space(dev), pci_address_space_io(dev), false);
- register_ioport_write(0x3c0, 16, 1, qxl_vga_ioport_write, vga);
- register_ioport_write(0x3b4, 2, 1, qxl_vga_ioport_write, vga);
- register_ioport_write(0x3d4, 2, 1, qxl_vga_ioport_write, vga);
- register_ioport_write(0x3ba, 1, 1, qxl_vga_ioport_write, vga);
- register_ioport_write(0x3da, 1, 1, qxl_vga_ioport_write, vga);
+ portio_list_init(qxl_vga_port_list, qxl_vga_portio_list, vga, "vga");
+ portio_list_add(qxl_vga_port_list, pci_address_space_io(dev), 0x3b0);
vga->ds = graphic_console_init(qxl_hw_update, qxl_hw_invalidate,
qxl_hw_screen_dump, qxl_hw_text_update, qxl);
--
1.7.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PATCH 1.0] qxl: fix vga port initialization.
2011-11-03 17:21 [Qemu-devel] [PATCH 1.0] qxl: fix vga port initialization Gerd Hoffmann
@ 2011-11-07 13:02 ` Alon Levy
2011-11-08 17:24 ` Anthony Liguori
1 sibling, 0 replies; 3+ messages in thread
From: Alon Levy @ 2011-11-07 13:02 UTC (permalink / raw)
To: Gerd Hoffmann; +Cc: Hans de Goede, qemu-devel
On Thu, Nov 03, 2011 at 06:21:54PM +0100, Gerd Hoffmann wrote:
> Commit 0a039dc70096b768d3810afa50ba1d214768aaf4 broke vga modes for
> qxl-vga by loosing vga_ioport_read windup. qxl needs to hook into
> vga port writes only and used to realize that by letting vga_init() do
> the work for both reads and writes, then overwrite the write function.
> That little detail was missed while doing the conversion ...
>
> This patch fixes it. It also switch qxl vga ioport registration to
> portio lists while being at it.
Acked-by: Alon Levy <alevy@redhat.com>
>
> Cc: Hans de Goede <hdegoede@redhat.com>
> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
> ---
> hw/qxl.c | 22 +++++++++++++++++-----
> 1 files changed, 17 insertions(+), 5 deletions(-)
>
> diff --git a/hw/qxl.c b/hw/qxl.c
> index 84ffd45..41500e9 100644
> --- a/hw/qxl.c
> +++ b/hw/qxl.c
> @@ -896,6 +896,20 @@ static void qxl_vga_ioport_write(void *opaque, uint32_t addr, uint32_t val)
> vga_ioport_write(opaque, addr, val);
> }
>
> +static const MemoryRegionPortio qxl_vga_portio_list[] = {
> + { 0x04, 2, 1, .read = vga_ioport_read,
> + .write = qxl_vga_ioport_write }, /* 3b4 */
> + { 0x0a, 1, 1, .read = vga_ioport_read,
> + .write = qxl_vga_ioport_write }, /* 3ba */
> + { 0x10, 16, 1, .read = vga_ioport_read,
> + .write = qxl_vga_ioport_write }, /* 3c0 */
> + { 0x24, 2, 1, .read = vga_ioport_read,
> + .write = qxl_vga_ioport_write }, /* 3d4 */
> + { 0x2a, 1, 1, .read = vga_ioport_read,
> + .write = qxl_vga_ioport_write }, /* 3da */
> + PORTIO_END_OF_LIST(),
> +};
> +
> static void qxl_add_memslot(PCIQXLDevice *d, uint32_t slot_id, uint64_t delta,
> qxl_async_io async)
> {
> @@ -1595,6 +1609,7 @@ static int qxl_init_primary(PCIDevice *dev)
> PCIQXLDevice *qxl = DO_UPCAST(PCIQXLDevice, pci, dev);
> VGACommonState *vga = &qxl->vga;
> ram_addr_t ram_size = msb_mask(qxl->vga.vram_size * 2 - 1);
> + PortioList *qxl_vga_port_list = g_new(PortioList, 1);
>
> qxl->id = 0;
>
> @@ -1603,11 +1618,8 @@ static int qxl_init_primary(PCIDevice *dev)
> }
> vga_common_init(vga, ram_size);
> vga_init(vga, pci_address_space(dev), pci_address_space_io(dev), false);
> - register_ioport_write(0x3c0, 16, 1, qxl_vga_ioport_write, vga);
> - register_ioport_write(0x3b4, 2, 1, qxl_vga_ioport_write, vga);
> - register_ioport_write(0x3d4, 2, 1, qxl_vga_ioport_write, vga);
> - register_ioport_write(0x3ba, 1, 1, qxl_vga_ioport_write, vga);
> - register_ioport_write(0x3da, 1, 1, qxl_vga_ioport_write, vga);
> + portio_list_init(qxl_vga_port_list, qxl_vga_portio_list, vga, "vga");
> + portio_list_add(qxl_vga_port_list, pci_address_space_io(dev), 0x3b0);
>
> vga->ds = graphic_console_init(qxl_hw_update, qxl_hw_invalidate,
> qxl_hw_screen_dump, qxl_hw_text_update, qxl);
> --
> 1.7.1
>
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PATCH 1.0] qxl: fix vga port initialization.
2011-11-03 17:21 [Qemu-devel] [PATCH 1.0] qxl: fix vga port initialization Gerd Hoffmann
2011-11-07 13:02 ` Alon Levy
@ 2011-11-08 17:24 ` Anthony Liguori
1 sibling, 0 replies; 3+ messages in thread
From: Anthony Liguori @ 2011-11-08 17:24 UTC (permalink / raw)
To: Gerd Hoffmann; +Cc: Hans de Goede, qemu-devel
On 11/03/2011 12:21 PM, Gerd Hoffmann wrote:
> Commit 0a039dc70096b768d3810afa50ba1d214768aaf4 broke vga modes for
> qxl-vga by loosing vga_ioport_read windup. qxl needs to hook into
> vga port writes only and used to realize that by letting vga_init() do
> the work for both reads and writes, then overwrite the write function.
> That little detail was missed while doing the conversion ...
>
> This patch fixes it. It also switch qxl vga ioport registration to
> portio lists while being at it.
>
> Cc: Hans de Goede<hdegoede@redhat.com>
> Signed-off-by: Gerd Hoffmann<kraxel@redhat.com>
Applied. Thanks.
Regards,
Anthony Liguori
> ---
> hw/qxl.c | 22 +++++++++++++++++-----
> 1 files changed, 17 insertions(+), 5 deletions(-)
>
> diff --git a/hw/qxl.c b/hw/qxl.c
> index 84ffd45..41500e9 100644
> --- a/hw/qxl.c
> +++ b/hw/qxl.c
> @@ -896,6 +896,20 @@ static void qxl_vga_ioport_write(void *opaque, uint32_t addr, uint32_t val)
> vga_ioport_write(opaque, addr, val);
> }
>
> +static const MemoryRegionPortio qxl_vga_portio_list[] = {
> + { 0x04, 2, 1, .read = vga_ioport_read,
> + .write = qxl_vga_ioport_write }, /* 3b4 */
> + { 0x0a, 1, 1, .read = vga_ioport_read,
> + .write = qxl_vga_ioport_write }, /* 3ba */
> + { 0x10, 16, 1, .read = vga_ioport_read,
> + .write = qxl_vga_ioport_write }, /* 3c0 */
> + { 0x24, 2, 1, .read = vga_ioport_read,
> + .write = qxl_vga_ioport_write }, /* 3d4 */
> + { 0x2a, 1, 1, .read = vga_ioport_read,
> + .write = qxl_vga_ioport_write }, /* 3da */
> + PORTIO_END_OF_LIST(),
> +};
> +
> static void qxl_add_memslot(PCIQXLDevice *d, uint32_t slot_id, uint64_t delta,
> qxl_async_io async)
> {
> @@ -1595,6 +1609,7 @@ static int qxl_init_primary(PCIDevice *dev)
> PCIQXLDevice *qxl = DO_UPCAST(PCIQXLDevice, pci, dev);
> VGACommonState *vga =&qxl->vga;
> ram_addr_t ram_size = msb_mask(qxl->vga.vram_size * 2 - 1);
> + PortioList *qxl_vga_port_list = g_new(PortioList, 1);
>
> qxl->id = 0;
>
> @@ -1603,11 +1618,8 @@ static int qxl_init_primary(PCIDevice *dev)
> }
> vga_common_init(vga, ram_size);
> vga_init(vga, pci_address_space(dev), pci_address_space_io(dev), false);
> - register_ioport_write(0x3c0, 16, 1, qxl_vga_ioport_write, vga);
> - register_ioport_write(0x3b4, 2, 1, qxl_vga_ioport_write, vga);
> - register_ioport_write(0x3d4, 2, 1, qxl_vga_ioport_write, vga);
> - register_ioport_write(0x3ba, 1, 1, qxl_vga_ioport_write, vga);
> - register_ioport_write(0x3da, 1, 1, qxl_vga_ioport_write, vga);
> + portio_list_init(qxl_vga_port_list, qxl_vga_portio_list, vga, "vga");
> + portio_list_add(qxl_vga_port_list, pci_address_space_io(dev), 0x3b0);
>
> vga->ds = graphic_console_init(qxl_hw_update, qxl_hw_invalidate,
> qxl_hw_screen_dump, qxl_hw_text_update, qxl);
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2011-11-08 17:26 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-03 17:21 [Qemu-devel] [PATCH 1.0] qxl: fix vga port initialization Gerd Hoffmann
2011-11-07 13:02 ` Alon Levy
2011-11-08 17:24 ` Anthony Liguori
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).