From: Gerd Hoffmann <kraxel@redhat.com>
To: Igor Mitsyanko <i.mitsyanko@gmail.com>
Cc: Jan Kiszka <jan.kiszka@web.de>, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 16/18] console: stop using DisplayState in gfx hardware emulation
Date: Mon, 25 Mar 2013 21:30:40 +0100 [thread overview]
Message-ID: <5150B3F0.3080003@redhat.com> (raw)
In-Reply-To: <CA+x0pt4w7iJ1zs7Qdmf+oxush4Q8raVqGcETExEVYm--wMeKHg@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1604 bytes --]
On 03/25/13 14:56, Igor Mitsyanko wrote:
> On 03/25/2013 02:37 PM, Gerd Hoffmann wrote:
>>
>>> Hi,
>>>
>>> [5425.580115] displaysurface_create_from surface=0x7ff315d3df40,
>>>> 800x600, bpp 16, bswap 0 [5425.580257] displaysurface_free
>>>> surface=0x7ff3158c33b0
>>>>
>>>
>>> This is vga=0x314
>>>
>>> Looks like we have some funky interaction between vga and vmware.
>>>
>>> I'll go dig. Meanwhile you can try vga=0x315 (800x600x24) or
>>> vga=normal (textmode), that has a high chance to workaround this.
>>>
>>> cheers,
>>> Gerd
>>>
>>
>>
>
> Couldn't it be because wred, wgreen and wblue were removed? It seems like
> it was a workaround for some pre-existing problem, is it ok that you
> removed them but left depth and bypp intact?
No, it is not, and yes, this is where the inconsistency comes from. We
read wred+wgreen+wblue directly from the surface whereas depth is cached
in the vmware vga state struct. Patch attached. Not fully tested yet.
I think the "pre-existing problem" is that the vmware vga has the bochs
dispi vbe interface enabled. So the vga bios sets a video mode (via
bocks dispi interface) and the vmware svga emulation isn't notified ...
Making vmware vga emulation read stuff directly from the surface should
improve things a bit as the data returned to the guest reflects what the
actual gfx card state is, even when not set using the vmware vga
interface. The change could still have unwanted side effects though.
I think the "real" fix is to disable bochs on vmware and hack seavgabios
to do modesetting using the vmware vga interfaces.
cheers,
Gerd
[-- Attachment #2: 0001-vmware-remove-depth-bypp-from-state.patch --]
[-- Type: text/plain, Size: 3525 bytes --]
>From 266181a355ac8440d9143d254126244c611d1f67 Mon Sep 17 00:00:00 2001
From: Gerd Hoffmann <kraxel@redhat.com>
Date: Mon, 25 Mar 2013 11:44:21 +0100
Subject: [PATCH] vmware: remove depth+bypp from state
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
hw/vmware_vga.c | 24 +++++++++---------------
1 file changed, 9 insertions(+), 15 deletions(-)
diff --git a/hw/vmware_vga.c b/hw/vmware_vga.c
index d317b4e..aa4d6f8 100644
--- a/hw/vmware_vga.c
+++ b/hw/vmware_vga.c
@@ -39,8 +39,7 @@ struct vmsvga_state_s {
VGACommonState vga;
int invalidated;
- int depth;
- int bypp;
+ int depth_vmstate_dummy;
int enable;
int config;
struct {
@@ -749,11 +748,12 @@ static uint32_t vmsvga_value_read(void *opaque, uint32_t address)
break;
case SVGA_REG_DEPTH:
- ret = s->depth;
+ ret = surface_bits_per_pixel(surface);
break;
case SVGA_REG_BITS_PER_PIXEL:
- ret = (s->depth + 7) & ~7;
+ case SVGA_REG_HOST_BITS_PER_PIXEL:
+ ret = (surface_bits_per_pixel(surface) + 7) & ~7;
break;
case SVGA_REG_PSEUDOCOLOR:
@@ -773,7 +773,7 @@ static uint32_t vmsvga_value_read(void *opaque, uint32_t address)
break;
case SVGA_REG_BYTES_PER_LINE:
- ret = s->bypp * s->new_width;
+ ret = surface_bytes_per_pixel(surface) * s->new_width;
break;
case SVGA_REG_FB_START: {
@@ -852,10 +852,6 @@ static uint32_t vmsvga_value_read(void *opaque, uint32_t address)
ret = s->cursor.on;
break;
- case SVGA_REG_HOST_BITS_PER_PIXEL:
- ret = (s->depth + 7) & ~7;
- break;
-
case SVGA_REG_SCRATCH_SIZE:
ret = s->scratch_size;
break;
@@ -885,6 +881,7 @@ static uint32_t vmsvga_value_read(void *opaque, uint32_t address)
static void vmsvga_value_write(void *opaque, uint32_t address, uint32_t value)
{
struct vmsvga_state_s *s = opaque;
+ DisplaySurface *surface = qemu_console_surface(s->vga.con);
trace_vmware_value_write(s->index, value);
switch (s->index) {
@@ -924,7 +921,7 @@ static void vmsvga_value_write(void *opaque, uint32_t address, uint32_t value)
break;
case SVGA_REG_BITS_PER_PIXEL:
- if (value != s->depth) {
+ if (value != surface_bits_per_pixel(surface)) {
printf("%s: Bad bits per pixel: %i bits\n", __func__, value);
s->config = 0;
}
@@ -1125,7 +1122,7 @@ static const VMStateDescription vmstate_vmware_vga_internal = {
.minimum_version_id_old = 0,
.post_load = vmsvga_post_load,
.fields = (VMStateField[]) {
- VMSTATE_INT32_EQUAL(depth, struct vmsvga_state_s),
+ VMSTATE_INT32_EQUAL(depth_vmstate_dummy, struct vmsvga_state_s),
VMSTATE_INT32(enable, struct vmsvga_state_s),
VMSTATE_INT32(config, struct vmsvga_state_s),
VMSTATE_INT32(cursor.id, struct vmsvga_state_s),
@@ -1183,10 +1180,7 @@ static void vmsvga_init(struct vmsvga_state_s *s,
vga_common_init(&s->vga);
vga_init(&s->vga, address_space, io, true);
vmstate_register(NULL, 0, &vmstate_vga_common, &s->vga);
- /* Save some values here in case they are changed later.
- * This is suspicious and needs more though why it is needed. */
- s->depth = surface_bits_per_pixel(surface);
- s->bypp = surface_bytes_per_pixel(surface);
+ s->depth_vmstate_dummy = surface_bits_per_pixel(surface);
}
static uint64_t vmsvga_io_read(void *opaque, hwaddr addr, unsigned size)
--
1.7.9.7
next prev parent reply other threads:[~2013-03-25 20:31 UTC|newest]
Thread overview: 42+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-12 10:32 [Qemu-devel] [PATCH 00/18] console: data structures overhaul Gerd Hoffmann
2013-03-12 10:32 ` [Qemu-devel] [PATCH 01/18] console: fix displaychangelisteners interface Gerd Hoffmann
2013-03-18 17:49 ` Niel van der Westhuizen
2013-03-18 18:00 ` Peter Maydell
2013-03-12 10:32 ` [Qemu-devel] [PATCH 02/18] console: kill DisplayState->opaque Gerd Hoffmann
2013-03-12 10:32 ` [Qemu-devel] [PATCH 03/18] spice: zap sdpy global Gerd Hoffmann
2013-03-12 10:32 ` [Qemu-devel] [PATCH 04/18] qxl: zap qxl0 global Gerd Hoffmann
2013-03-12 10:32 ` [Qemu-devel] [PATCH 05/18] qxl: better vga init in enter_vga_mode Gerd Hoffmann
2013-03-12 10:32 ` [Qemu-devel] [PATCH 06/18] sdl: drop dead code Gerd Hoffmann
2013-03-12 10:32 ` [Qemu-devel] [PATCH 07/18] console: rework DisplaySurface handling [vga emu side] Gerd Hoffmann
2013-03-12 10:32 ` [Qemu-devel] [PATCH 08/18] console: rework DisplaySurface handling [dcl/ui side] Gerd Hoffmann
2013-03-12 10:32 ` [Qemu-devel] [PATCH 09/18] console: add surface_*() getters Gerd Hoffmann
2013-03-12 10:32 ` [Qemu-devel] [PATCH 10/18] gtk: stop using DisplayState Gerd Hoffmann
2013-03-12 10:32 ` [Qemu-devel] [PATCH 11/18] vnc: " Gerd Hoffmann
2013-03-12 10:32 ` [Qemu-devel] [PATCH 12/18] sdl: " Gerd Hoffmann
2013-03-12 10:32 ` [Qemu-devel] [PATCH 13/18] spice: " Gerd Hoffmann
2013-03-12 10:32 ` [Qemu-devel] [PATCH 14/18] cocoa: " Gerd Hoffmann
2013-03-12 10:32 ` [Qemu-devel] [PATCH 15/18] console: zap displaystate from dcl callbacks Gerd Hoffmann
2013-03-12 10:32 ` [Qemu-devel] [PATCH 16/18] console: stop using DisplayState in gfx hardware emulation Gerd Hoffmann
2013-03-25 7:50 ` Jan Kiszka
2013-03-25 7:55 ` Gerd Hoffmann
2013-03-25 7:59 ` Jan Kiszka
2013-03-25 8:21 ` Gerd Hoffmann
2013-03-25 8:28 ` Jan Kiszka
2013-03-25 8:39 ` Gerd Hoffmann
2013-03-25 8:40 ` Jan Kiszka
2013-03-25 9:10 ` Gerd Hoffmann
2013-03-25 9:32 ` Jan Kiszka
2013-03-25 9:48 ` Gerd Hoffmann
2013-03-25 9:55 ` Jan Kiszka
2013-03-25 10:00 ` Jan Kiszka
2013-03-25 10:37 ` Gerd Hoffmann
[not found] ` <5150572D.6090201@gmail.com>
2013-03-25 13:56 ` Igor Mitsyanko
2013-03-25 20:30 ` Gerd Hoffmann [this message]
2013-03-26 0:02 ` BALATON Zoltan
2013-03-26 8:26 ` Jan Kiszka
2013-04-03 11:50 ` Gerd Hoffmann
2013-04-10 8:31 ` Jan Kiszka
2013-04-16 7:42 ` Gerd Hoffmann
2013-04-20 14:04 ` Jan Kiszka
2013-03-12 10:32 ` [Qemu-devel] [PATCH 17/18] console: zap color_table Gerd Hoffmann
2013-03-12 10:32 ` [Qemu-devel] [PATCH 18/18] console: remove ds_get_* helper functions Gerd Hoffmann
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5150B3F0.3080003@redhat.com \
--to=kraxel@redhat.com \
--cc=i.mitsyanko@gmail.com \
--cc=jan.kiszka@web.de \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).