* [Qemu-devel] [PATCH 2/3 v2] vmware_vga: Return a value for FB_SIZE before the device is enabled
@ 2012-09-17 11:09 BALATON Zoltan
0 siblings, 0 replies; 3+ messages in thread
From: BALATON Zoltan @ 2012-09-17 11:09 UTC (permalink / raw)
To: qemu-devel
According to the documentation drivers using this device should read
FB_SIZE before enabling the device to know what memory to map. This
would not work if we return 0 before enabled.
Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
---
hw/vmware_vga.c | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)
v2: Rebase to apply to current
diff --git a/hw/vmware_vga.c b/hw/vmware_vga.c
index 20f4fb8..5e4786f 100644
--- a/hw/vmware_vga.c
+++ b/hw/vmware_vga.c
@@ -39,8 +39,12 @@
struct vmsvga_state_s {
VGACommonState vga;
+/* -*- The members marked are now unused and could be removed but they are
+ * contained in the VMState thus need special handling. Maybe they could
+ * be removed the next time a new machine type is added.
+ */
int invalidated;
- int depth;
+ int depth; /* -*- */
int enable;
int config;
struct {
@@ -58,7 +62,7 @@ struct vmsvga_state_s {
uint32_t guest;
uint32_t svgaid;
int syncing;
- int fb_size;
+ int fb_size; /* -*- */
MemoryRegion fifo_ram;
uint8_t *fifo_ptr;
@@ -733,10 +737,10 @@ static uint32_t vmsvga_value_read(void *opaque, uint32_t address)
return 0x0;
case SVGA_REG_VRAM_SIZE:
- return s->vga.vram_size;
+ return s->vga.vram_size; /* No physical VRAM besides the framebuffer */
case SVGA_REG_FB_SIZE:
- return s->fb_size;
+ return s->vga.vram_size;
case SVGA_REG_CAPABILITIES:
caps = SVGA_CAP_NONE;
@@ -821,7 +825,6 @@ static void vmsvga_value_write(void *opaque, uint32_t address, uint32_t value)
s->invalidated = 1;
s->vga.invalidate(&s->vga);
if (s->enable) {
- s->fb_size = ((s->depth + 7) >> 3) * s->new_width * s->new_height;
vga_dirty_log_stop(&s->vga);
} else {
vga_dirty_log_start(&s->vga);
--
1.7.10
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [Qemu-devel] [PATCH 0/3] vmware_vga: Cleanup and allow simple drivers to work without the fifo
@ 2012-10-03 9:22 BALATON Zoltan
2012-10-03 9:30 ` [Qemu-devel] [PATCH 2/3 v2] vmware_vga: Return a value for FB_SIZE before the device is enabled BALATON Zoltan
0 siblings, 1 reply; 3+ messages in thread
From: BALATON Zoltan @ 2012-10-03 9:22 UTC (permalink / raw)
To: qemu-devel
Resending it again as I got no comments and seems to have been ignored so
far. These patches simplify the vmware_vga by removing duplicated info
from its local state and make it work with more guest drivers (in
particular with the very simple OpenStep VMWareFB driver) that do not use
the fifo while it should have no effect on other drivers.
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Qemu-devel] [PATCH 2/3 v2] vmware_vga: Return a value for FB_SIZE before the device is enabled
2012-10-03 9:22 [Qemu-devel] [PATCH 0/3] vmware_vga: Cleanup and allow simple drivers to work without the fifo BALATON Zoltan
@ 2012-10-03 9:30 ` BALATON Zoltan
2012-10-03 9:43 ` Paolo Bonzini
0 siblings, 1 reply; 3+ messages in thread
From: BALATON Zoltan @ 2012-10-03 9:30 UTC (permalink / raw)
To: qemu-devel
According to the documentation drivers using this device should read
FB_SIZE before enabling the device to know what memory to map. This
would not work if we return 0 before enabled.
Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
---
hw/vmware_vga.c | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)
v2: Rebase to apply to current
diff --git a/hw/vmware_vga.c b/hw/vmware_vga.c
index 20f4fb8..5e4786f 100644
--- a/hw/vmware_vga.c
+++ b/hw/vmware_vga.c
@@ -39,8 +39,12 @@
struct vmsvga_state_s {
VGACommonState vga;
+/* -*- The members marked are now unused and could be removed but they are
+ * contained in the VMState thus need special handling. Maybe they could
+ * be removed the next time a new machine type is added.
+ */
int invalidated;
- int depth;
+ int depth; /* -*- */
int enable;
int config;
struct {
@@ -58,7 +62,7 @@ struct vmsvga_state_s {
uint32_t guest;
uint32_t svgaid;
int syncing;
- int fb_size;
+ int fb_size; /* -*- */
MemoryRegion fifo_ram;
uint8_t *fifo_ptr;
@@ -733,10 +737,10 @@ static uint32_t vmsvga_value_read(void *opaque, uint32_t address)
return 0x0;
case SVGA_REG_VRAM_SIZE:
- return s->vga.vram_size;
+ return s->vga.vram_size; /* No physical VRAM besides the framebuffer */
case SVGA_REG_FB_SIZE:
- return s->fb_size;
+ return s->vga.vram_size;
case SVGA_REG_CAPABILITIES:
caps = SVGA_CAP_NONE;
@@ -821,7 +825,6 @@ static void vmsvga_value_write(void *opaque, uint32_t address, uint32_t value)
s->invalidated = 1;
s->vga.invalidate(&s->vga);
if (s->enable) {
- s->fb_size = ((s->depth + 7) >> 3) * s->new_width * s->new_height;
vga_dirty_log_stop(&s->vga);
} else {
vga_dirty_log_start(&s->vga);
--
1.7.10
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PATCH 2/3 v2] vmware_vga: Return a value for FB_SIZE before the device is enabled
2012-10-03 9:30 ` [Qemu-devel] [PATCH 2/3 v2] vmware_vga: Return a value for FB_SIZE before the device is enabled BALATON Zoltan
@ 2012-10-03 9:43 ` Paolo Bonzini
0 siblings, 0 replies; 3+ messages in thread
From: Paolo Bonzini @ 2012-10-03 9:43 UTC (permalink / raw)
To: BALATON Zoltan; +Cc: qemu-devel
Il 03/10/2012 11:30, BALATON Zoltan ha scritto:
> According to the documentation drivers using this device should read
> FB_SIZE before enabling the device to know what memory to map. This
> would not work if we return 0 before enabled.
>
> Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
> ---
> hw/vmware_vga.c | 13 ++++++++-----
> 1 file changed, 8 insertions(+), 5 deletions(-)
>
> v2: Rebase to apply to current
>
> diff --git a/hw/vmware_vga.c b/hw/vmware_vga.c
> index 20f4fb8..5e4786f 100644
> --- a/hw/vmware_vga.c
> +++ b/hw/vmware_vga.c
> @@ -39,8 +39,12 @@
> struct vmsvga_state_s {
> VGACommonState vga;
>
> +/* -*- The members marked are now unused and could be removed but they are
> + * contained in the VMState thus need special handling. Maybe they
> could
> + * be removed the next time a new machine type is added.
> + */
To fix this, you can bump the version number and replace the depth and
fb_size VMState fields with VMSTATE_UNUSED.
Paolo
> int invalidated;
> - int depth;
> + int depth; /* -*- */
> int enable;
> int config;
> struct {
> @@ -58,7 +62,7 @@ struct vmsvga_state_s {
> uint32_t guest;
> uint32_t svgaid;
> int syncing;
> - int fb_size;
> + int fb_size; /* -*- */
>
> MemoryRegion fifo_ram;
> uint8_t *fifo_ptr;
> @@ -733,10 +737,10 @@ static uint32_t vmsvga_value_read(void *opaque,
> uint32_t address)
> return 0x0;
>
> case SVGA_REG_VRAM_SIZE:
> - return s->vga.vram_size;
> + return s->vga.vram_size; /* No physical VRAM besides the
> framebuffer */
>
> case SVGA_REG_FB_SIZE:
> - return s->fb_size;
> + return s->vga.vram_size;
>
> case SVGA_REG_CAPABILITIES:
> caps = SVGA_CAP_NONE;
> @@ -821,7 +825,6 @@ static void vmsvga_value_write(void *opaque,
> uint32_t address, uint32_t value)
> s->invalidated = 1;
> s->vga.invalidate(&s->vga);
> if (s->enable) {
> - s->fb_size = ((s->depth + 7) >> 3) * s->new_width *
> s->new_height;
> vga_dirty_log_stop(&s->vga);
> } else {
> vga_dirty_log_start(&s->vga);
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2012-10-03 9:44 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-17 11:09 [Qemu-devel] [PATCH 2/3 v2] vmware_vga: Return a value for FB_SIZE before the device is enabled BALATON Zoltan
-- strict thread matches above, loose matches on Subject: below --
2012-10-03 9:22 [Qemu-devel] [PATCH 0/3] vmware_vga: Cleanup and allow simple drivers to work without the fifo BALATON Zoltan
2012-10-03 9:30 ` [Qemu-devel] [PATCH 2/3 v2] vmware_vga: Return a value for FB_SIZE before the device is enabled BALATON Zoltan
2012-10-03 9:43 ` Paolo Bonzini
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).