From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:36806) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TVGJb-0004RM-Qh for qemu-devel@nongnu.org; Mon, 05 Nov 2012 01:37:45 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TVGJa-0001w9-7b for qemu-devel@nongnu.org; Mon, 05 Nov 2012 01:37:43 -0500 Received: from mout.web.de ([212.227.15.4]:63359) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TVGJZ-0001w5-U3 for qemu-devel@nongnu.org; Mon, 05 Nov 2012 01:37:42 -0500 Message-ID: <50975EB4.2050909@web.de> Date: Mon, 05 Nov 2012 07:37:40 +0100 From: Jan Kiszka MIME-Version: 1.0 References: <20121104175517.A142B4B4@mono.eik.bme.hu> In-Reply-To: <20121104175517.A142B4B4@mono.eik.bme.hu> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enig0EFB636808B661C64EB8A269" Subject: Re: [Qemu-devel] [PATCH] vmware_vga: Add back some info in local state partially reverting aa32b38c List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: BALATON Zoltan Cc: qemu-devel@nongnu.org This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig0EFB636808B661C64EB8A269 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: quoted-printable On 2012-11-04 18:41, BALATON Zoltan wrote: > Keep saving display surface parameters at init and using these cached > values instead of getting them when needed. Not sure why this is > needed (maybe due to the interaction with the vga device) but not > doing this broke the Xorg vmware driver at least. >=20 > Signed-off-by: BALATON Zoltan Tested-by: Jan Kiszka Thanks! Jan > --- > hw/vmware_vga.c | 30 +++++++++++++++++++++--------- > 1 file changed, 21 insertions(+), 9 deletions(-) >=20 > diff --git a/hw/vmware_vga.c b/hw/vmware_vga.c > index 7c766fb..834588d 100644 > --- a/hw/vmware_vga.c > +++ b/hw/vmware_vga.c > @@ -39,6 +39,8 @@ struct vmsvga_state_s { > VGACommonState vga; > =20 > int invalidated; > + int depth; > + int bypp; > int enable; > int config; > struct { > @@ -55,6 +57,9 @@ struct vmsvga_state_s { > int new_height; > uint32_t guest; > uint32_t svgaid; > + uint32_t wred; > + uint32_t wgreen; > + uint32_t wblue; > int syncing; > =20 > MemoryRegion fifo_ram; > @@ -718,25 +723,25 @@ static uint32_t vmsvga_value_read(void *opaque, u= int32_t address) > return SVGA_MAX_HEIGHT; > =20 > case SVGA_REG_DEPTH: > - return ds_get_depth(s->vga.ds); > + return s->depth; > =20 > case SVGA_REG_BITS_PER_PIXEL: > - return ds_get_bits_per_pixel(s->vga.ds); > + return (s->depth + 7) & ~7; > =20 > case SVGA_REG_PSEUDOCOLOR: > return 0x0; > =20 > case SVGA_REG_RED_MASK: > - return ds_get_rmask(s->vga.ds); > + return s->wred; > =20 > case SVGA_REG_GREEN_MASK: > - return ds_get_gmask(s->vga.ds); > + return s->wgreen; > =20 > case SVGA_REG_BLUE_MASK: > - return ds_get_bmask(s->vga.ds); > + return s->wblue; > =20 > case SVGA_REG_BYTES_PER_LINE: > - return ds_get_bytes_per_pixel(s->vga.ds) * s->new_width; > + return s->bypp * s->new_width; > =20 > case SVGA_REG_FB_START: { > struct pci_vmsvga_state_s *pci_vmsvga > @@ -801,7 +806,7 @@ static uint32_t vmsvga_value_read(void *opaque, uin= t32_t address) > return s->cursor.on; > =20 > case SVGA_REG_HOST_BITS_PER_PIXEL: > - return ds_get_bits_per_pixel(s->vga.ds); > + return (s->depth + 7) & ~7; > =20 > case SVGA_REG_SCRATCH_SIZE: > return s->scratch_size; > @@ -864,7 +869,7 @@ static void vmsvga_value_write(void *opaque, uint32= _t address, uint32_t value) > break; > =20 > case SVGA_REG_BITS_PER_PIXEL: > - if (value !=3D ds_get_bits_per_pixel(s->vga.ds)) { > + if (value !=3D s->depth) { > printf("%s: Bad bits per pixel: %i bits\n", __func__, valu= e); > s->config =3D 0; > } > @@ -1084,7 +1089,7 @@ static const VMStateDescription vmstate_vmware_vg= a_internal =3D { > .minimum_version_id_old =3D 0, > .post_load =3D vmsvga_post_load, > .fields =3D (VMStateField[]) { > - VMSTATE_UNUSED(4), /* was depth */ > + VMSTATE_INT32_EQUAL(depth, 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), > @@ -1137,6 +1142,13 @@ 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 =3D ds_get_bits_per_pixel(s->vga.ds); > + s->bypp =3D ds_get_bytes_per_pixel(s->vga.ds); > + s->wred =3D ds_get_rmask(s->vga.ds); > + s->wgreen =3D ds_get_gmask(s->vga.ds); > + s->wblue =3D ds_get_bmask(s->vga.ds); > } > =20 > static uint64_t vmsvga_io_read(void *opaque, hwaddr addr, unsigned siz= e) >=20 --------------enig0EFB636808B661C64EB8A269 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.16 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://www.enigmail.net/ iEYEARECAAYFAlCXXrQACgkQitSsb3rl5xQ1UgCg65AC0txgt5b1d6MzkvkA8J7r 8hsAoJ85mox7bb11AEds8fmGh2y8N5Y0 =FeYc -----END PGP SIGNATURE----- --------------enig0EFB636808B661C64EB8A269--