From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:58008) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TUtrw-00063D-K4 for qemu-devel@nongnu.org; Sun, 04 Nov 2012 01:39:42 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TUtrv-0006ro-8s for qemu-devel@nongnu.org; Sun, 04 Nov 2012 01:39:40 -0500 Received: from mout.web.de ([212.227.17.11]:62818) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TUtru-0006rC-VT for qemu-devel@nongnu.org; Sun, 04 Nov 2012 01:39:39 -0500 Message-ID: <50960D9E.6070308@web.de> Date: Sun, 04 Nov 2012 07:39:26 +0100 From: Jan Kiszka MIME-Version: 1.0 References: <20121103105850.B64D5496@mono.eik.bme.hu> In-Reply-To: <20121103105850.B64D5496@mono.eik.bme.hu> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enigCE943A8D89CDCF14934DA248" Subject: Re: [Qemu-devel] [PATCH 2/4 v5] vmware_vga: Remove duplicated info from local state List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: BALATON Zoltan Cc: Blue Swirl , qemu-devel This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enigCE943A8D89CDCF14934DA248 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: quoted-printable On 2012-11-03 11:58, BALATON Zoltan wrote: > Removed info from vmsvga_state that is available from elsewhere and > thus was duplicated here unnecessarily. >=20 > Signed-off-by: BALATON Zoltan > --- > console.h | 20 +++++++ > hw/vmware_vga.c | 159 +++++++++++++++++++++++------------------------= -------- > 2 files changed, 85 insertions(+), 94 deletions(-) >=20 > v5: rebased again >=20 > diff --git a/console.h b/console.h > index 33ad69b..df33e46 100644 > --- a/console.h > +++ b/console.h > @@ -377,6 +377,26 @@ static inline pixman_format_code_t ds_get_format(D= isplayState *ds) > return ds->surface->format; > } > =20 > +static inline int ds_get_depth(DisplayState *ds) > +{ > + return ds->surface->pf.depth; This returns the current depth... > +} > + > +static inline int ds_get_rmask(DisplayState *ds) > +{ > + return ds->surface->pf.rmask; > +} > + > +static inline int ds_get_gmask(DisplayState *ds) > +{ > + return ds->surface->pf.gmask; > +} > + > +static inline int ds_get_bmask(DisplayState *ds) > +{ > + return ds->surface->pf.bmask; > +} > + > #ifdef CONFIG_CURSES > #include > typedef chtype console_ch_t; > diff --git a/hw/vmware_vga.c b/hw/vmware_vga.c > index bf14e78..240443b 100644 > --- a/hw/vmware_vga.c > +++ b/hw/vmware_vga.c =2E.. > @@ -730,23 +726,25 @@ static uint32_t vmsvga_value_read(void *opaque, u= int32_t address) > return SVGA_MAX_HEIGHT; > =20 > case SVGA_REG_DEPTH: > - return s->depth; > + return ds_get_depth(s->vga.ds); =2E..while we used to return a cached value here > =20 > case SVGA_REG_BITS_PER_PIXEL: > - return (s->depth + 7) & ~7; > + return ds_get_bits_per_pixel(s->vga.ds); > =20 > case SVGA_REG_PSEUDOCOLOR: > return 0x0; > =20 > case SVGA_REG_RED_MASK: > - return s->wred; > + return ds_get_rmask(s->vga.ds); > + > case SVGA_REG_GREEN_MASK: > - return s->wgreen; > + return ds_get_gmask(s->vga.ds); > + > case SVGA_REG_BLUE_MASK: > - return s->wblue; > + return ds_get_bmask(s->vga.ds); > =20 > case SVGA_REG_BYTES_PER_LINE: > - return ((s->depth + 7) >> 3) * s->new_width; > + return ds_get_bytes_per_pixel(s->vga.ds) * s->new_width; > =20 > case SVGA_REG_FB_START: { > struct pci_vmsvga_state_s *pci_vmsvga =2E.. > @@ -1125,40 +1130,9 @@ 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); > - > - s->depth =3D ds_get_bits_per_pixel(s->vga.ds); =2E..sampled once during init. I cannot comment on why it was done like this, just that this patch breaks the Linux vmware X driver. Please fix or revert. Jan --------------enigCE943A8D89CDCF14934DA248 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/ iEYEARECAAYFAlCWDaEACgkQitSsb3rl5xQwKQCg7s6bJ9IDYhUJHtjiD5bWmOk5 7gsAnjuFJYDSopa1kXpy7UxFb6gMlpNU =lBsX -----END PGP SIGNATURE----- --------------enigCE943A8D89CDCF14934DA248--